Carlo Impagliazzo, in my case this working good:<div><br><div>>>> from novaclient.v1_1 import client</div><div>>>> nt = client.Client('admin', 'xxx', 'project', '<a href="http://127.0.0.1:5000/v2.0/">http://127.0.0.1:5000/v2.0/</a>')</div>
<div><div>>>> nt.images.list()</div><div>[<Image: ub2>, <Image: ub>, <Image: f14-64>]</div></div><div><br></div><div><div># nova --debug boot test --flavor 1 --image 1</div><div>connect: (127.0.0.1, 5000)</div>
<div>send: 'POST /v2.0/tokens HTTP/1.1\r\nHost: <a href="http://127.0.0.1:5000">127.0.0.1:5000</a>\r\nContent-Length: 88\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: python-novaclient\r\n\r\n{"passwordCredentials": {"username": "admin", "password": "xxx", "tenantId": "project"}}'</div>
<div>reply: 'HTTP/1.1 200 OK\r\n'</div><div>header: Content-Type: application/json; charset=UTF-8</div><div>header: Content-Length: 1236</div><div>header: Date: Wed, 14 Sep 2011 15:20:42 GMT</div><div>connect: (127.0.0.1, 8774)</div>
<div>send: u'POST /v1.1/sgu/servers HTTP/1.1\r\nHost: <a href="http://127.0.0.1:8774">127.0.0.1:8774</a>\r\nContent-Length: 91\r\nx-auth-project-id: sgu\r\nx-auth-token: 999888777666\r\ncontent-type: application/json\r\naccept-encoding: gzip, deflate\r\nuser-agent: python-novaclient\r\n\r\n{"server": {"min_count": 1, "flavorId": "1", "max_count": 1, "name": "test", "imageId": 1}}'</div>
<div>reply: 'HTTP/1.1 400 Bad Request\r\n'</div><div>header: Content-Length: 70</div><div>header: Content-Type: application/json; charset=UTF-8</div><div>header: Date: Wed, 14 Sep 2011 15:20:42 GMT</div><div>Traceback (most recent call last):</div>
<div>  File "/usr/bin/nova", line 9, in <module></div><div>    load_entry_point('python-novaclient==2.6.4', 'console_scripts', 'nova')()</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 219, in main</div>
<div>    OpenStackComputeShell().main(sys.argv[1:])</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 182, in main</div><div>    args.func(self.cs, args)</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/v1_0/shell.py", line 194, in do_boot</div>
<div>    max_count=max_count)</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/v1_0/servers.py", line 284, in create</div><div>    min_count=min_count, max_count=max_count)</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/v1_0/base.py", line 100, in _boot</div>
<div>    return_raw=return_raw)</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/base.py", line 83, in _create</div><div>    resp, body = self.api.client.post(url, body=body)</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 124, in post</div>
<div>    return self._cs_request(url, 'POST', **kwargs)</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 108, in _cs_request</div><div>    **kwargs)</div><div>  File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 91, in request</div>
<div>    raise exceptions.from_response(resp, body)</div><div>novaclient.exceptions.BadRequest: Missing imageRef attribute (HTTP 400)</div></div><div><br></div><div><br></div><div class="gmail_quote">2011/9/14 Carlo Impagliazzo <span dir="ltr"><<a href="mailto:truijllo@crs4.it">truijllo@crs4.it</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Alle mercoledė 14 settembre 2011, Carlo Impagliazzo ha scritto:<br>
<div><div></div><div class="h5">> Alle mercoledė 14 settembre 2011, Roman Sokolkov ha scritto:<br>
> > Hi! I have problem. I use keystone from trunk, python-novaclient 2.6.4<br>
> ><br>
> > # nova --debug list<br>
> > connect: (127.0.0.1, 5000)<br>
> > send: 'POST /v2.0/tokens HTTP/1.1\r\nHost:<br>
> > <a href="http://127.0.0.1:5000" target="_blank">127.0.0.1:5000</a>\r\nContent-Length: 88\r\ncontent-type:<br>
> > application/json\r\naccept-encoding: gzip,<br>
> > deflate\r\nuser-agent: python-novaclient\r\n\r\n{"passwordCredentials":<br>
> > {"username": "admin", "password": "xxx", "tenantId": "1234"}}'<br>
> > reply: 'HTTP/1.1 200 OK\r\n'<br>
> > header: Content-Type: application/json; charset=UTF-8<br>
> > header: Content-Length: 1236<br>
> > header: Date: Wed, 14 Sep 2011 13:18:45 GMT<br>
> > Traceback (most recent call last):<br>
> >   File "/usr/bin/nova", line 9, in <module><br>
> >     load_entry_point('python-novaclient==2.6.4', 'console_scripts',<br>
> > 'nova')()<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 219,<br>
> > in main<br>
> >     OpenStackComputeShell().main(sys.argv[1:])<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/shell.py", line 176,<br>
> > in main<br>
> >     self.cs.authenticate()<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/v1_0/client.py", line<br>
> > 57, in authenticate<br>
> >     self.client.authenticate()<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 144,<br>
> > in authenticate<br>
> >     auth_url = self._v2_auth(auth_url)<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/client.py", line 189,<br>
> > in _v2_auth<br>
> >     service_catalog.ServiceCatalog(body)<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/service_catalog.py",<br>
> > line 90, in __init__<br>
> >     super(ServiceCatalog, self).__init__(resource)<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/service_catalog.py",<br>
> > line 45, in __init__<br>
> >     attribute = [res(x) for x in val]<br>
> >   File "/usr/lib/python2.7/site-packages/novaclient/service_catalog.py",<br>
> > line 41, in __init__<br>
> >     for res_key, res_value in value.items():<br>
> > AttributeError: 'unicode' object has no attribute 'items'<br>
><br>
> I have the same problem, I've tried to fix it but it's a little difficult<br>
> understand the logic behind the management of the data structure.<br>
><br>
> having a structure like the linked one it happens a kinky comparison:<br>
><br>
> 'nova' in  { 'publicURL': u'<a href="http://nova.publicinternets.com/v1.1/1234" target="_blank">http://nova.publicinternets.com/v1.1/1234</a>' }<br>
><br>
> and then...it dumps because<br>
> value is '<a href="http://nova.publicinternets.com/v1.1/1234" target="_blank">http://nova.publicinternets.com/v1.1/1234</a>'   ( and so...like a<br>
> string obj it hasn't an items method )<br>
><br>
><br>
> Is the comparison logically right? isn't it too weak ?<br>
><br>
><br>
> This is the link with datastructure :<br>
> <a href="http://paste.openstack.org/show/2442/" target="_blank">http://paste.openstack.org/show/2442/</a><br>
><br>
> Carlo<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
> Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
> Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
> More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
<br>
</div></div>the patch suggested by Sandy works like a charm, it remains the question about<br>
the strange comparison :-/<br>
<br>
<br>
Now I have another problem,<br>
<br>
using a python script like this:<br>
NOVA_PROJECT_ID=1234<br>
NOVA_USERNAME="joeuser"<br>
NOVA_URL='<a href="http://192.168.0.100:5000/v2.0/" target="_blank">http://192.168.0.100:5000/v2.0/</a>'<br>
NOVA_API_KEY='fdf50e55-8f02-4aac-ac02-0adcb088325d'<br>
from novaclient.v1_1 import client<br>
nt = client.Client(NOVA_USERNAME, 'secrete', NOVA_PROJECT_ID, NOVA_URL)<br>
<br>
<br>
with this statement I obtain:<br>
<br>
nt.images.list()<br>
<div class="im">Traceback (most recent call last):<br>
</div>  File "<stdin>", line 1, in <module><br>
<br>
File "/usr/lib/python2.6/site-packages/python_novaclient-2.6.4-py2.6.egg/novaclient/v1_1/images.py",<br>
line 45, in list<br>
    return self._list("/images/detail", "images")<br>
<br>
File "/usr/lib/python2.6/site-packages/python_novaclient-2.6.4-py2.6.egg/novaclient/base.py",<br>
line 66, in _list<br>
    resp, body = self.api.client.get(url)<br>
<br>
File "/usr/lib/python2.6/site-packages/python_novaclient-2.6.4-py2.6.egg/novaclient/client.py",<br>
line 126, in get<br>
    return self._cs_request(url, 'GET', **kwargs)<br>
<br>
File "/usr/lib/python2.6/site-packages/python_novaclient-2.6.4-py2.6.egg/novaclient/client.py",<br>
line 113, in _cs_request<br>
    **kwargs)<br>
<br>
File "/usr/lib/python2.6/site-packages/python_novaclient-2.6.4-py2.6.egg/novaclient/client.py",<br>
line 96, in request<br>
    raise exceptions.from_response(resp, body)<br>
novaclient.exceptions.BadRequest: n/a (HTTP 400<br>
<br>
Any suggestions?<br>
<div><div></div><div class="h5">Carlo<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Mailing list: <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
Post to     : <a href="mailto:openstack@lists.launchpad.net">openstack@lists.launchpad.net</a><br>
Unsubscribe : <a href="https://launchpad.net/~openstack" target="_blank">https://launchpad.net/~openstack</a><br>
More help   : <a href="https://help.launchpad.net/ListHelp" target="_blank">https://help.launchpad.net/ListHelp</a><br>
</div></div></blockquote></div><br></div>