diff --git a/contrib/heat_keystoneclient_v2/heat_keystoneclient_v2/client.py b/contrib/heat_keystoneclient_v2/heat_keystoneclient_v2/client.py index 81846c6c2e..674958c989 100644 --- a/contrib/heat_keystoneclient_v2/heat_keystoneclient_v2/client.py +++ b/contrib/heat_keystoneclient_v2/heat_keystoneclient_v2/client.py @@ -223,6 +223,13 @@ class KeystoneClientV2(object): '''Pass through method since no project was created.''' pass + def create_stack_domain_user_keypair(self, user_id, project_id): + return self.create_ec2_keypair(user_id) + + def delete_stack_domain_user_keypair(self, user_id, project_id, + credential_id): + return self.delete_ec2_keypair(user_id, credential_id) + # ###################### # # V3 Unsupported Methods # # ###################### # diff --git a/heat/engine/stack_user.py b/heat/engine/stack_user.py index 978888807a..6994a7c056 100644 --- a/heat/engine/stack_user.py +++ b/heat/engine/stack_user.py @@ -132,7 +132,13 @@ class StackUser(resource.Resource): raise exception.Error(_("Error creating ec2 keypair for user %s") % user_id) else: - self.data_set('credential_id', kp.id, redact=True) + try: + credential_id = kp.id + except AttributeError: + # keystone v2 keypairs do not have an id attribute. Use the + # access key instead. + credential_id = kp.access + self.data_set('credential_id', credential_id, redact=True) self.data_set('access_key', kp.access, redact=True) self.data_set('secret_key', kp.secret, redact=True) return kp