<div dir="ltr"><div><div>It is being fixed <a href="https://review.openstack.org/#/c/61717/">https://review.openstack.org/#/c/61717/</a><br><br></div>Thanks,<br><br></div>Jay<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014/1/20 li zheming <span dir="ltr"><<a href="mailto:lizheminghw@gmail.com" target="_blank">lizheminghw@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>hi all:</div>
<div> <span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px">when I use cmd nova migration-list, it return error,like this:</span><br style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> <a href="mailto:openstack@devstack:/home$" target="_blank">openstack@</a></span><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px">devstack:</span><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px">/home$ nova migration-list</span><br style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> ERROR: 'unicode' object has no attribute 'iteritems'</span></div>
<div><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"></span> </div>
<div><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> <span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px">I step the codes and find the codes have some error.</span></span></div>
<div><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px">
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
python-novaclient/novaclient/base.py</p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
class Manager(utils.HookableMixin):<br> ......<br> def _list(self, url, response_key, obj_class=None, body=None):<br> if body:<br> _resp, body = self.api.client.post(url, body=body)<br> else:<br>
_resp, body = self.api.client.get(url)</p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
if obj_class is None:<br> obj_class = self.resource_class</p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
data = body[response_key]<br> # NOTE(ja): keystone returns values as list as {'values': [ ... ]}<br> # unlike other services which just return the list...<br> <font color="#ff0000">if isinstance(data, dict):<br>
try:<br> data = data['values']<br> except KeyError:<br> pass</font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
with self.completion_cache('human_id', obj_class, mode="w"):<br> with self.completion_cache('uuid', obj_class, mode="w"):<br> return [obj_class(self, res, loaded=True)<br>
<font color="#ff0000"> for res in data if res]</font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
I set a breakpoint in "<font color="#ff0000">data = data['values']", and find the date is </font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
<font color="#ff0000"> <span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> {u'objects': []}}, it has no key named values.</span></font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
<font color="#ff0000"><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> it except a keyError and pass.</span></font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
<font color="#ff0000"><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> if go "<font color="#ff0000"> for res in data if res</font><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> </span>", the res is unicode "object", this will</span></font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
<font color="#ff0000"><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> <span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);font:14px/22px arial;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"> </span><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);font:14px/22px arial;text-transform:none;white-space:normal;word-spacing:0px">occur error in the next fun. </span></span></font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
do you met this issue? and someone who know why the comment say "<font color="#ff0000">keystone returns values as list as {'values': [ ... ]}"</font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
<font color="#ff0000"> but I think this is not relevant</font><font color="#333333"><font face="Arial"> about keystone. may be I misunderstand this codes. please give me more info about this code. </font></font></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
<font color="#333333"><font face="Arial"> thank you very much!</font><br></font></p></span></span><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"><span style="text-indent:0px;letter-spacing:normal;color:rgb(51,51,51);text-align:left;font:12px/18px 'Ubuntu Mono',monospace;text-transform:none;white-space:normal;display:inline!important;float:none;word-spacing:0px"></span></span></div>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
<br></p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
</p>
<p style="padding-left:0px;padding-right:0px;padding-top:0px;text-indent:0px;letter-spacing:normal;text-align:left;max-width:45em;font:12px/18px 'Ubuntu Mono',monospace;width:auto;padding-bottom:0px;color:rgb(51,51,51);text-transform:none;white-space:normal;margin:0px 0px 1.2em;word-spacing:0px">
</p>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div>