Client prompts for password twice

Bug #1488892 reported by Stuart McLaren
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Flavio Percoco

Bug Description

The following command causes the password to be asked for twice:

$ glance --os-tenant-name=xxx --os-username=xxx --os-auth-url=xxx --os-region xxx image-list
<snip: removed some ssl output>
OS Password:
WARNING: The client is falling back to v1 because the accessing to v2 failed. This behavior will be removed in future versions
OS Password:

In contrast:

$ glance --os-image-api-version 1--os-tenant-name=xxx --os-username=xxx --os-auth-url=xxx --os-region xxx image-list

only prompts once

summary: - client prompts for password twice
+ Client prompts for password twice
Changed in python-glanceclient:
assignee: nobody → Martin Tsvetanov (martin-iva-tsvetanov)
tags: added: 1.0.0-potential
Changed in python-glanceclient:
assignee: Martin Tsvetanov (martin-iva-tsvetanov) → Flavio Percoco (flaper87)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/219329

Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/219329
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=1e2274aef011c143ef0ae421b45755babaff3652
Submitter: Jenkins
Branch: master

commit 1e2274aef011c143ef0ae421b45755babaff3652
Author: Flavio Percoco <email address hidden>
Date: Tue Sep 1 18:03:41 2015 +0200

    Password should be prompted once

    There's a corner case where password may be requested twice. In a fresh
    environment, when schemas have not be downloaded for v2, the client will
    ask for a password to download the schemas and then it'll ask for the
    password again to run the actual command. This happens because we parse
    the CLI arguments twice to make sure we're parsing them for the right
    client version.

    This patch checks if the password is unset in the newly parsed arguments
    and if it's been set in the previously parsed ones. In this case it
    keeps the set password. I believe this approach is safer than re-using
    the already parsed arguements which may have been parsed for a different
    API version (might happen because we fallback to v1 if v2 is not
    available).

    Change-Id: I080253170e3e84a90363e5bb494cf137895fe2e7
    Closes-bug: #1488892

Changed in python-glanceclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
milestone: none → 1.1.0
status: Fix Committed → Fix Released
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.