Comment 0 for bug 1291329

Revision history for this message
ChangBo Guo(gcb) (glongwave) wrote :

API return wrong format RESP BODY: {"migrations": {"objects": []}} , This should like RESP BODY: {"migrations": [] }
[gcb@localhost devstack]$ nova --debug migration-list
RESP: [200] CaseInsensitiveDict({'date': 'Wed, 12 Mar 2014 11:51:15 GMT', 'content-length': '31', 'content-type': 'application/json', 'x-compute-request-id': 'req-c278cd5c-4873-44cc-9fed-2dbb8a53938d'})
RESP BODY: {"migrations": {"objects": []}}

DEBUG (shell:777) 'unicode' object has no attribute 'iteritems'
Traceback (most recent call last):
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 774, in main
    OpenStackComputeShell().main(map(strutils.safe_decode, sys.argv[1:]))
  File "/opt/stack/python-novaclient/novaclient/shell.py", line 710, in main
    args.func(self.cs, args)
  File "/opt/stack/python-novaclient/novaclient/v1_1/contrib/migrations.py", line 70, in do_migration_list
    args.cell_name))
  File "/opt/stack/python-novaclient/novaclient/v1_1/contrib/migrations.py", line 52, in list
    return self._list("/os-migrations%s" % query_string, "migrations")
  File "/opt/stack/python-novaclient/novaclient/base.py", line 81, in _list
    for res in data if res]
  File "/opt/stack/python-novaclient/novaclient/openstack/common/apiclient/base.py", line 429, in __init__
    self._add_details(info)
  File "/opt/stack/python-novaclient/novaclient/openstack/common/apiclient/base.py", line 448, in _add_details
    for (k, v) in six.iteritems(info):
  File "/usr/lib/python2.7/site-packages/six.py", line 484, in iteritems
    return iter(getattr(d, _iteritems)(**kw))
AttributeError: 'unicode' object has no attribute 'iteritems'
ERROR: 'unicode' object has no attribute 'iteritems'
[gcb@localhost devstack]$