py33: 'dict_keys' object does not support indexing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-novaclient |
Fix Released
|
Undecided
|
Kui Shi |
Bug Description
=======
FAIL: novaclient.
tags: worker-1
-------
Empty attachments:
stderr
stdout
Traceback (most recent call last):
File "/home/
s.
File "/home/
self.
File "/home/
self.
File "/home/
return self.api.
File "/home/
return self._cs_
File "/home/
status, headers, body = getattr(self, callback)(**kwargs)
File "/home/
action = body.keys()[0]
TypeError: 'dict_keys' object does not support indexing
use a python 2&3 compatible method to get the "first" value of dict:
a={'aaa':111, 'bbb':222}
print (a[list(a)[0]])