Got ERROR: 'bool' object has no attribute 'lower' when create volume snapshot

Bug #1207609 reported by Zhikun Liu
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cinder
Invalid
Undecided
Vincent Hou
python-cinderclient
Invalid
Undecided
Cory Stone

Bug Description

Tested on Devstack.

# cinder --debug snapshot-create 173fe39c-9603-4cac-bc13-2bb990ed8df9
snap..
DEBUG (shell:523) 'bool' object has no attribute 'lower'
Traceback (most recent call last):
  File "/opt/stack/python-cinderclient/cinderclient/shell.py", line 518, in main
    sys.argv[1:]))
  File "/opt/stack/python-cinderclient/cinderclient/shell.py", line 464, in main
    args.func(self.cs, args)
  File "/opt/stack/python-cinderclient/cinderclient/v1/shell.py", line 424, in do_snapshot_create
    if not args.force.lower() in ['true', '1', 'yes', 'y',
AttributeError: 'bool' object has no attribute 'lower'
ERROR: 'bool' object has no attribute 'lower'

Vincent Hou (houshengbo)
Changed in cinder:
status: New → Confirmed
assignee: nobody → Vincent Hou (houshengbo)
Changed in python-cinderclient:
assignee: nobody → Vincent Hou (houshengbo)
status: New → Confirmed
Revision history for this message
Cory Stone (corystone) wrote :

args.force defaults to a boolean.

https://review.openstack.org/#/c/38002/ added string operations on said boolean.

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

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

Changed in python-cinderclient:
assignee: Vincent Hou (houshengbo) → Cory Stone (corystone)
status: Confirmed → In Progress
Revision history for this message
John Griffith (john-griffith) wrote :

Yeah, actually IMO I should've caught that and -2'd the change. I'm also not crazy about allowing any string as the input and modifying it.

Revision history for this message
John Griffith (john-griffith) wrote :

I've proposed a revert of the offending patch [1]. We can fix this the correct way by using strutils.bool_from_string() to address bug [2]

I'll mark this as invalid as a result, and update the original as still needing fixed.

[1] https://review.openstack.org/#/c/38002/

[2] https://bugs.launchpad.net/nova/+bug/1014689

Revision history for this message
Rushi Agrawal (rushiagr) wrote :

Sorry, but I can't reproduce this on latest cinder, so marking it as invalid. Please reopen if you can reproduce this, along with steps to reproduce if different from the original bug message..

Changed in cinder:
status: Confirmed → Invalid
Changed in python-cinderclient:
status: In Progress → Invalid
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.