Permalink
Browse files

Add workaround for importing key pairs that already exist

  • Loading branch information...
1 parent 87750bc commit 31e4d537654e0b9a3cfe02387fc103bbf2d9a4a7 @priteau priteau committed May 30, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 sandbox/FG/add_users.py
@@ -58,6 +58,11 @@ def register_key_with_iaas(iaas_url, keytext, keyname, access_key, access_secret
region = RegionInfo(name="nimbus", endpoint=host)
ec2conn = boto.connect_ec2(access_key, access_secret, region=region, port=port, validate_certs=False)
+
+ # 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)
ec2conn.import_key_pair(keyname, keytext)

0 comments on commit 31e4d53

Please sign in to comment.