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
This commit is contained in:
Huanxuan Ao 2016-07-14 18:34:19 +08:00
parent 63a6789add
commit 5e06d6a3a6
4 changed files with 7 additions and 7 deletions

View File

@ -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,

View File

@ -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)

View File

@ -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)

View File

@ -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)