Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[LIBCLOUD-716] Fix port type error #533
Fixes issue: https://issues.apache.org/jira/browse/LIBCLOUD-716
Thinking more about it - this code has been like that since pretty much the beginning and I worked with many OpenStack installations which ran on a custom port and I never encountered any issues.
Curious if we have introduced a regression somewhere recently or there is something else going on (e.g. some Python versions don't accept a string).
My libcloud runs on the following python version:
in an ubuntu 14.04 system. My devstack is from a latest version.
I am using the following snippet to run openstack operations which fail, as described in the above jira issue link.
My python2.7 socket.py create_connection complains that port is not an int or str. Looking into this, I can see that it receives a port from unicode type and that is probably the reason it fails.
Adding traces in _tuple_from_url to print netloc and its type, I can see that netloc for the nova service is unicode.
188.8.131.52:5000, <type 'str'>
From looking into libcloud code it seems to me that port can be a string if it is fetched out from a url (_tuple_from_url).
Is that correct?
I would like to raise a question:
I am curious whether the 2nd port assignment is somewhat redundant.