AttributeError: 'unicode' object has no attribute 'get'

Bug #1570005 reported by Alexis Lee
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-novaclient
New
Undecided
Unassigned

Bug Description

novaclient 3.3.1 (stable/mitaka) fails vs nova==12.0.3.dev287 (liberty). As I understand it, new versions should be back-compatible. Do we need a fix to stable/mitaka? novaclient 3.4.0 works OK.

$ nova list --debug
DEBUG (extension:156) found extension EntryPoint.parse('v2token = keystoneauth1.loading._plugins.identity.v2:Token')
DEBUG (extension:156) found extension EntryPoint.parse('admin_token = keystoneauth1.loading._plugins.admin_token:AdminToken')
DEBUG (extension:156) found extension EntryPoint.parse('v3oidcauthcode = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectAuthorizationCode')
DEBUG (extension:156) found extension EntryPoint.parse('v2password = keystoneauth1.loading._plugins.identity.v2:Password')
DEBUG (extension:156) found extension EntryPoint.parse('v3password = keystoneauth1.loading._plugins.identity.v3:Password')
DEBUG (extension:156) found extension EntryPoint.parse('v3oidcpassword = keystoneauth1.loading._plugins.identity.v3:OpenIDConnectPassword')
DEBUG (extension:156) found extension EntryPoint.parse('token = keystoneauth1.loading._plugins.identity.generic:Token')
DEBUG (extension:156) found extension EntryPoint.parse('v3token = keystoneauth1.loading._plugins.identity.v3:Token')
DEBUG (extension:156) found extension EntryPoint.parse('password = keystoneauth1.loading._plugins.identity.generic:Password')
DEBUG (session:248) REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET https://192.168.245.9:5000/v3 -H "Accept: application/json" -H "User-Agent: keystoneauth1/2.5.0 python-requests/2.9.1 CPython/2.7.9"
INFO (connectionpool:758) Starting new HTTPS connection (1): 192.168.245.9
DEBUG (connectionpool:387) "GET /v3 HTTP/1.1" 200 253
DEBUG (session:277) RESP: [200] Content-Length: 253 Vary: X-Auth-Token Server: Apache/2.4.10 (Debian) Date: Wed, 13 Apr 2016 16:24:35 GMT Content-Type: application/json x-openstack-request-id: req-af84a782-4630-439f-b4f9-c69788d73ece
RESP BODY: {"version": {"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "https://192.168.245.9:5000/v3/", "rel": "self"}]}}

DEBUG (base:165) Making authentication request to https://192.168.245.9:5000/v3/auth/tokens
DEBUG (connectionpool:387) "POST /v3/auth/tokens HTTP/1.1" 201 10092
DEBUG (base:170) {"token": {"methods": ["password"], "roles": [{"id": "af8b746d7f7747c9ad023198335a832a", "name": "monasca-user"}, ... snip ...
DEBUG (session:248) REQ: curl -g -i --cacert "/etc/ssl/certs/ca-certificates.crt" -X GET https://192.168.245.9:8774/v2/e9d146ac820c461b9b48bef1d5ceb2bf -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}6ed67f7813afsnip7d34c07b1d"
INFO (connectionpool:758) Starting new HTTPS connection (1): 192.168.245.9
DEBUG (connectionpool:387) "GET /v2/e9d146ac820c461b9b48bef1d5ceb2bf HTTP/1.1" 404 112
DEBUG (session:277) RESP: [404] Date: Wed, 13 Apr 2016 16:24:36 GMT Connection: keep-alive Content-Type: application/json; charset=UTF-8 Content-Length: 112 X-Compute-Request-Id: req-2e065490-aa49-4a82-bc59-a7ca38188021
RESP BODY: {"message": "The resource could not be found.<br /><br />\n\n\n", "code": "404 Not Found", "title": "Not Found"}

DEBUG (shell:1082) 'unicode' object has no attribute 'get'
Traceback (most recent call last):
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/shell.py", line 1080, in main
    OpenStackComputeShell().main(argv)
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/shell.py", line 914, in main
    api_version = api_versions.discover_version(self.cs, api_version)
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/api_versions.py", line 267, in discover_version
    client)
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/api_versions.py", line 248, in _get_server_version_range
    version = client.versions.get_current()
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/v2/versions.py", line 84, in get_current
    return self._get_current()
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/v2/versions.py", line 57, in _get_current
    return self._get(url, "version")
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/base.py", line 339, in _get
    resp, body = self.api.client.get(url)
  File "/home/stack/x/local/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 173, in get
    return self.request(url, 'GET', **kwargs)
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/client.py", line 94, in request
    raise exceptions.from_response(resp, body, url, method)
  File "/home/stack/x/local/lib/python2.7/site-packages/novaclient/exceptions.py", line 298, in from_response
    message = error.get('message')
AttributeError: 'unicode' object has no attribute 'get'
ERROR (AttributeError): 'unicode' object has no attribute 'get'

Revision history for this message
melanie witt (melwitt) wrote :

Generally people can roll forward to obtain bug fixes in novaclient, however if a backport to stable is desired, you can propose one.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.