keystoneclient unit tests fails on update tenants and users
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Identity (keystone) |
Fix Released
|
Critical
|
Dolph Mathews | ||
python-keystoneclient |
Fix Released
|
Critical
|
Joseph Heck |
Bug Description
File "/opt/stack/
self.
File "/opt/stack/
raise AttributeError(k)
Same error on test_user_
The line that is triggering the error is marked with >>:
tenant = client.
>> self.assertEqua
Looking in the debugger, the tenant object looks like:
Tenant: <Tenant {u'id': u'5b4785e72ee34
So the description is in the wrong location.
Changed in keystone: | |
importance: | Undecided → Critical |
Changed in keystone: | |
milestone: | none → grizzly-1 |
Changed in python-keystoneclient: | |
assignee: | nobody → Joseph Heck (heckj) |
status: | Triaged → In Progress |
Changed in python-keystoneclient: | |
status: | In Progress → Fix Committed |
Changed in keystone: | |
status: | Fix Committed → Fix Released |
Changed in python-keystoneclient: | |
status: | Fix Committed → Fix Released |
Changed in keystone: | |
milestone: | grizzly-1 → 2013.1 |
https:/ /github. com/openstack/ python- keystoneclient/ blob/master/ keystoneclient/ base.py: line 91
def _create(self, url, body, response_key, return_raw=False): class(self, body[response_key], loaded=True)
resp, body = self.api.post(url, body=body)
if return_raw:
return body[response_key]
return self.resource_
This one seem to have something to do with lazy-loading. "loaded" is set to "True", which means never bother to fetch new.
https:/ /github. com/openstack/ python- keystoneclient/ blob/master/ keystoneclient/ base.py: line 280-289
def __getattr__(self, k):
#NOTE( bcwaldon) : disallow lazy-loading if already loaded once
self. get()
return self.__getattr__(k)
if k not in self.__dict__:
if not self.is_loaded():
raise AttributeError(k)
else:
return self.__dict__[k]
Question is why is "loaded" set to "True" in the latest code?
btw, this "lazy-loading" logic is convoluted. We may need to document its purpose.