It is confusing admin_state_down=False means DOWN

Bug #1161853 reported by Akihiro Motoki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
Wishlist
Akihiro Motoki

Bug Description

Option admin-state-down is defined as follows.

        parser.add_argument(
            '--admin-state-down',
            default=True, action='store_false',
            help='Set Admin State Up to false')

If this option is specified, parsed_args.admin_state_down is set to False,
ie, admin_state_down=False means admin_state_up is set to False.

It is confusing when reading the code.
it can be easily fixed:

        parser.add_argument(
            '--admin-state-down',
            dest='admin_state', action='store_false',
            help='Set Admin State Up to false')

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

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

Changed in python-quantumclient:
status: New → In Progress
Akihiro Motoki (amotoki)
Changed in python-quantumclient:
importance: Undecided → Wishlist
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-quantumclient (master)

Reviewed: https://review.openstack.org/25705
Committed: http://github.com/openstack/python-quantumclient/commit/ad7caef9c302575427dfc46cea1c5b84fef8e061
Submitter: Jenkins
Branch: master

commit ad7caef9c302575427dfc46cea1c5b84fef8e061
Author: Akihiro MOTOKI <email address hidden>
Date: Fri Mar 29 03:15:55 2013 +0900

    Change variable name of admin_state_down to admin_state

    It is confusing that admin_state_down=False means admin-state is DOWN.
    It is easy to understand if the variable name matches its value.

    Also removes 'default=xxx' from options with store_true/false action
    since store_true/false sets the default value implicitly.

    Fixes bug 1161853

    Change-Id: I3146dd8974990c94e5f9b3b5bf6a8b28a245d64e

Changed in python-quantumclient:
status: In Progress → Fix Committed
Akihiro Motoki (amotoki)
Changed in python-neutronclient:
milestone: none → 2.2.1-2.2.6
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.