Comment 3 for bug 1659015

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/424256
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=6049be67c0f66bd2d15c7b52f77dd89ac4ec2e94
Submitter: Zuul
Branch: master

commit 6049be67c0f66bd2d15c7b52f77dd89ac4ec2e94
Author: Andrey Kurilin <email address hidden>
Date: Mon Jan 23 19:22:14 2017 +0200

    [CLI] Fix token auth type

    There are 2 known issues which breaks token auth method in CLI:

    * The wrong check of flag (the check should be for --os-token since
      arguments are not parsed at that moment) is performed in CLI inner method
      `_append_global_identity_args`. It led to usage of "password" auth
      type by default[1] even if `--os-token` cli argument is specified.
      If `--os-auth-type` is specified to token, keystoneauth1 library makes
      the right decision[2].

    * Based on an auth type, keystoneauth library registers different CLI
      arguments[3]. It means that `--os-username` argument is available only
      in password auth type, `--os-token` is available only in token auth
      type, etc.
      It also affects the way in which the python code should access such
      arguments. The arguments which are unrelated to the selected auth type
      are omitted from the parsed arguments object.
      That sounds reasonable, but unfortunately the code assumes the
      unrelated arguments are always present which leads to an
      AttributeError.

    Combination of these 2 issues made token auth type broken in CLI layer.

    [1] https://github.com/openstack/python-novaclient/blob/ee2221f0526c4a6bed431229e363c740d07b8ee9/novaclient/shell.py#L255-L257
    [2] https://github.com/openstack/keystoneauth/blob/14dd37b34c4821abf145ea24e593eddaa9f607c8/keystoneauth1/loading/cli.py#L51-L52
    [3] https://github.com/openstack/keystoneauth/blob/14dd37b34c4821abf145ea24e593eddaa9f607c8/keystoneauth1/loading/cli.py#L65-L73

    Closes-Bug: #1659015
    Change-Id: Ibc861d396b71fe105288d8336623cc22cf92523e