for specifying Boolean values, allow True, true, 1, on

Bug #1415943 reported by Ruby Loo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-ironicclient
Fix Released
Low
Ruby Loo

Bug Description

The valid input strings for Boolean values is inconsistent among the subcommands. eg:
- for node-set-console-mode: 'true', 'false'
- for node-set-maintenance: 'on', 'off', (and 'true', 'false', 'True', 'False' with https://review.openstack.org/150692
- node-list, --maintenance, --associated: 'true', 'false', 'True', 'False'

We should allow the same set of valid values for all of them.

Dmitry Tantsur (divius)
Changed in python-ironicclient:
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-ironicclient (master)

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

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

Reviewed: https://review.openstack.org/170230
Committed: https://git.openstack.org/cgit/openstack/python-ironicclient/commit/?id=8fd2ac3ba1c48189d60d73043c4b6868de2633f2
Submitter: Jenkins
Branch: master

commit 8fd2ac3ba1c48189d60d73043c4b6868de2633f2
Author: Ruby Loo <email address hidden>
Date: Thu Apr 2 18:17:33 2015 +0000

    Consistent and more valid strings for Booleans

    The set of valid input strings for Boolean values was inconsistent among
    the subcommands of the Ironic CLI. egs:
     -for node-set-console-mode: 'true', 'false'
     -for node-set-maintenance: 'on', 'off', 'true', 'false', 'True', 'False'

    This change allows the same set of valid values for all the subcommands:
    '0', '1', 'f', 'false', 'n', 'no', 'off', 'on', 't', 'true', 'y', 'yes'.

    For invalid strings, we output the subcommand usage along with the
    argument, invalid string, and valid string choices.

    At the API level, if NodeManager.set_maintenance() is passed an invalid
    state (maintenance mode) value, an InvalidAttribute exception is raised.

    Change-Id: I541695388489cdc640265df8ee6a9999e1442870
    Closes-Bug: #1415943

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