cinder-manage cluster remove does not work

Bug #1894381 reported by Jon Cui
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Jon Cui

Bug Description

After executing cinder-manage command to remove a cluster, the cluster still exists.
I debugged cinder-manage script with pdb, and found an oslo_config error raised as follow,
oslo_config.cfg.NoSuchOptError: no such option cluster_name in group [DEFAULT]

The problem is that option name registed in CONF is cluster-name, but arg in action_func is cluster_name,
they are unable to work in concert.

# debug info
[root@host-192-168-32-170 czl]# cinder-manage cluster remove cinder-volume cluster01@IBMStorwize_IPSAN-1
Deprecated: Option "logdir" from group "DEFAULT" is deprecated. Use option "log-dir" from group "DEFAULT".
> /usr/lib/python3.6/site-packages/cinder/cmd/manage.py(854)main()
-> fn_kwargs = fetch_func_args(fn)
(Pdb) c
> /usr/lib/python3.6/site-packages/cinder/cmd/manage.py(820)fetch_func_args()
-> fn_kwargs[arg] = getattr(CONF.category, arg)
(Pdb) arg
'cluster_name'
(Pdb) n
oslo_config.cfg.NoSuchOptError: no such option cluster_name in group [DEFAULT]
> /usr/lib/python3.6/site-packages/cinder/cmd/manage.py(820)fetch_func_args()
-> fn_kwargs[arg] = getattr(CONF.category, arg)
(Pdb) c
[root@host-192-168-32-170 czl]#

Jon Cui (czl389)
Changed in cinder:
assignee: nobody → Jon Cui (czl389)
status: New → In Progress
Jon Cui (czl389)
information type: Public → Public Security
Jon Cui (czl389)
information type: Public Security → Public
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/750077
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=50a4592efb39902b994470a229dff7b37810727b
Submitter: Zuul
Branch: master

commit 50a4592efb39902b994470a229dff7b37810727b
Author: czl389 <czl389@163.com>
Date: Sun Sep 6 00:48:32 2020 +0800

    Fix cinder-manage cluster remove raising NoSuchOptError

    When executing 'cinder-manage cluster remove' script, an error occurs in
    the call 'fetch_func_args(fn)':
    oslo_config.cfg.NoSuchOptError:no such option cluster_name in group
    [DEFAULT].

    The cause is that the call 'fetch_func_args(fn)' is trying to fetch
    value of argument 'cluster_name' of fn from CONF.cluster_name, but
    corresponding argument registered in CONF is 'cluster-name' actually.

    We fix this bug by changing argument name registered in CONF, if
    positional argument contains '-':
    1.put it into automatic conversion from '- to '_', so that keep it the
     same name as handler function argument.
    2.add metavar if it doesn't already exist, and it will maintain the help
     output.

    Change-Id: I3f2a04b4c8e7bafe6e38fc86a69192dd3a94c0c5
    Closes-Bug: #1894381

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

This issue was fixed in the openstack/cinder 18.0.0.0b1 development milestone.

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.