Merge "Modified --os-image option in overcloud image upload" into stable/ocata

This commit is contained in:
Jenkins 2017-07-26 01:36:57 +00:00 committed by Gerrit Code Review
commit 7582cfc41a
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

@ -755,8 +755,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(
@ -790,14 +790,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'
@ -805,7 +805,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)