[Openstack] novaclient+keystone problem AttributeError: 'unicode' object has no attribute 'items'

Carlo Impagliazzo truijllo at crs4.it
Wed Sep 14 13:59:59 UTC 2011


Alle mercoledì 14 settembre 2011, Roman Sokolkov ha scritto:
> Hi! I have problem. I use keystone from trunk, python-novaclient 2.6.4
>
> # nova --debug list
> connect: (127.0.0.1, 5000)
> send: 'POST /v2.0/tokens HTTP/1.1\r\nHost:
> 127.0.0.1:5000\r\nContent-Length: 88\r\ncontent-type:
> application/json\r\naccept-encoding: gzip,
> deflate\r\nuser-agent: python-novaclient\r\n\r\n{"passwordCredentials":
> {"username": "admin", "password": "xxx", "tenantId": "1234"}}'
> reply: 'HTTP/1.1 200 OK\r\n'
> header: Content-Type: application/json; charset=UTF-8
> header: Content-Length: 1236
> header: Date: Wed, 14 Sep 2011 13:18:45 GMT
> Traceback (most recent call last):
>   File "/usr/bin/nova", line 9, in <module>
>     load_entry_point('python-novaclient==2.6.4', 'console_scripts',
> 'nova')()
>   File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 219, in
> main
>     OpenStackComputeShell().main(sys.argv[1:])
>   File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 176, in
> main
>     self.cs.authenticate()
>   File "/usr/lib/python2.7/site-packages/novaclient/v1_0/client.py", line
> 57, in authenticate
>     self.client.authenticate()
>   File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 144,
> in authenticate
>     auth_url = self._v2_auth(auth_url)
>   File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 189,
> in _v2_auth
>     service_catalog.ServiceCatalog(body)
>   File "/usr/lib/python2.7/site-packages/novaclient/service_catalog.py",
> line 90, in __init__
>     super(ServiceCatalog, self).__init__(resource)
>   File "/usr/lib/python2.7/site-packages/novaclient/service_catalog.py",
> line 45, in __init__
>     attribute = [res(x) for x in val]
>   File "/usr/lib/python2.7/site-packages/novaclient/service_catalog.py",
> line 41, in __init__
>     for res_key, res_value in value.items():
> AttributeError: 'unicode' object has no attribute 'items'

I have the same problem, I've tried to fix it but it's a little difficult 
understand the logic behind the management of the data structure.

having a structure like the linked one it happens a kinky comparison:

'nova' in  { 'publicURL': u'http://nova.publicinternets.com/v1.1/1234' }

and then...it dumps because 
value is 'http://nova.publicinternets.com/v1.1/1234'   ( and so...like a 
string obj it hasn't an items method )


Is the comparison logically right? isn't it too weak ?


This is the link with datastructure :
http://paste.openstack.org/show/2442/

Carlo







More information about the Openstack mailing list