Modified --os-image option in overcloud image upload

While using --os-image option in overcloud image upload command
from python-tripleoclient, it was getting translated somehow
into the OS_IMAGE env variable which was causing conflict.

Changed os-image to os-image-name to avoid the conflict.

Change-Id: Id55c838714263c0f886a7402ab72dfb1820cee7c
Closes-Bug: 1693344
This commit is contained in:
PranaliD 2017-07-04 12:34:51 +05:30 committed by Yolanda Robla
parent ee25a7bb01
commit dd5cb7885c
2 changed files with 11 additions and 5 deletions

View File

@ -0,0 +1,6 @@
---
features:
- Added new os-image-name parameter, that replaces
os-image one, because it was conflicting with
glance parameter naming, causing os-image to
don't work properly.

View File

@ -237,8 +237,8 @@ class UploadOvercloudImage(command.Command):
help=_("Path to directory containing image files"),
)
parser.add_argument(
"--os-image",
default=os.environ.get('OS_IMAGE', 'overcloud-full.qcow2'),
"--os-image-name",
default=os.environ.get('OS_IMAGE_NAME', 'overcloud-full.qcow2'),
help=_("OpenStack disk image filename"),
)
parser.add_argument(
@ -272,14 +272,14 @@ class UploadOvercloudImage(command.Command):
if parsed_args.whole_disk:
image_files = [
parsed_args.os_image
parsed_args.os_image_name
]
overcloud_image_type = 'whole disk'
else:
image_files = [
'%s.initramfs' % os.environ['AGENT_NAME'],
'%s.kernel' % os.environ['AGENT_NAME'],
parsed_args.os_image
parsed_args.os_image_name
]
overcloud_image_type = 'partition'
@ -287,7 +287,7 @@ class UploadOvercloudImage(command.Command):
self._check_file_exists(os.path.join(parsed_args.image_path,
image))
image_name = parsed_args.os_image.split('.')[0]
image_name = parsed_args.os_image_name.split('.')[0]
self.log.debug("uploading %s overcloud images to glance" %
overcloud_image_type)