BaseGenericPlugin redundant get_options() calls causes arg conflict

Bug #1388954 reported by David J Hu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-keystoneclient
Fix Released
Medium
Jamie Lennox

Bug Description

     21 from keystoneclient.auth.identity import base

     27 def get_options():
     28 return base.get_options() + [ <== 3. call get_option from base, which is *not* necessary. This resulted in duplicate --os-auth-url, which is a conflict.
     29 cfg.StrOpt('domain-id', help='Domain ID to scope to'),
     30 cfg.StrOpt('domain-name', help='Domain name to scope to'),
     31 cfg.StrOpt('tenant-id', help='Tenant ID to scope to'),
     32 cfg.StrOpt('tenant-name', help='Tenant name to scope to'),

    176 @classmethod
    177 def get_options(cls):
    178 options = super(BaseGenericPlugin, cls).get_options() <== 1. Get the options from super, which calls base.get_options()
    179 options.extend(get_options()) <== 2. Call get_options() at line 27.
    180 return options

David J Hu (david-j-hu)
affects: opencontrail → python-keystoneclient
Revision history for this message
David J Hu (david-j-hu) wrote :

keystoneclient/auth/identity/generic/base.py

wanghong (w-wanghong)
Changed in python-keystoneclient:
assignee: nobody → wanghong (w-wanghong)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-keystoneclient (master)

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

Changed in python-keystoneclient:
status: New → In Progress
Revision history for this message
Dolph Mathews (dolph) wrote :

It's not really clear what is being duplicated from this bug report; what is the effect you're seeing?

Changed in python-keystoneclient:
importance: Undecided → Medium
Revision history for this message
Jamie Lennox (jamielennox) wrote :

Bug is correct.

If you use the generic password plugin from a CLI (which is really the plugin i hope to be default) it will try to add the --os-auth-url option to the parser twice because it is listed in the get_options twice. This is not allowed in argparse and will fail so generic.Password is unusable from the CLI.

Changed in python-keystoneclient:
assignee: wanghong (w-wanghong) → Jamie Lennox (jamielennox)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-keystoneclient (master)

Reviewed: https://review.openstack.org/132652
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=b7da6d0e8449355fa7652523ee5ad0b36b298399
Submitter: Jenkins
Branch: master

commit b7da6d0e8449355fa7652523ee5ad0b36b298399
Author: wanghong <email address hidden>
Date: Tue Nov 4 18:54:59 2014 +0800

    duplicate auth-url option returned by BaseGenericPlugin

    The free function get_options() should only return the options that
    the object itself needs.

    Change-Id: Id54f353d8b125807a8fc33b4bca8854605e3febb
    Closes-Bug: #1388954

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