[openstack-dev] [nova]can someone help me? when I use cmd "nova migration-list" error.

sahid sahid.ferdjaoui at cloudwatt.com
Mon Jan 20 09:32:10 UTC 2014



Perhaps a bug-maintainer should to update the status, 
the bug is not related to python-novaclient and it is not tried yet. 

Thanks a lot, 

s. 
----- Original Message -----

From: "li zheming" <lizheminghw at gmail.com> 
To: "OpenStack Development Mailing List (not for usage questions)" <openstack-dev at lists.openstack.org> 
Sent: Monday, January 20, 2014 4:52:27 AM 
Subject: Re: [openstack-dev] [nova]can someone help me? when I use cmd "nova migration-list" error. 

Ok .thanks Jay 
I consider it is error in novaclient before. 
it is my misunderstand. thank you very much! 
lizheming 

2014/1/20 Jay Lau < jay.lau.513 at gmail.com > 



It is being fixed https://review.openstack.org/#/c/61717/ 

Thanks, 

Jay 


2014/1/20 li zheming < lizheminghw at gmail.com > 

<blockquote>

hi all: 
when I use cmd nova migration-list, it return error,like this: 
openstack@ 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 






_______________________________________________ 
OpenStack-dev mailing list 
OpenStack-dev at lists.openstack.org 
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev 


</blockquote>



_______________________________________________ 
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/3c34816c/attachment.html>


More information about the OpenStack-dev mailing list