Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
priteau committed Jun 20, 2013
1 parent c564f3b commit d0940a1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sandbox/FG/add_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ def register_key_with_iaas(iaas_url, keytext, keyname, access_key, access_secret

# Workaround for a bug in Nimbus <= 2.10.1:
# import_key_pair does not properly update an existing key
if ec2conn.get_key_pair(keyname) is not None:
ec2conn.delete_key_pair(keyname)
try:
if ec2conn.get_key_pair(keyname) is not None:
ec2conn.delete_key_pair(keyname)
except IndexError:
# This exception is raised when boto can't find a key on Nimbus
pass
ec2conn.import_key_pair(keyname, keytext)


Expand Down

0 comments on commit d0940a1

Please sign in to comment.