how to do username authentication

asked 2015-10-06 08:02:51 -0500

Chris Curvey gravatar image

I'm brand new to OpenStack, so if the answer is RFTM, I'd appreciate a pointer to the correct FM. :)

I've installed the devstack as per (

Now I'm trying to write a Python program to talk to the OpenStack environment, and I'm following the examples at (

this code:

from keystoneclient.v3 import client
keystone = client.Client(auth_url="http://{}:5000/v3".format(KEYSTONE_HOST),
                         username="admin", password="st@ckm3")
print keystone.projects.list()

raises 'keystoneclient.exceptions.EndpointNotFound' when calling keystone.projects.list()

This code:

from keystoneclient import client
keystone = client.Client(auth_url="http://{}:5000".format(KEYSTONE_HOST),
                     username="admin", password="st@ckm3")

raises 'keystoneclient.exceptions.MissingAuthPlugin'

This code works:

from keystoneclient.auth.identity import v3
from keystoneclient import session
from keystoneclient.v3 import client

auth = v3.Password(auth_url="http://{}:5000/v3".format(KEYSTONE_HOST),
sess = session.Session(auth=auth)
keystone = client.Client(session=sess)

print keystone.projects.list()

But how would I know the user_id and project_id without being able to connect to Keystone? (I'm getting it by looking it up through the Horizon interface.)

edit retag flag offensive close merge delete