diff options
author | Zuul <zuul@review.opendev.org> | 2021-08-26 08:14:22 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2021-08-26 08:14:22 +0000 |
commit | d9c556e69a8b05cacbbcea612833e654de7b2b85 (patch) | |
tree | 15a2853f0ee5dfdf32483f92b08de831b45e292f | |
parent | eca51342c331e86c2e14f738b1db57c8767de3d0 (diff) | |
parent | 02d6fe9be629c28da2568d1ad51a5334064709bd (diff) | |
download | python-openstackclient-d9c556e69a8b05cacbbcea612833e654de7b2b85.tar.gz |
Merge "L3 conntrack helper: Use singular name consistently"
-rw-r--r-- | openstackclient/network/v2/l3_conntrack_helper.py | 8 | ||||
-rw-r--r-- | openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/openstackclient/network/v2/l3_conntrack_helper.py b/openstackclient/network/v2/l3_conntrack_helper.py index dae25927..94788823 100644 --- a/openstackclient/network/v2/l3_conntrack_helper.py +++ b/openstackclient/network/v2/l3_conntrack_helper.py @@ -99,8 +99,8 @@ class DeleteConntrackHelper(command.Command): help=_('Router that the conntrack helper belong to') ) parser.add_argument( - 'conntrack_helper_ids', - metavar='<conntrack-helper-ids>', + 'conntrack_helper_id', + metavar='<conntrack-helper-id>', nargs='+', help=_('The ID of the conntrack helper(s) to delete') ) @@ -112,7 +112,7 @@ class DeleteConntrackHelper(command.Command): result = 0 router = client.find_router(parsed_args.router, ignore_missing=False) - for ct_helper in parsed_args.conntrack_helper_ids: + for ct_helper in parsed_args.conntrack_helper_id: try: client.delete_conntrack_helper( ct_helper, router.id, ignore_missing=False) @@ -123,7 +123,7 @@ class DeleteConntrackHelper(command.Command): {'ct_helper': ct_helper, 'e': e}) if result > 0: - total = len(parsed_args.conntrack_helper_ids) + total = len(parsed_args.conntrack_helper_id) msg = (_("%(result)s of %(total)s L3 conntrack helpers failed " "to delete.") % {'result': result, 'total': total}) raise exceptions.CommandError(msg) diff --git a/openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py b/openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py index 1676c9ff..b3d026a7 100644 --- a/openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py +++ b/openstackclient/tests/unit/network/v2/test_l3_conntrack_helper.py @@ -127,7 +127,7 @@ class TestDeleteL3ConntrackHelper(TestConntrackHelper): self.ct_helper.id ] verifylist = [ - ('conntrack_helper_ids', [self.ct_helper.id]), + ('conntrack_helper_id', [self.ct_helper.id]), ('router', self.ct_helper.router_id), ] parsed_args = self.check_parser(self.cmd, arglist, verifylist) @@ -143,7 +143,7 @@ class TestDeleteL3ConntrackHelper(TestConntrackHelper): self.ct_helper.id ] verifylist = [ - ('conntrack_helper_ids', [self.ct_helper.id]), + ('conntrack_helper_id', [self.ct_helper.id]), ('router', self.router.id), ] self.network.delete_conntrack_helper.side_effect = Exception( |