Deprecate map-packages, replaced by pkg-map

This patch writes a warning out to stderr to notify element authors
that may be using map-packages to migrate to pkg-map.  This patch
also prints out a warning during image-create that lists the specific
elements that are not using pkg-map.

Change-Id: I7e2a7611dd5650815736ce998aa94a7833193d06
This commit is contained in:
Ryan Brady 2014-10-22 11:24:04 -04:00
parent 2337532954
commit 4178c0c69d
4 changed files with 19 additions and 2 deletions

View File

@ -1,4 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
# dib-lint: disable=indent
# dib-lint indent requirements causes issue with pep8
# Copyright 2013 SUSE Linux Products GmbH # Copyright 2013 SUSE Linux Products GmbH
# #
@ -14,6 +16,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from __future__ import print_function
import sys import sys
# Manually maintained for brevity; consider making this compiled from # Manually maintained for brevity; consider making this compiled from
@ -57,6 +60,9 @@ package_map = {
'openstack-neutron-openvswitch': 'openstack-neutron-openvswitch-agent', 'openstack-neutron-openvswitch': 'openstack-neutron-openvswitch-agent',
} }
print("WARNING: map-packages is deprecated. Please use the pkg-map element.",
file=sys.stderr)
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
print(package_map.get(arg, arg)) print(package_map.get(arg, arg))
sys.exit(0) sys.exit(0)

View File

@ -7,7 +7,7 @@ sudo mkdir -p $TMP_MOUNT_PATH/usr/share/pkg-map/
for ELEMENT in $IMAGE_ELEMENT ; do for ELEMENT in $IMAGE_ELEMENT ; do
for DIR in ${ELEMENTS_PATH//:/ }; do for DIR in ${ELEMENTS_PATH//:/ }; do
if [ -f "$DIR/$ELEMENT/pkg-map" ]; then if [ -f "$DIR/$ELEMENT/pkg-map" ]; then
sudo cp $DIR/$ELEMENT/pkg-map $TMP_MOUNT_PATH/usr/share/pkg-map/$ELEMENT sudo cp "$DIR/$ELEMENT/pkg-map" "$TMP_MOUNT_PATH/usr/share/pkg-map/$ELEMENT"
fi fi
done done
done done

View File

@ -1,4 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
# dib-lint: disable=indent
# dib-lint indent requirements causes issue with pep8
# Copyright 2012 Hewlett-Packard Development Company, L.P. # Copyright 2012 Hewlett-Packard Development Company, L.P.
# #
@ -14,6 +16,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from __future__ import print_function
import sys import sys
# Manually maintained for brevity; consider making this compiled from # Manually maintained for brevity; consider making this compiled from
@ -80,6 +83,9 @@ package_map = {
'openstack-neutron-dhcp-agent': 'openstack-neutron', 'openstack-neutron-dhcp-agent': 'openstack-neutron',
} }
print("WARNING: map-packages is deprecated. Please use the pkg-map element.",
file=sys.stderr)
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
if arg not in package_map and arg.endswith('-dev'): if arg not in package_map and arg.endswith('-dev'):
# convert -dev into devel # convert -dev into devel

View File

@ -1,5 +1,6 @@
#!/usr/bin/env python #!/usr/bin/env python
# dib-lint: disable=indent
# dib-lint indent requirements causes issue with pep8
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain # not use this file except in compliance with the License. You may obtain
@ -13,6 +14,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from __future__ import print_function
import sys import sys
# Manually maintained for brevity; consider making this compiled from # Manually maintained for brevity; consider making this compiled from
@ -40,6 +42,9 @@ package_map = {
'vlan': 'vconfig', 'vlan': 'vconfig',
} }
print("WARNING: map-packages is deprecated. Please use the pkg-map element.",
file=sys.stderr)
for arg in sys.argv[1:]: for arg in sys.argv[1:]:
print(package_map.get(arg, arg)) print(package_map.get(arg, arg))
sys.exit(0) sys.exit(0)