diff options
| author | Steve Martinelli <stevemar@ca.ibm.com> | 2014-07-09 13:40:12 -0400 |
|---|---|---|
| committer | Steve Martinelli <stevemar@ca.ibm.com> | 2014-08-24 18:16:07 +0000 |
| commit | c2b0cec6e3cfa7b5ebd9762abca9179581d8722e (patch) | |
| tree | 3a78c01c62d13cd3ae30d43f3be3c9b89c63c041 /openstackclient/compute/v2/keypair.py | |
| parent | eb6b3027e61b9f62e161506f8a8b7d0efaad29c6 (diff) | |
| download | python-openstackclient-c2b0cec6e3cfa7b5ebd9762abca9179581d8722e.tar.gz | |
Create message variables for exceptions
Instead of inline messages, let's create variables instead, as
it's easier to find strings, and mark them for translation.
Change-Id: Ibbcfdbc59d12a0cb4af50f73043d3ff7f3c76f99
Diffstat (limited to 'openstackclient/compute/v2/keypair.py')
| -rw-r--r-- | openstackclient/compute/v2/keypair.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/openstackclient/compute/v2/keypair.py b/openstackclient/compute/v2/keypair.py index 972443a4..6aedbfee 100644 --- a/openstackclient/compute/v2/keypair.py +++ b/openstackclient/compute/v2/keypair.py @@ -57,8 +57,9 @@ class CreateKeypair(show.ShowOne): with open(os.path.expanduser(parsed_args.public_key)) as p: public_key = p.read() except IOError as e: - raise exceptions.CommandError( - "Key file %s not found: %s" % (parsed_args.public_key, e)) + msg = "Key file %s not found: %s" + raise exceptions.CommandError(msg + % (parsed_args.public_key, e)) keypair = compute_client.keypairs.create( parsed_args.name, |
