Multiple clients return a raw Python error when not using subcommands

Bug #1903727 reported by Eduardo Santos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Mridula Joshi
python-novaclient
Fix Released
Low
Takashi Natsume

Bug Description

Description
===========
Multiple OpenStack clients return a raw Python error when passing
optional arguments without using a subcommand. The clients tested
and confirmed so far include:
- python-glanceclient
- python-manilaclient (fix in review)
- python-novaclient
- python-cinderclient (fix already merged)

Bug reports were already opened for python-manilaclient and
python-cinderclient.

An exception throughout all the clients is the `--version` argument,
which works as expected.

Steps to reproduce
==================
* I ran any of the affected clients without using a subcommand while
passing an optional argument

Some commands in which the bug occurs:
$ glance --os-project-id 123
$ nova --os-user-id 123

Expected result
===============
The clients should print a help message.

Actual result
=============
The clients print a raw Python error message.

'Namespace' object has no attribute 'func'
or
ERROR (AttributeError): 'Namespace' object has no attribute 'func'

Environment
===========
DevStack, running:
- python-glanceclient 3.2.2
- python-manilaclient 2.4.0
- python-novaclient 17.2.1
- python-cinderclient 7.2.0

Logs & Configs
==============
Some debug logs and already proposed fixes:
- python-glanceclient log: http://paste.openstack.org/show/799879/
- python-novaclient log: http://paste.openstack.org/show/799880/
- python-cinderclient fix: https://review.opendev.org/#/c/759440/
- python-manilaclient fix: https://review.opendev.org/#/c/761654/

no longer affects: python-manilaclient
Changed in python-novaclient:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Takashi Natsume (natsume-takashi)
status: Confirmed → In Progress
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

Fix proposed to branch: master in python-novaclient
Review: https://review.opendev.org/769082

Revision history for this message
Takashi Natsume (natsume-takashi) wrote :
Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 17.3.0

This issue was fixed in the openstack/python-novaclient 17.3.0 release.

Mridula Joshi (mrjoshi)
Changed in python-glanceclient:
assignee: nobody → Mridula Joshi (mrjoshi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)
Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-glanceclient/+/803326
Committed: https://opendev.org/openstack/python-glanceclient/commit/1eb0bbbed7c5ce12aee5f26be7a7aec51ae9ef55
Submitter: "Zuul (22348)"
Branch: master

commit 1eb0bbbed7c5ce12aee5f26be7a7aec51ae9ef55
Author: Mridula Joshi <email address hidden>
Date: Tue Aug 3 10:35:40 2021 +0000

    Fix undesirable raw Python error

    Using the glanceclient 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 `glance --os-image-api-version 2`.
    Added a default value to `func` as placeholder
    so that a help message is shown instead of the Python error.

    Closes-Bug: #1903727
    Change-Id: Ie4288262e408192310cbbc240bd1779b265a64fd

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

This issue was fixed in the openstack/python-glanceclient 3.5.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.