tools/generate_driver_list.py broken with python2

Bug #1838225 reported by yatin
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Medium
Gorka Eguileor

Bug Description

tools/generate_driver_list.py is broken with python2 after https://review.opendev.org/#/c/523659 and https://review.opendev.org/#/c/612311/.

It's failing with below Error:-
Volume Drivers
==============
/home/ykarel/work/cinder/cinder/volume/drivers/zadara.py:21: DeprecationWarning: defusedxml.lxml is no longer supported and will be removed in a future release.
  from defusedxml import lxml
Traceback (most recent call last):
  File "/home/ykarel/work/cinder/tools/generate_driver_list.py", line 202, in <module>
    main()
  File "/home/ykarel/work/cinder/tools/generate_driver_list.py", line 193, in main
    output_str(cinder_root, args)
  File "/home/ykarel/work/cinder/tools/generate_driver_list.py", line 137, in output_str
    util.get_volume_drivers())
  File "/home/ykarel/work/cinder/cinder/interface/util.py", line 45, in get_volume_drivers
    return [DriverInfo(x) for x in interface._volume_register]
  File "/home/ykarel/work/cinder/cinder/interface/util.py", line 72, in __init__
    self.driver_options = cls.get_driver_options()
TypeError: unbound method get_driver_options() must be called with InfortrendCLIFCDriver instance as first argument (got nothing instead)
ERROR: InvocationError for command '/home/ykarel/work/cinder/.tox/venv/bin/python /home/ykarel/work/cinder/tools/generate_driver_list.py' (exited with code 1)
____________________________________________________________________ summary _____________________________________________________________________
ERROR: gendriverlist: commands failed

Detected while building package in RDO(CentOS7 python2) in https://review.rdoproject.org/r/#/c/21615/. Somehow issue is not seen with python3(I have not checked why though)

Reproduction steps:-
git clone https://github.com/openstack/cinder
pushd cinder
sed -i 's/basepython.*/basepython = python2/' tox.ini
tox -egendriverlist

tox -edocs also fails as generate_driver_list.py is executed while building docs as well.

The issue is static method "get_driver_options" is not defined in three new Classes added in the two reviews mentioned above:- InfortrendCLIFCDriver, InfortrendCLIISCSIDriver and MacroSANBaseDriver.

Changed in tripleo:
status: New → Triaged
importance: Undecided → Medium
milestone: none → train-2
Changed in tripleo:
milestone: train-2 → train-3
Revision history for this message
yatin (yatinkarel) wrote :

Sorry i filed against tripleo, it's need to be under cinder, updating.

affects: tripleo → cinder
Changed in cinder:
milestone: train-3 → none
Revision history for this message
Sean McGinnis (sean-mcginnis) wrote :

Only py3 is supported. There are no plans to continue support for py2 for tools like this.

Revision history for this message
yatin (yatinkarel) wrote :

<<< Only py3 is supported. There are no plans to continue support for py2 for tools like this.
Ack, but the issue("get_driver_options" is not defined) will be get fixed, right? I shared those steps(there can be other steps without those tools though which people aware with cinder may have idea) just to get a reproducer.

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/673326

Changed in cinder:
assignee: nobody → Walt Boring (walter-boring)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in cinder:
assignee: Walt Boring (walter-boring) → Gorka Eguileor (gorka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.opendev.org/673467
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=2f0bd74604efe7f21823cba53b0a27f0ccc7ea12
Submitter: Zuul
Branch: master

commit 2f0bd74604efe7f21823cba53b0a27f0ccc7ea12
Author: Gorka Eguileor <email address hidden>
Date: Tue Jul 30 11:18:27 2019 +0200

    Fix get_driver_options

    Any new Cinder driver we add that doesn't have the "get_driver_options"
    method defined will break the driver list generation tools.

    The reason why it breaks them is because this method must be static, yet
    our base driver class doesn't define it as static.

    This patch:

    - Sets the base method as static to prevent new drivers from breaking
      the tools.

    - Documents the existence of this method for driver developers.

    - Adds get_driver_options method for drivers that are missing it.

    - Fix macrosan_client help message that breaks the doc building process.

    Closes-Bug: #1838225
    Change-Id: I4797724d7b55709f0903d522b0233242b867146d

Changed in cinder:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on cinder (master)

Change abandoned by Walter A. Boring IV (hemna) (<email address hidden>) on branch: master
Review: https://review.opendev.org/673326

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/cinder 15.0.0.0rc1

This issue was fixed in the openstack/cinder 15.0.0.0rc1 release candidate.

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.