Fix trusted-image-certificate-id help text

Fix the help text for nova boot to include that a parameter
is expected for trusted-image-certificate-id.  Also update the
UnsupportedAttribute error to mention the env variable to
reduce confusion.

Change-Id: Ic5980b610e5fd97d3a858a2a513e2863657f36c2
This commit is contained in:
Brianna Poulos 2018-06-19 11:16:57 -04:00
parent cf57bed266
commit d422fb061f
2 changed files with 11 additions and 5 deletions

View File

@ -1011,7 +1011,7 @@ nova boot
[--config-drive <value>] [--poll] [--admin-pass <value>]
[--access-ip-v4 <value>] [--access-ip-v6 <value>]
[--description <description>]
[--trusted-image-certificate-id]
[--trusted-image-certificate-id <trusted-image-certificate-id>]
<name>
Boot a new server.

View File

@ -515,8 +515,13 @@ def _boot(cs, args):
boot_kwargs['trusted_image_certificates'] = (
args.trusted_image_certificates)
elif utils.env('OS_TRUSTED_IMAGE_CERTIFICATE_IDS'):
boot_kwargs["trusted_image_certificates"] = utils.env(
'OS_TRUSTED_IMAGE_CERTIFICATE_IDS').split(',')
if cs.api_version >= api_versions.APIVersion('2.63'):
boot_kwargs["trusted_image_certificates"] = utils.env(
'OS_TRUSTED_IMAGE_CERTIFICATE_IDS').split(',')
else:
raise exceptions.UnsupportedAttribute(
"OS_TRUSTED_IMAGE_CERTIFICATE_IDS",
"2.63")
return boot_args, boot_kwargs
@ -1924,8 +1929,9 @@ def do_rebuild(cs, args):
# confusion with unsetting the value.
kwargs['trusted_image_certificates'] = trusted_image_certificates
elif utils.env('OS_TRUSTED_IMAGE_CERTIFICATE_IDS'):
raise exceptions.UnsupportedAttribute("trusted_image_certificates",
"2.63")
raise exceptions.UnsupportedAttribute(
"OS_TRUSTED_IMAGE_CERTIFICATE_IDS",
"2.63")
server = server.rebuild(image, _password, **kwargs)
_print_server(cs, args, server)