Drop deprecated aggregate-update positional args
The name and availability_zone positional arguments
were deprecated in Newton as part of change:
8030879330
This change removes them.
Change-Id: I61031eb9eea37891f0be5d67942aaae0859065f0
This commit is contained in:
parent
ba24847cbe
commit
db55f563ad
@ -32,13 +32,6 @@ class TestAggregatesNovaClient(base.ClientTestBase):
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def test_aggregate_update_name_legacy(self):
|
||||
self.nova('aggregate-create', params=self.agg1)
|
||||
self.nova('aggregate-update', params='%s %s' % (self.agg1, self.agg2))
|
||||
output = self.nova('aggregate-show', params=self.agg2)
|
||||
self.assertIn(self.agg2, output)
|
||||
self.nova('aggregate-delete', params=self.agg2)
|
||||
|
||||
def test_aggregate_update_name(self):
|
||||
self.nova('aggregate-create', params=self.agg1)
|
||||
self.nova('aggregate-update',
|
||||
@ -47,14 +40,6 @@ class TestAggregatesNovaClient(base.ClientTestBase):
|
||||
self.assertIn(self.agg2, output)
|
||||
self.nova('aggregate-delete', params=self.agg2)
|
||||
|
||||
def test_aggregate_update_az_legacy(self):
|
||||
self.nova('aggregate-create', params=self.agg2)
|
||||
self.nova('aggregate-update',
|
||||
params='%s %s myaz' % (self.agg2, self.agg2))
|
||||
output = self.nova('aggregate-show', params=self.agg2)
|
||||
self.assertIn('myaz', output)
|
||||
self.nova('aggregate-delete', params=self.agg2)
|
||||
|
||||
def test_aggregate_update_az(self):
|
||||
self.nova('aggregate-create', params=self.agg2)
|
||||
self.nova('aggregate-update',
|
||||
|
@ -2971,27 +2971,10 @@ def do_aggregate_delete(cs, args):
|
||||
'aggregate',
|
||||
metavar='<aggregate>',
|
||||
help=_('Name or ID of aggregate to update.'))
|
||||
@utils.arg(
|
||||
'old_name',
|
||||
metavar='<name>',
|
||||
nargs='?',
|
||||
action=shell.DeprecatedAction,
|
||||
use=_('use "%s"; this option will be removed in '
|
||||
'novaclient 5.0.0.') % '--name',
|
||||
help=argparse.SUPPRESS)
|
||||
@utils.arg(
|
||||
'--name',
|
||||
dest='name',
|
||||
help=_('Name of aggregate.'))
|
||||
@utils.arg(
|
||||
'old_availability_zone',
|
||||
metavar='<availability-zone>',
|
||||
nargs='?',
|
||||
default=None,
|
||||
action=shell.DeprecatedAction,
|
||||
use=_('use "%s"; this option will be removed in '
|
||||
'novaclient 5.0.0.') % '--availability_zone',
|
||||
help=argparse.SUPPRESS)
|
||||
@utils.arg(
|
||||
'--availability-zone',
|
||||
metavar='<availability-zone>',
|
||||
@ -3001,11 +2984,10 @@ def do_aggregate_update(cs, args):
|
||||
"""Update the aggregate's name and optionally availability zone."""
|
||||
aggregate = _find_aggregate(cs, args.aggregate)
|
||||
updates = {}
|
||||
if args.name or args.old_name:
|
||||
updates["name"] = args.name or args.old_name
|
||||
if args.availability_zone or args.old_availability_zone:
|
||||
updates["availability_zone"] = (args.availability_zone or
|
||||
args.old_availability_zone)
|
||||
if args.name:
|
||||
updates["name"] = args.name
|
||||
if args.availability_zone:
|
||||
updates["availability_zone"] = args.availability_zone
|
||||
|
||||
aggregate = cs.aggregates.update(aggregate.id, updates)
|
||||
print(_("Aggregate %s has been successfully updated.") % aggregate.id)
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The deprecated `name` and `availability_zone` positional arguments in
|
||||
the ``nova aggregate-update`` command have been removed. Use the
|
||||
``--name`` and ``--availability-zone`` options instead.
|
Loading…
Reference in New Issue
Block a user