From: Steven Hardy Date: Thu, 13 Sep 2012 10:27:15 +0000 (+0100) Subject: heat : bugfix convert User resource to physical_resource_name() X-Git-Tag: 2014.1~1427^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=38e3b5a24a026e0fa087db9ade14182af752d377;p=openstack-build%2Fheat-build.git heat : bugfix convert User resource to physical_resource_name() engine user.py needs the self.name references changed to self.physical_resource_name() to align with the recent resource naming changes. Change-Id: I4620a4afc5e9c11d7b6d9348aaac35bcfa31bbac Signed-off-by: Steven Hardy --- diff --git a/heat/engine/user.py b/heat/engine/user.py index 13abd9e6..45920e1b 100644 --- a/heat/engine/user.py +++ b/heat/engine/user.py @@ -51,7 +51,8 @@ class User(Resource): tenant_id = self.context.tenant_id user = self.keystone().users.create(self.physical_resource_name(), passwd, - '%s@heat-api.org' % self.name, + '%s@heat-api.org' % + self.physical_resource_name(), tenant_id=tenant_id, enabled=True) self.instance_id_set(user.id) @@ -65,8 +66,8 @@ class User(Resource): try: user = self.keystone().users.get(DummyId(self.instance_id)) except Exception as ex: - logger.info('user %s/%s does not exist' % (self.name, - self.instance_id)) + logger.info('user %s/%s does not exist' % + (self.physical_resource_name(), self.instance_id)) return # tempory hack to work around an openstack bug. @@ -96,17 +97,18 @@ class User(Resource): raise exception.Error(reason) def FnGetRefId(self): - return unicode(self.name) + return unicode(self.physical_resource_name()) def FnGetAtt(self, key): res = None if key == 'Policies': res = self.properties['Policies'] else: - raise exception.InvalidTemplateAttribute(resource=self.name, - key=key) + raise exception.InvalidTemplateAttribute( + resource=self.physical_resource_name(), key=key) - logger.info('%s.GetAtt(%s) == %s' % (self.name, key, res)) + logger.info('%s.GetAtt(%s) == %s' % (self.physical_resource_name(), + key, res)) return unicode(res) @@ -178,8 +180,9 @@ class AccessKey(Resource): if key == 'SecretAccessKey': res = self._secret_accesskey() else: - raise exception.InvalidTemplateAttribute(resource=self.name, - key=key) + raise exception.InvalidTemplateAttribute( + resource=self.physical_resource_name(), key=key) - logger.info('%s.GetAtt(%s) == %s' % (self.name, key, res)) + logger.info('%s.GetAtt(%s) == %s' % (self.physical_resource_name(), + key, res)) return unicode(res)