From d8c4e0cd2652f37b68ffc689fc5ddef31f529379 Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Thu, 6 Dec 2012 13:44:02 +0200 Subject: Change Exception MissingArgs's string The error message in MissingArgs shows python names not the arg name the user will use in the CLI (see for example 'nova-manage flavor create') Change-Id: I544cede6ec60c8cde2438d1b378191271cec1aec --- openstack/common/cliutils.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'openstack') diff --git a/openstack/common/cliutils.py b/openstack/common/cliutils.py index 8f4dc44..89a6f62 100644 --- a/openstack/common/cliutils.py +++ b/openstack/common/cliutils.py @@ -15,7 +15,6 @@ # under the License. import inspect -import string class MissingArgs(Exception): @@ -25,12 +24,10 @@ class MissingArgs(Exception): def __str__(self): if len(self.missing) == 1: - return ("An argument is missing: %(missing)s" % - dict(missing=self.missing[0])) + return "An argument is missing" else: - return ("%(num)d arguments are missing: %(missing)s" % - dict(num=len(self.missing), - missing=string.join(self.missing, ', '))) + return ("%(num)d arguments are missing" % + dict(num=len(self.missing))) def validate_args(fn, *args, **kwargs): -- cgit