[CLI] Token authentication is broken

Bug #1659015 reported by Andriy Kurilin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
Medium
Andriy Kurilin

Bug Description

While switching to keystoneauth1 library[*], wrong argument ("os-token" instead of "--os-token") was used in check of auth type. In all cases "password" auth type was chosen and only "password"-related CLI arguments were registreted

[*] - https://github.com/openstack/python-novaclient/commit/1f11840dd84f3570330d1fcd53d1e8eea5ff7922

Changed in python-novaclient:
assignee: nobody → Andrey Kurilin (andreykurilin)
status: New → In Progress
Changed in python-novaclient:
assignee: Andrey Kurilin (andreykurilin) → Matt Riedemann (mriedem)
Changed in python-novaclient:
assignee: Matt Riedemann (mriedem) → Andrey Kurilin (andreykurilin)
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

@Andrey, the following bug report is similar to this bug.

Arguments not initialized if unsupported by keystoneauth plugin
https://bugs.launchpad.net/python-novaclient/+bug/1744118

Revision history for this message
Takashi Natsume (natsume-takashi) wrote :
Changed in python-novaclient:
assignee: Andrey Kurilin (andreykurilin) → Matt Riedemann (mriedem)
Matt Riedemann (mriedem)
Changed in python-novaclient:
assignee: Matt Riedemann (mriedem) → Andrey Kurilin (andreykurilin)
importance: Undecided → High
melanie witt (melwitt)
Changed in python-novaclient:
importance: High → Medium
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

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

This issue was fixed in the openstack/python-novaclient 10.2.0 release.

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.