[openstack-dev] [nova]can someone help me? when I use cmd "nova migration-list" error.
Jay Lau
jay.lau.513 at gmail.com
Mon Jan 20 02:57:54 UTC 2014
It is being fixed https://review.openstack.org/#/c/61717/
Thanks,
Jay
2014/1/20 li zheming <lizheminghw at gmail.com>
> hi all:
> when I use cmd nova migration-list, it return error,like this:
> openstack@ <openstack at devstack:/home$>devstack:/home$ nova
> migration-list
> ERROR: 'unicode' object has no attribute 'iteritems'
>
> I step the codes and find the codes have some error.
>
>
> python-novaclient/novaclient/base.py
>
> class Manager(utils.HookableMixin):
> ......
> def _list(self, url, response_key, obj_class=None, body=None):
> if body:
> _resp, body = self.api.client.post(url, body=body)
> else:
> _resp, body = self.api.client.get(url)
>
> if obj_class is None:
> obj_class = self.resource_class
>
> data = body[response_key]
> # NOTE(ja): keystone returns values as list as {'values': [ ... ]}
> # unlike other services which just return the list...
> if isinstance(data, dict):
> try:
> data = data['values']
> except KeyError:
> pass
>
> with self.completion_cache('human_id', obj_class, mode="w"):
> with self.completion_cache('uuid', obj_class, mode="w"):
> return [obj_class(self, res, loaded=True)
> for res in data if res]
>
> I set a breakpoint in "data = data['values']", and find the date
> is
>
> {u'objects': []}}, it has no key named values.
>
> it except a keyError and pass.
>
> if go " for res in data if res ", the res is unicode "object",
> this will
>
> occur error in the next fun.
>
> do you met this issue? and someone who know why the comment say "keystone
> returns values as list as {'values': [ ... ]}"
>
> but I think this is not relevant about keystone. may be I
> misunderstand this codes. please give me more info about this code.
>
> thank you very much!
>
>
>
>
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140120/a7115d2f/attachment.html>
More information about the OpenStack-dev
mailing list