Skip to content
Browse files

Work around nimbusproject/nimbus#121

  • Loading branch information...
1 parent c564f3b commit d0940a105162a528a7f7bf3dfc414e01fae66e46 @priteau priteau committed Jun 20, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 sandbox/FG/add_users.py
View
8 sandbox/FG/add_users.py
@@ -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)

0 comments on commit d0940a1

Please sign in to comment.
Something went wrong with that request. Please try again.