Comment 2 for bug 1309180

Revision history for this message
Sergey Skripnick (eyerediskin) wrote :

Exactly the same when I trying to use port 5000:

from keystoneclient.v2_0 import client
USERNAME, PASSWORD, TENANT, AUTH_URL = 'rally', 'rally', 'rally', 'http://172.18.200.196:5000/v2.0'
keystone = client.Client(username=USERNAME, password=PASSWORD, tenant_name=TENANT, auth_url=AUTH_URL)
keystone.authenticate()
print keystone.tenants.list()

Traceback (most recent call last):
  File "/tmp/k.py", line 5, in <module>
    print keystone.tenants.list()
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/v2_0/tenants.py", line 118, in list
    tenant_list = self._list("/tenants%s" % query, "tenants")
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/base.py", line 106, in _list
    resp, body = self.client.get(url)
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/httpclient.py", line 590, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/httpclient.py", line 582, in _cs_request
    return self.request(url, method, **kwargs)
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/httpclient.py", line 564, in request
    resp = super(HTTPClient, self).request(url, method, **kwargs)
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/baseclient.py", line 21, in request
    return self.session.request(url, method, **kwargs)
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/utils.py", line 318, in inner
    return func(*args, **kwargs)
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/session.py", line 257, in request
    resp = self._send_request(url, method, redirect, **kwargs)
  File "/home/sskripnick/code/python-keystoneclient/keystoneclient/session.py", line 286, in _send_request
    raise exceptions.ConnectionRefused(msg)
keystoneclient.openstack.common.apiclient.exceptions.ConnectionRefused: Unable to establish connection to http://192.168.0.2:35357/v2.0/tenants

But all works fine when I add `endpoint' argument:

from keystoneclient.v2_0 import client
USERNAME, PASSWORD, TENANT, AUTH_URL = 'rally', 'rally', 'rally', 'http://172.18.200.196:5000/v2.0'
keystone = client.Client(username=USERNAME, password=PASSWORD, tenant_name=TENANT,
                         auth_url=AUTH_URL, endpoint=AUTH_URL)
keystone.authenticate()
print keystone.tenants.list()

With `endpoint' it works even with port 35357