2012/2/16 Tomaž Muraus <to...@apache.org>

> Do you get the same "300, Multiple choices" response back if you change
> ex_force_base_url to http://%s:8774/v2.0?


Correct.  Here is the response.  The "/v2/v2.0" part of the path looks
strange to me.

# -------- begin 19425200:19295648 response ----------
HTTP/1.1 300 Multiple Choices
Date: Fri, 17 Feb 2012 07:18:54 GMT
Content-Length: 332
Content-Type: application/json

{"choices": [{"status": "CURRENT", "media-types": [{"base":
"application/xml", "type":
"application/vnd.openstack.compute+xml;version=2"}, {"base":
"application/json", "type":
"application/vnd.openstack.compute+json;version=2"}], "id": "v2.0",
"links": [{"href": "http://50.56.213.226:8774/v2/v2.0/images/detail";,
"rel": "self"}]}]}
# -------- end 19425200:19295648 response ----------


> If so, then it seems like an
> OpenStack bug because the documentation states that the version can be
> provided in the URL.
>

Can you point to the docs to which you are referring?


> Giving more information on which OpenStack version you are using would also
> be helpful.
>

I'm not sure what the best way to do that is.  Devstack by default pulls
from the master branch of all repositories, and the version I have running
is about 5 days old.  The top of the nova repo's git log is

commit d8f8bad0f26b4438986ab1a469d89d03b22551db

Merge: d03692c b196f4b

Author: Jenkins <jenk...@review.openstack.org>

Date:   Sat Feb 11 18:42:50 2012 +0000



    Merge "Converting db tables to utf8."

And that of keystone is

commit 9452cf04bc8b0a4dc66dc640615d5ace1ca715f2

Author: Alvaro Lopez Garcia <al...@ifca.unican.es>

Date:   Tue Jan 31 18:14:17 2012 +0100



    Fixes bug 924391



    Change-Id: Iccb232a56df6072580cbcb0bc07ef7c0f81ca8fe

In any case, I will try to get devstack working locally and reproduce this
> problem myself.
>

Thanks.  I should also update my stack and see if the problem has since
been resolved.

Jay


> On Thu, Feb 16, 2012 at 8:20 PM, Jay Doane <j...@almery.com> wrote:
>
> > If I change ex_force_base_url='http://%s:8774/v2.0' % STACK_HOST then I
> > get
> > the same TypeError as before.
> >
> > However, if I change ex_force_base_url='http://%s:8774/v2' % STACK_HOST
> > (note the lack of ".0"), I get the following 404:
> >
> > $ LIBCLOUD_DEBUG=/dev/stderr python stack_demo.py
> > /Users/jay/Library/Python/2.6/site-packages/Crypto/Util/randpool.py:40:
> > RandomPool_DeprecationWarning: This application uses RandomPool, which is
> > BROKEN in older releases.  See http://www.pycrypto.org/randpool-broken
> >  RandomPool_DeprecationWarning)
> > # -------- begin 19425200 request ----------
> > curl -i -X POST -H 'Host: 50.56.213.226:5000' -H 'Accept-Encoding:
> > gzip,deflate' -H 'X-LC-Request-ID: 19425200' -H 'Content-Type:
> > application/json; charset=UTF-8' -H 'Content-Length: 79' -H 'Accept:
> > application/json' -H 'User-Agent: libcloud/0.8.0 (OpenStack)'
> --data-binary
> > '{"auth": {"passwordCredentials": {"username": "demo", "password":
> > "password"}}}' --compress https://50.56.213.226:5000/v2.0/tokens/
> > # -------- begin 19425200:19425360 response ----------
> > HTTP/1.1 200 OK
> > Date: Fri, 17 Feb 2012 04:17:13 GMT
> > Content-Type: application/json; charset=UTF-8
> > Content-Length: 772
> > Vary: X-Auth-Token
> >
> > {"access": {"token": {"expires": "2012-02-17T18:11:39", "id":
> > "2977320b-56d9-47a9-9c38-4a5b2b0ac8c9"}, "serviceCatalog": [{"endpoints":
> > [{"id": "2", "region": "RegionOne", "internalURL": "
> > http://50.56.213.226:8773/services/Cloud";, "publicURL": "
> > http://50.56.213.226:8773/services/Cloud"}], "type": "ec2", "name":
> > "ec2"},
> > {"endpoints": [{"id": "3", "region": "RegionOne", "internalURL": "
> > http://50.56.213.226:9292/v1";, "publicURL": "
> http://50.56.213.226:9292/v1
> > "}],
> > "type": "image", "name": "glance"}, {"endpoints": [{"id": "4", "region":
> > "RegionOne", "internalURL": "http://50.56.213.226:5000/v2.0";,
> > "publicURL": "
> > http://50.56.213.226:5000/v2.0"}], "type": "identity", "name":
> > "keystone"}], "user": {"id": "a438ea90e1da43e4b895874fdaf83a2d", "roles":
> > [], "name": "demo"}}}
> > # -------- end 19425200:19425360 response ----------
> >
> > # -------- begin 19425200 request ----------
> > curl -i -X GET -H 'Host: 50.56.213.226:8774' -H 'X-LC-Request-ID:
> > 19425200'
> > -H 'Accept-Encoding: gzip,deflate' -H 'X-Auth-Token:
> > 2977320b-56d9-47a9-9c38-4a5b2b0ac8c9' -H 'Content-Length: 0' -H 'Accept:
> > application/json' -H 'User-Agent: libcloud/0.8.0 (OpenStack)' --compress
> '
> >
> https://50.56.213.226:8774/v2/images/detail?cache-busting=786c8c85d9f54028
> > '
> > # -------- begin 19425200:19295648 response ----------
> > HTTP/1.1 404 Not Found
> > Date: Fri, 17 Feb 2012 04:17:13 GMT
> > Content-Length: 52
> > Content-Type: text/plain; charset=UTF-8
> >
> > 404 Not Found
> >
> > The resource could not be found.
> >
> >
> > # -------- end 19425200:19295648 response ----------
> >
> > Traceback (most recent call last):
> >  File "stack_demo.py", line 17, in <module>
> >    print driver.list_images()
> >  File
> >
> >
> "/Users/jay/proj/genforma/libcloud.git/libcloud/compute/drivers/openstack.py",
> > line 209, in list_images
> >    return self._to_images(self.connection.request('/images/detail')
> >  File
> >
> >
> "/Users/jay/proj/genforma/libcloud.git/libcloud/compute/drivers/openstack.py",
> > line 151, in request
> >    method=method, headers=headers)
> >  File
> > "/Users/jay/proj/genforma/libcloud.git/libcloud/common/openstack.py",
> line
> > 328, in request
> >    return super(OpenStackBaseConnection, self).request(**kwargs)
> >  File "/Users/jay/proj/genforma/libcloud.git/libcloud/common/base.py",
> > line 564, in request
> >    connection=self)
> >  File
> >
> >
> "/Users/jay/proj/genforma/libcloud.git/libcloud/compute/drivers/openstack.py",
> > line 774, in __init__
> >    super(OpenStack_1_1_Response, self).__init__(*args, **kwargs)
> >  File "/Users/jay/proj/genforma/libcloud.git/libcloud/common/base.py",
> > line 77, in __init__
> >    raise Exception(self.parse_error())
> > Exception: 404 Not Found 404 Not Found
> >
> > The resource could not be found.
> >
> > 2012/2/16 Tomaž Muraus <to...@apache.org>
> >
> > > It looks like you are missing an API version in the URL.
> > >
> > > Please change the ex_force_base_url='http://%s:8774' % STACK_HOST
> > > to ex_force_base_url='http://%s:8774/v2.0' % STACK_HOST
> > >
> > > Let us know if this solves your problem.
> > >
> > > On Thu, Feb 16, 2012 at 7:17 PM, Jay Doane <j...@almery.com> wrote:
> > >
> > > > 2012/2/16 Tomaž Muraus <to...@apache.org>
> > > >
> > > > >
> > > > > In any case, it does look like an auth API issue. I have merged
> > Brad's
> > > > Auth
> > > > > API changes yesterday so please update your trunk and try again - I
> > > think
> > > > > his changes should fix your problem.
> > > > >
> > > >
> > > > I pulled the latest code, and you were right: it fixed the tenantId
> > > > KeyError.
> > > >
> > > > Unfortunately, I'm now getting a different error.  My interpretation
> is
> > > > that openstack is giving a 300 response because there is a choice of
> > > > response formats, but the libcloud driver is treating that as an
> error,
> > > > since OpenStackResponse.success is implemented to do so.  Details
> > below.
> > > >
> > > > I've simplified my demo code by removing the (working) Eucalyptus
> > driver
> > > > example, and changed the name to stack_demo.py.  Here's the listing:
> > > >
> > > > from libcloud.compute.types import Provider
> > > > from libcloud.compute.providers import get_driver
> > > >
> > > > STACK_HOST = '50.56.213.226'
> > > > USERNAME = 'demo'
> > > > PASSWORD = 'password'
> > > >
> > > > def openstack_connect():
> > > >    Driver = get_driver(Provider.OPENSTACK)
> > > >    driver = Driver(USERNAME, PASSWORD, host=STACK_HOST, port=8774,
> > > > secure=False,
> > > >                  ex_force_auth_url='http://%s:5000' % STACK_HOST,
> > > >                  ex_force_auth_version='2.0_password',
> > > >                  ex_force_base_url='http://%s:8774' % STACK_HOST)
> > > >    return driver
> > > >
> > > > driver = openstack_connect()
> > > > print driver.list_images()
> > > >
> > > > Here's the output:
> > > >
> > > > $ LIBCLOUD_DEBUG=/dev/stderr python stack_demo.py
> > > >
> /Users/jay/Library/Python/2.6/site-packages/Crypto/Util/randpool.py:40:
> > > > RandomPool_DeprecationWarning: This application uses RandomPool,
> which
> > is
> > > > BROKEN in older releases.  See
> http://www.pycrypto.org/randpool-broken
> > > >  RandomPool_DeprecationWarning)
> > > > # -------- begin 19425240 request ----------
> > > > curl -i -X POST -H 'Host: 50.56.213.226:5000' -H 'Accept-Encoding:
> > > > gzip,deflate' -H 'X-LC-Request-ID: 19425240' -H 'Content-Type:
> > > > application/json; charset=UTF-8' -H 'Content-Length: 79' -H 'Accept:
> > > > application/json' -H 'User-Agent: libcloud/0.8.0 (OpenStack)'
> > > --data-binary
> > > > '{"auth": {"passwordCredentials": {"username": "demo", "password":
> > > > "password"}}}' --compress https://50.56.213.226:5000/v2.0/tokens/
> > > > # -------- begin 19425240:19425400 response ----------
> > > > HTTP/1.1 200 OK
> > > > Date: Fri, 17 Feb 2012 01:45:20 GMT
> > > > Content-Type: application/json; charset=UTF-8
> > > > Content-Length: 772
> > > > Vary: X-Auth-Token
> > > >
> > > > {"access": {"token": {"expires": "2012-02-16T17:54:14", "id":
> > > > "f436424e-6c7d-43e4-ae7c-30f5553c79f3"}, "serviceCatalog":
> > [{"endpoints":
> > > > [{"id": "2", "region": "RegionOne", "internalURL": "
> > > > http://50.56.213.226:8773/services/Cloud";, "publicURL": "
> > > > http://50.56.213.226:8773/services/Cloud"}], "type": "ec2", "name":
> > > > "ec2"},
> > > > {"endpoints": [{"id": "3", "region": "RegionOne", "internalURL": "
> > > > http://50.56.213.226:9292/v1";, "publicURL": "
> > > http://50.56.213.226:9292/v1
> > > > "}],
> > > > "type": "image", "name": "glance"}, {"endpoints": [{"id": "4",
> > "region":
> > > > "RegionOne", "internalURL": "http://50.56.213.226:5000/v2.0";,
> > > > "publicURL": "
> > > > http://50.56.213.226:5000/v2.0"}], "type": "identity", "name":
> > > > "keystone"}], "user": {"id": "a438ea90e1da43e4b895874fdaf83a2d",
> > "roles":
> > > > [], "name": "demo"}}}
> > > > # -------- end 19425240:19425400 response ----------
> > > >
> > > > # -------- begin 19425240 request ----------
> > > > curl -i -X GET -H 'Host: 50.56.213.226:8774' -H 'X-LC-Request-ID:
> > > > 19425240'
> > > > -H 'Accept-Encoding: gzip,deflate' -H 'X-Auth-Token:
> > > > f436424e-6c7d-43e4-ae7c-30f5553c79f3' -H 'Content-Length: 0' -H
> > 'Accept:
> > > > application/json' -H 'User-Agent: libcloud/0.8.0 (OpenStack)'
> > --compress
> > > '
> > > >
> > https://50.56.213.226:8774/images/detail?cache-busting=faeee245cd437497'
> > > > # -------- begin 19425240:19295688 response ----------
> > > > HTTP/1.1 300 Multiple Choices
> > > > Date: Fri, 17 Feb 2012 01:45:20 GMT
> > > > Content-Length: 327
> > > > Content-Type: application/json
> > > >
> > > > {"choices": [{"status": "CURRENT", "media-types": [{"base":
> > > > "application/xml", "type":
> > > > "application/vnd.openstack.compute+xml;version=2"}, {"base":
> > > > "application/json", "type":
> > > > "application/vnd.openstack.compute+json;version=2"}], "id": "v2.0",
> > > > "links": [{"href": "http://50.56.213.226:8774/v2/images/detail";,
> > "rel":
> > > > "self"}]}]}
> > > > # -------- end 19425240:19295688 response ----------
> > > >
> > > > Traceback (most recent call last):
> > > >   File "stack_demo.py", line 17, in <module>
> > > >    print driver.list_images()
> > > >  File
> > > >
> > > >
> > >
> >
> "/Users/jay/proj/genforma/libcloud.git/libcloud/compute/drivers/openstack.py",
> > > > line 209, in list_images
> > > >    return self._to_images(self.connection.request('/images/detail')
> > > >  File
> > > >
> > > >
> > >
> >
> "/Users/jay/proj/genforma/libcloud.git/libcloud/compute/drivers/openstack.py",
> > > > line 151, in request
> > > >    method=method, headers=headers)
> > > >  File
> > > > "/Users/jay/proj/genforma/libcloud.git/libcloud/common/openstack.py",
> > > line
> > > > 328, in request
> > > >    return super(OpenStackBaseConnection, self).request(**kwargs)
> > > >  File
> "/Users/jay/proj/genforma/libcloud.git/libcloud/common/base.py",
> > > > line 564, in request
> > > >    connection=self)
> > > >  File
> > > >
> > > >
> > >
> >
> "/Users/jay/proj/genforma/libcloud.git/libcloud/compute/drivers/openstack.py",
> > > > line 774, in __init__
> > > >    super(OpenStack_1_1_Response, self).__init__(*args, **kwargs)
> > > >  File
> "/Users/jay/proj/genforma/libcloud.git/libcloud/common/base.py",
> > > > line 77, in __init__
> > > >    raise Exception(self.parse_error())
> > > >  File
> > > >
> > > >
> > >
> >
> "/Users/jay/proj/genforma/libcloud.git/libcloud/compute/drivers/openstack.py",
> > > > line 111, in parse_error
> > > >    in body.values()])
> > > > TypeError: list indices must be integers, not str
> > > >
> > >
> >
>

Reply via email to