novaclient localhost:5000 connection refused

asked 2016-04-19 12:26:56 -0500

vandexel gravatar image

I'm new with using novaclient. I'm trying to reconfigure some code for my company that worked previously and is now not working. I've updated some of it for the newer version of novaclient, but now, when I run this code:

from novaclient import client
def main():
    parser = ArgumentParser()
    parser.add_argument('-u', '--user', default='admin')
    parser.add_argument('-p', '--password', default='admin')
    parser.add_argument('-t', '--tenant', default='admin')
    parser.add_argument('-a', '--auth-url', default='http://localhost:5000/v2.0')
    parser.add_argument('-S', '--service-type', default='compute')
    parser.add_argument('-H', '--host')
    parser.add_argument('-s', '--scheme', default=DEFAULT_SCHEME)
    args = parser.parse_args()

myclient = client.Client('2',args.user, args.password, args.tenant, args.auth_url, service_type=args.service_type, endpoint_type="internalURL")


if args.host:
    hypervisors = myclient.hypervisors.search(args.host)
else:
    hypervisors = myclient.hypervisors.list()

I am getting this error:

requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /v2.0/tokens (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x168aa50>: Failed to establish a new connection: [Errno 111] Connection refused',))

Does anyone know why this might be?

Thanks!

edit retag flag offensive close merge delete