Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!env python
- from libcloud.compute.types import Provider
- from libcloud.compute.providers import get_driver
- auth_username = 'admin'
- auth_password = '7dffe25b58af7949ee10'
- auth_url = 'http://10.1.10.125:5000/'
- provider = get_driver(Provider.OPENSTACK)
- conn = provider(auth_username,
- auth_password,
- secure=False,
- ex_force_auth_url=auth_url,
- ex_force_auth_version="2.0_password")
- images = conn.list_images()
- for image in images:
- print(image)
- ----
- Traceback (most recent call last):
- File "./test.py", line 17, in <module>
- images = conn.list_images()
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/compute/drivers/openstack.py", line 226, in list_images
- self.connection.request('/images/detail').object, ex_only_active)
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/common/openstack.py", line 200, in request
- raw=raw)
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/common/base.py", line 657, in request
- action = self.morph_action_hook(action)
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/common/openstack.py", line 255, in morph_action_hook
- self._populate_hosts_and_request_paths()
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/common/openstack.py", line 288, in _populate_hosts_and_request_paths
- osa = osa.authenticate(**kwargs) # may throw InvalidCreds
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/common/openstack_identity.py", line 841, in authenticate
- return self._authenticate_2_0_with_password()
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/common/openstack_identity.py", line 866, in _authenticate_2_0_with_password
- return self._authenticate_2_0_with_body(reqbody)
- File "/home/dkerschner/tmp/os/local/lib/python2.7/site-packages/libcloud/common/openstack_identity.py", line 879, in _authenticate_2_0_with_body
- driver=self.driver)
- libcloud.common.types.MalformedResponseError: <MalformedResponseException in <libcloud.compute.drivers.openstack.OpenStack_1_1_NodeDriver object at 0x7f3ee3b96b10> 'Malformed response'>: 'code: 300 body: {"versions": {"values": [{"status": "stable", "updated": "2015-03-30T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v3+json"}], "id": "v3.4", "links": [{"href": "http://10.1.10.125:5000/v3/", "rel": "self"}]}, {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "http://10.1.10.125:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}]}}'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement