diff options
| author | Joe Gordon <jogo@cloudscaling.com> | 2012-12-06 13:44:02 +0200 |
|---|---|---|
| committer | Joe Gordon <jogo@cloudscaling.com> | 2012-12-06 13:53:21 +0200 |
| commit | d8c4e0cd2652f37b68ffc689fc5ddef31f529379 (patch) | |
| tree | a194209b07bb96f5e34130e46f5001747da3761f /openstack/common/cliutils.py | |
| parent | 255a27333092be0523949bd624c94b740515d018 (diff) | |
| download | oslo-d8c4e0cd2652f37b68ffc689fc5ddef31f529379.tar.gz oslo-d8c4e0cd2652f37b68ffc689fc5ddef31f529379.tar.xz oslo-d8c4e0cd2652f37b68ffc689fc5ddef31f529379.zip | |
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
Diffstat (limited to 'openstack/common/cliutils.py')
| -rw-r--r-- | openstack/common/cliutils.py | 9 |
1 files changed, 3 insertions, 6 deletions
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): |
