From 5e06d6a3a66d4f0e3115ce48f510fd81c5feee8c Mon Sep 17 00:00:00 2001 From: Huanxuan Ao Date: Thu, 14 Jul 2016 18:34:19 +0800 Subject: [PATCH] Change to plural form of object in multi delete error message in networkv2 Usually, the error message of multi delete is: "'result' of 'total' 'objects' failed to delete" the objects is a plural form. To match the other multi delete error messages in OSC, change the object in delete error message in networkv2 to a plural form. Just add a 's' in the message. Change-Id: I17e0735d025bb61014db709d2639813565015b3d --- openstackclient/network/common.py | 2 +- openstackclient/tests/network/v2/test_floating_ip.py | 4 ++-- openstackclient/tests/network/v2/test_security_group.py | 4 ++-- openstackclient/tests/network/v2/test_security_group_rule.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/openstackclient/network/common.py b/openstackclient/network/common.py index f62840fc04..2b1a5656f2 100644 --- a/openstackclient/network/common.py +++ b/openstackclient/network/common.py @@ -111,7 +111,7 @@ class NetworkAndComputeDelete(NetworkAndComputeCommand): if ret: total = len(resources) - msg = _("%(num)s of %(total)s %(resource)s failed to delete.") % { + msg = _("%(num)s of %(total)s %(resource)ss failed to delete.") % { "num": ret, "total": total, "resource": self.resource, diff --git a/openstackclient/tests/network/v2/test_floating_ip.py b/openstackclient/tests/network/v2/test_floating_ip.py index 5cd5279aff..234fe4465a 100644 --- a/openstackclient/tests/network/v2/test_floating_ip.py +++ b/openstackclient/tests/network/v2/test_floating_ip.py @@ -211,7 +211,7 @@ class TestDeleteFloatingIPNetwork(TestFloatingIPNetwork): self.cmd.take_action(parsed_args) self.fail('CommandError should be raised.') except exceptions.CommandError as e: - self.assertEqual('1 of 2 floating_ip failed to delete.', str(e)) + self.assertEqual('1 of 2 floating_ips failed to delete.', str(e)) self.network.find_ip.assert_any_call( self.floating_ips[0].id, ignore_missing=False) @@ -462,7 +462,7 @@ class TestDeleteFloatingIPCompute(TestFloatingIPCompute): self.cmd.take_action(parsed_args) self.fail('CommandError should be raised.') except exceptions.CommandError as e: - self.assertEqual('1 of 2 floating_ip failed to delete.', str(e)) + self.assertEqual('1 of 2 floating_ips failed to delete.', str(e)) self.compute.floating_ips.get.assert_any_call( self.floating_ips[0].id) diff --git a/openstackclient/tests/network/v2/test_security_group.py b/openstackclient/tests/network/v2/test_security_group.py index 7ac925ac2f..cea64897e6 100644 --- a/openstackclient/tests/network/v2/test_security_group.py +++ b/openstackclient/tests/network/v2/test_security_group.py @@ -296,7 +296,7 @@ class TestDeleteSecurityGroupNetwork(TestSecurityGroupNetwork): self.cmd.take_action(parsed_args) self.fail('CommandError should be raised.') except exceptions.CommandError as e: - self.assertEqual('1 of 2 group failed to delete.', str(e)) + self.assertEqual('1 of 2 groups failed to delete.', str(e)) self.network.find_security_group.assert_any_call( self._security_groups[0].name, ignore_missing=False) @@ -384,7 +384,7 @@ class TestDeleteSecurityGroupCompute(TestSecurityGroupCompute): self.cmd.take_action(parsed_args) self.fail('CommandError should be raised.') except exceptions.CommandError as e: - self.assertEqual('1 of 2 group failed to delete.', str(e)) + self.assertEqual('1 of 2 groups failed to delete.', str(e)) self.compute.security_groups.get.assert_any_call( self._security_groups[0].id) diff --git a/openstackclient/tests/network/v2/test_security_group_rule.py b/openstackclient/tests/network/v2/test_security_group_rule.py index 67a123aa10..34d35629e1 100644 --- a/openstackclient/tests/network/v2/test_security_group_rule.py +++ b/openstackclient/tests/network/v2/test_security_group_rule.py @@ -739,7 +739,7 @@ class TestDeleteSecurityGroupRuleNetwork(TestSecurityGroupRuleNetwork): self.cmd.take_action(parsed_args) self.fail('CommandError should be raised.') except exceptions.CommandError as e: - self.assertEqual('1 of 2 rule failed to delete.', str(e)) + self.assertEqual('1 of 2 rules failed to delete.', str(e)) self.network.find_security_group_rule.assert_any_call( self._security_group_rules[0].id, ignore_missing=False) @@ -819,7 +819,7 @@ class TestDeleteSecurityGroupRuleCompute(TestSecurityGroupRuleCompute): self.cmd.take_action(parsed_args) self.fail('CommandError should be raised.') except exceptions.CommandError as e: - self.assertEqual('1 of 2 rule failed to delete.', str(e)) + self.assertEqual('1 of 2 rules failed to delete.', str(e)) self.compute.security_group_rules.delete.assert_any_call( self._security_group_rules[0].id)