Merge "compute: Fix flavor create --id auto"
This commit is contained in:
@@ -156,12 +156,25 @@ class CreateFlavor(command.ShowOne):
|
|||||||
msg = _("--project is only allowed with --private")
|
msg = _("--project is only allowed with --private")
|
||||||
raise exceptions.CommandError(msg)
|
raise exceptions.CommandError(msg)
|
||||||
|
|
||||||
|
flavor_id = parsed_args.id
|
||||||
|
if parsed_args.id == 'auto':
|
||||||
|
# novaclient aliased 'auto' to mean "generate a UUID for me": we
|
||||||
|
# do the same to avoid breaking existing users
|
||||||
|
flavor_id = None
|
||||||
|
|
||||||
|
msg = _(
|
||||||
|
"Passing '--id auto' is deprecated. Nova will automatically "
|
||||||
|
"assign a UUID-like ID if no ID is provided. Omit the '--id' "
|
||||||
|
"parameter instead."
|
||||||
|
)
|
||||||
|
self.log.warning(msg)
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
'name': parsed_args.name,
|
'name': parsed_args.name,
|
||||||
'ram': parsed_args.ram,
|
'ram': parsed_args.ram,
|
||||||
'vcpus': parsed_args.vcpus,
|
'vcpus': parsed_args.vcpus,
|
||||||
'disk': parsed_args.disk,
|
'disk': parsed_args.disk,
|
||||||
'id': parsed_args.id,
|
'id': flavor_id,
|
||||||
'ephemeral': parsed_args.ephemeral,
|
'ephemeral': parsed_args.ephemeral,
|
||||||
'swap': parsed_args.swap,
|
'swap': parsed_args.swap,
|
||||||
'rxtx_factor': parsed_args.rxtx_factor,
|
'rxtx_factor': parsed_args.rxtx_factor,
|
||||||
|
@@ -247,7 +247,7 @@ class TestFlavorCreate(TestFlavor):
|
|||||||
'ram': self.flavor.ram,
|
'ram': self.flavor.ram,
|
||||||
'vcpus': self.flavor.vcpus,
|
'vcpus': self.flavor.vcpus,
|
||||||
'disk': self.flavor.disk,
|
'disk': self.flavor.disk,
|
||||||
'id': 'auto',
|
'id': None,
|
||||||
'ephemeral': self.flavor.ephemeral,
|
'ephemeral': self.flavor.ephemeral,
|
||||||
'swap': self.flavor.swap,
|
'swap': self.flavor.swap,
|
||||||
'rxtx_factor': self.flavor.rxtx_factor,
|
'rxtx_factor': self.flavor.rxtx_factor,
|
||||||
|
6
releasenotes/notes/flavor-id-auto-e21157f97dc1d7f2.yaml
Normal file
6
releasenotes/notes/flavor-id-auto-e21157f97dc1d7f2.yaml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
deprecations:
|
||||||
|
- |
|
||||||
|
The ``--id auto`` alias for the ``flavor create`` command is deprecated
|
||||||
|
for removal. Omit the option entirely to ensure the server creates the
|
||||||
|
ID for you.
|
Reference in New Issue
Block a user