command `openstack project list ` does not work without scope

Bug #1693562 reported by Adam Young
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
New
Undecided
Unassigned

Bug Description

With only

export OS_AUTH_URL=http://phx2.cloud.rdoproject.org:35357/
export OS_USERNAME=ayoung
export OS_PASSWORD=9aab6c59-ff0f-46f6-bb1a-f73b7a40b5a7
export OS_USER_DOMAIN_NAME=Default

I can get an unscoped token. With the same set of values, I should be able to get a list of projects, so I know what tokens I can use. This is how django-openstack-auth work:

http://git.openstack.org/cgit/openstack/django_openstack_auth/tree/openstack_auth/utils.py#n357

def get_project_list(*args, **kwargs):
    is_federated = kwargs.get('is_federated', False)
    sess = kwargs.get('session') or get_session()
    auth_url, _ = fix_auth_url_version_prefix(kwargs['auth_url'])
    auth = token_endpoint.Token(auth_url, kwargs['token'])
    client = get_keystone_client().Client(session=sess, auth=auth)

    if get_keystone_version() < 3:
        projects = client.tenants.list()
    elif is_federated:
        projects = client.federation.projects.list()
    else:
        projects = client.projects.list(user=kwargs.get('user_id'))

    projects.sort(key=lambda project: project.name.lower())
    return projects

Revision history for this message
Rui Chen (kiwik-chenrui) wrote :

Hi Adam:
    I try to reproduce the issue, like following, anything I miss? I use current master openstackclient with pip dev mode, so it's 3.11.1. More configuration is in paste page[1].

stack@ubuntu1604 /etc/openstack $ env | grep OS
OS_USER_DOMAIN_ID=default
OS_IDENTITY_API_VERSION=3
OS_PASSWORD=*****
OS_AUTH_URL=http://10.3.150.30/identity
OS_USERNAME=admin
LESSCLOSE=/usr/bin/lesspipe %s %s
stack@ubuntu1604 /etc/openstack $ openstack project list
+----------------------------------+----------+
| ID | Name |
+----------------------------------+----------+
| 9a43f9a955fa4f91bbdb69ee8c5f6614 | admin |
| 6ea47bfad8d2494ebc7b89fe99756003 | demo |
| 861fb25813204bbbacb6c9ae83e554be | alt_demo |
+----------------------------------+----------+
stack@ubuntu1604 /etc/openstack $ openstack --version
openstack 3.11.1
stack@ubuntu1604 /etc/openstack $

[1]: http://paste.openstack.org/show/612083/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.