diff --git a/novaclient/tests/functional/v2/test_aggregates.py b/novaclient/tests/functional/v2/test_aggregates.py index 6eb30242e..b89e35664 100644 --- a/novaclient/tests/functional/v2/test_aggregates.py +++ b/novaclient/tests/functional/v2/test_aggregates.py @@ -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', diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py index 6339a6432..87b9e6730 100644 --- a/novaclient/v2/shell.py +++ b/novaclient/v2/shell.py @@ -2971,27 +2971,10 @@ def do_aggregate_delete(cs, args): 'aggregate', metavar='', help=_('Name or ID of aggregate to update.')) -@utils.arg( - 'old_name', - metavar='', - 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='', - 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='', @@ -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) diff --git a/releasenotes/notes/drop-deprecated-aggregate-update-args-17bd019f4be34b18.yaml b/releasenotes/notes/drop-deprecated-aggregate-update-args-17bd019f4be34b18.yaml new file mode 100644 index 000000000..f02d0be84 --- /dev/null +++ b/releasenotes/notes/drop-deprecated-aggregate-update-args-17bd019f4be34b18.yaml @@ -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.