osc fail when using admin_token -- __init__() got an unexpected keyword argument 'project_domain_id'

Bug #1642301 reported by Boris Bobrov
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
python-openstackclient
Fix Released
High
Boris Bobrov

Bug Description

The following commit: https://github.com/openstack/os-client-config/commit/b5d65b74f60ce743b03b49a6c176700d658cfe98 introduced a regression for OSC.

Using the --admin_endpoint did not work on older versions of OSC either, but now that OCC maps token_endpoint to admin_endpoint the problem is exposed.

OSC version 3.3.0

This command fails:
OS_IDENTITY_API_VERSION=3 openstack token issue --os-auth-type=token_endpoint --os-url=http://localhost:5000/v3/ --os-token=$token2

With this traceback:
Traceback (most recent call last):
  File "/home/breton/.virtualenvs/keystone/local/lib/python2.7/site-packages/cliff/app.py", line 393, in run_subcommand
    self.prepare_to_run_command(cmd)
  File "/home/breton/.virtualenvs/keystone/local/lib/python2.7/site-packages/openstackclient/shell.py", line 198, in prepare_to_run_command
    return super(OpenStackShell, self).prepare_to_run_command(cmd)
  File "/home/breton/.virtualenvs/keystone/local/lib/python2.7/site-packages/osc_lib/shell.py", line 429, in prepare_to_run_command
    self.client_manager.setup_auth()
  File "/home/breton/.virtualenvs/keystone/local/lib/python2.7/site-packages/openstackclient/common/clientmanager.py", line 78, in setup_auth
    self._cli_options.config,
  File "/home/breton/.virtualenvs/keystone/local/lib/python2.7/site-packages/openstackclient/common/client_config.py", line 195, in load_auth_plugin
    auth_plugin = loader.load_from_options(**config['auth'])
  File "/home/breton/.virtualenvs/keystone/local/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 164, in load_from_options
    return self.create_plugin(**kwargs)
  File "/home/breton/.virtualenvs/keystone/local/lib/python2.7/site-packages/keystoneauth1/loading/base.py", line 125, in create_plugin
    return self.plugin_class(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'project_domain_id'

Full log with --debug flag: http://paste.openstack.org/show/589463/

Revision history for this message
Boris Bobrov (bbobrov) wrote :
Changed in python-openstackclient:
status: New → In Progress
assignee: nobody → Boris Bobrov (bbobrov)
Revision history for this message
Steve Martinelli (stevemar) wrote :
description: updated
summary: - __init__() got an unexpected keyword argument 'project_domain_id'
+ osc fail when using admin_token -- __init__() got an unexpected keyword
+ argument 'project_domain_id'
Changed in python-openstackclient:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (master)

Reviewed: https://review.openstack.org/398917
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=e51a8d63747932f2ee4ffab02dfb0cd43e4a103d
Submitter: Jenkins
Branch: master

commit e51a8d63747932f2ee4ffab02dfb0cd43e4a103d
Author: Boris Bobrov <email address hidden>
Date: Thu Nov 17 13:46:21 2016 +0300

    Use project_domain_id only in password auth

    The method being changed constructs domain-related parameters that will
    further be passed to the auth plugin. If project domain is not
    passed, the method sets it to the default domain.

    token_endpoint does not expect any information about domain,
    because it uses only a token and URL. Passing it to auth plugin causes
    an exception.

    Construct domain-related parameters only for specific plugins, such
    as password or totp.

    Change-Id: I13db3bbe31a0ed843e9f4528d37c768546e2bee9
    Closes-Bug: 1642301

Changed in python-openstackclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstackclient 3.4.1

This issue was fixed in the openstack/python-openstackclient 3.4.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-openstackclient (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/408906

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-openstackclient (stable/newton)

Reviewed: https://review.openstack.org/408906
Committed: https://git.openstack.org/cgit/openstack/python-openstackclient/commit/?id=fc370104156810cb4f65a3235d6bf6ab65f028bd
Submitter: Jenkins
Branch: stable/newton

commit fc370104156810cb4f65a3235d6bf6ab65f028bd
Author: Boris Bobrov <email address hidden>
Date: Thu Nov 17 13:46:21 2016 +0300

    Use project_domain_id only in password auth

    The method being changed constructs domain-related parameters that will
    further be passed to the auth plugin. If project domain is not
    passed, the method sets it to the default domain.

    token_endpoint does not expect any information about domain,
    because it uses only a token and URL. Passing it to auth plugin causes
    an exception.

    Construct domain-related parameters only for specific plugins, such
    as password or totp.

    Change-Id: I13db3bbe31a0ed843e9f4528d37c768546e2bee9
    Closes-Bug: 1642301
    (cherry picked from commit e51a8d63747932f2ee4ffab02dfb0cd43e4a103d)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-openstackclient 3.2.1

This issue was fixed in the openstack/python-openstackclient 3.2.1 release.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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