diff options
| author | Brian Waldon <brian.waldon@rackspace.com> | 2011-04-26 04:26:14 +0000 |
|---|---|---|
| committer | Tarmac <> | 2011-04-26 04:26:14 +0000 |
| commit | 5ea80e2f62e7a35967fc509aef8e7158577a2980 (patch) | |
| tree | 0916e260d30612ef6187aa7daa3bbc6bf8db2cc9 /nova/api | |
| parent | 08cf0db667b68a6351662b2c550af93624e66d4d (diff) | |
| parent | c2ec2054a6b42b086580c6647ae0d5d808b4d2c7 (diff) | |
Refactoring the usage of nova.exception.Duplicate
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 9f4c0c05e..dc9b92bc5 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -61,8 +61,7 @@ def _gen_key(context, user_id, key_name): # creation before creating key_pair try: db.key_pair_get(context, user_id, key_name) - raise exception.Duplicate(_("The key_pair %s already exists") - % key_name) + raise exception.KeyPairExists(key_name=key_name) except exception.NotFound: pass private_key, public_key, fingerprint = crypto.generate_key_pair() |
