Cinder shows a raw python error when using --os-volume-api-version incorrectly

Bug #1867061 reported by Sofia Enriquez
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-cinderclient
Fix Released
Undecided
Eduardo Santos

Bug Description

Description of problem:
In general, cinder shows a help message when a user types a wrong command. However, when using microversion shows a raw python error prompts.

How reproducible:

cinder --version
> 6.0.0

cinder --os-volume-api-version 3.40
> ERROR: 'Namespace' object has no attribute 'func'

Actual results:
ERROR: 'Namespace' object has no attribute 'func'

Expected results:
It must be something about adding the option that messes things up.

Changed in cinder:
assignee: nobody → Sofia Enriquez (lsofia-enriquez)
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Some more info:

cinder --debug --os-volume-api-version 3.40
DEBUG (shell:1026) 'Namespace' object has no attribute 'func'
Traceback (most recent call last):
  File "/home/smcginnis/src/openstack/python-cinderclient/cinderclient/shell.py", line 1018, in main
    OpenStackCinderShell().main(sys.argv[1:])
  File "/home/smcginnis/src/openstack/python-cinderclient/cinderclient/shell.py", line 609, in main
    if args.func == self.do_help:
AttributeError: 'Namespace' object has no attribute 'func'
DEBUG:cinderclient.shell:'Namespace' object has no attribute 'func'
Traceback (most recent call last):
  File "/home/smcginnis/src/openstack/python-cinderclient/cinderclient/shell.py", line 1018, in main
    OpenStackCinderShell().main(sys.argv[1:])
  File "/home/smcginnis/src/openstack/python-cinderclient/cinderclient/shell.py", line 609, in main
    if args.func == self.do_help:
AttributeError: 'Namespace' object has no attribute 'func'
ERROR: 'Namespace' object has no attribute 'func'

Changed in cinder:
status: New → Confirmed
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Works fine for me if I actually give it a command, so appears to be just when needing to print the help output.

Changed in python-cinderclient:
status: New → Confirmed
no longer affects: cinder
Changed in python-cinderclient:
assignee: nobody → Sofia Enriquez (lsofia-enriquez)
Changed in python-cinderclient:
assignee: Sofia Enriquez (lsofia-enriquez) → Eduardo Santos (ecsantos)
tags: added: low-hanging-fruit
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-cinderclient (master)

Fix proposed to branch: master
Review: https://review.opendev.org/759440

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

Reviewed: https://review.opendev.org/759440
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=d92f15a09e59942bb60b7ef3a81c1e21dc16b578
Submitter: Zuul
Branch: master

commit d92f15a09e59942bb60b7ef3a81c1e21dc16b578
Author: Eduardo Santos <email address hidden>
Date: Fri Oct 23 14:17:23 2020 +0000

    Fix undesirable raw Python error

    Using the cinderclient without a subcommand while
    passing an optional argument triggers the raw Python
    error `ERROR: 'Namespace' object has no attribute
    'func'`. This bug can be reproduced by issuing the
    command `cinder --os-volume-api-version 3.40`.
    Added a default value to `func` and an empty value to
    `command` as placeholders so that a help message is
    shown instead of the Python error.

    Change-Id: Idb51e8635b97f0da2976f3268d5e19100ec77203
    Closes-Bug: #1867061

Changed in python-cinderclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-cinderclient 7.3.0

This issue was fixed in the openstack/python-cinderclient 7.3.0 release.

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.