You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by "Avi Weit (JIRA)" <ji...@apache.org> on 2015/06/03 13:19:49 UTC

[jira] [Created] (LIBCLOUD-716) Fail to use openstack compute driver

Avi Weit created LIBCLOUD-716:
---------------------------------

             Summary: Fail to use openstack compute driver
                 Key: LIBCLOUD-716
                 URL: https://issues.apache.org/jira/browse/LIBCLOUD-716
             Project: Libcloud
          Issue Type: Bug
          Components: Compute
            Reporter: Avi Weit


OpenStack compute driver APIs fail.

I can not run openstack examples under docs/examples/compute. After updating with credentials (user/password) and setting ex_force_auth_url to point to my keystone service of my latest devstack, it immediately fail on every API call (e.g. driver.list_images, driver.list_sizes, ..):

{code}
Traceback (most recent call last):
  File "docs/examples/compute/openstack/tenant_name.py", line 10, in <module>
    print driver.list_sizes()
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/compute/drivers/openstack.py", line 283, in list_sizes
    self.connection.request('/flavors/detail').object)
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/openstack.py", line 200, in request
    raw=raw)
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/base.py", line 738, in request
    headers=headers)
  File "/usr/lib/python2.7/httplib.py", line 973, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1007, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 969, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 829, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 791, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 772, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 556, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
socket.error: getaddrinfo() argument 2 must be integer or string
{code}

I can see that the port is being parsed into a unicode type and I assume that this is the reason create_connection of socket.py fails.

When running it in debug mode (e.g. LIBCLOUD_DEBUG=/dev/stderr LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE=1 python docs/examples/compute/openstack/tenant_name.py)
then it fails with the following exception:

{code}
Traceback (most recent call last):
  File "docs/examples/compute/openstack/tenant_name.py", line 10, in <module>
    print driver.list_sizes()
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/compute/drivers/openstack.py", line 283, in list_sizes
    self.connection.request('/flavors/detail').object)
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/openstack.py", line 200, in request
    raw=raw)
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/base.py", line 674, in request
    action = self.morph_action_hook(action)
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/openstack.py", line 255, in morph_action_hook
    self._populate_hosts_and_request_paths()
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/openstack.py", line 288, in _populate_hosts_and_request_paths
    osa = osa.authenticate(**kwargs)  # may throw InvalidCreds
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/openstack_identity.py", line 841, in authenticate
    return self._authenticate_2_0_with_password()
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/openstack_identity.py", line 866, in _authenticate_2_0_with_password
    return self._authenticate_2_0_with_body(reqbody)
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/openstack_identity.py", line 871, in _authenticate_2_0_with_body
    method='POST')
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/base.py", line 738, in request
    headers=headers)
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/base.py", line 440, in request
    self._log_curl(method, url, body, headers) + "\n")
  File "/.my-virtenv/local/lib/python2.7/site-packages/apache_libcloud-0.17.1.dev0-py2.7.egg/libcloud/common/base.py", line 390, in _log_curl
    self.port, url))])
TypeError: %d format: a number is required, not str
{code}

_log_curl expects the port to be an int.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)