softlayer / softlayer-object-storage-python

SoftLayer Object Storage Python Client
Other
19 stars 30 forks source link

Can't work in a private only network #36

Open talbarda opened 9 years ago

talbarda commented 9 years ago

I have a virtual server on softlayer with closed public network, and when I try to run the following, it fails (Exception below): import object_storage sl_storage = object_storage.get_client(X,Y, datacenter='dal05',auth_url='http://dal05.objectstorage.softlayer.net/auth/v1.0') # WORKS sl_storage['barda'].exists() # FAILED

In order to debug the problem, we changed the "/usr/lib/python2.7/site-packages/object_storage/transport/httplib2conn.py" file to print the request url and we found that it sends a request to the public url "http://dal05.objectstorage.softlayer.net/auth/v1.0" instead of the private url in the input auth_url "http://dal05.objectstorage.service.networklayer.com/auth/v1.0"

Exception: File "/usr/lib/python2.7/site-packages/object_storage/client.py", line 249, in create_container return self.container(name).create() File "/usr/lib/python2.7/site-packages/object_storage/container.py", line 167, in create headers={'Content-Length': '0'}) File "/usr/lib/python2.7/site-packages/object_storage/container.py", line 317, in make_request return self.client.make_request(method, path, _args, _kwargs) File "/usr/lib/python2.7/site-packages/object_storage/client.py", line 354, in make_request result = self.conn.make_request(method, url, _args, _kwargs) File "/usr/lib/python2.7/site-packages/object_storage/transport/httplib2conn.py", line 51, in make_request response = _make_request(headers) File "/usr/lib/python2.7/site-packages/object_storage/transport/httplib2conn.py", line 44, in _make_request res, content = self.http.request(url, method, headers=headers, body=data) File "/usr/lib/python2.7/site-packages/httplib2/init.py", line 1593, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "/usr/lib/python2.7/site-packages/httplib2/init.py", line 1335, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "/usr/lib/python2.7/site-packages/httplib2/init.py", line 1291, in _conn_request response = conn.getresponse() File "/usr/lib64/python2.7/httplib.py", line 1033, in getresponse raise ResponseNotReady() httplib.ResponseNotReady