Uploaded image for project: 'Libcloud'
  1. Libcloud
  2. LIBCLOUD-716

Fail to use openstack compute driver

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Compute
    • Labels:
      None

      Description

      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, ..):

      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
      

      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:

      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
      

      _log_curl expects the port to be an int.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aviweit Avi Weit
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: