Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1663661

Summary: vdsm uses obsolete python module 'imp'
Product: [oVirt] vdsm Reporter: Gal Zaidman <gzaidman>
Component: GeneralAssignee: Marcin Sobczyk <msobczyk>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Matyáš <pmatyas>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.30.0CC: bugs, dholler, gzaidman, lleistne, mperina, msobczyk, mtessun
Target Milestone: ovirt-4.4.0Flags: mtessun: ovirt-4.4?
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-20 20:02:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Gal Zaidman 2019-01-06 07:30:06 UTC
python 3.1 introduced a new module called importlib.

imp is deprecated since 3.4.

Also some parts of importlib will be deprecated in 3.6. See:

https://docs.python.org/3.6/library/importlib.html
http://stackoverflow.com/questions/35288021/what-is-the-equivalent-of-imp-find-module-in-importlib

Comment 1 Dominik Holler 2019-01-08 09:00:02 UTC
In [1] I understand that some methods, but not the whole importlib are deprecated.
In VDSM I found some references to importlib.import_module, which seems to be not deprecated.

Gal, can you please help me to understand which calls should be removed from VDSM?

[1]
  https://docs.python.org/3.6/library/importlib.html

Comment 2 Gal Zaidman 2019-01-08 09:19:15 UTC
maybe I wasn't clear in the description of the bug :)

the use of importlib is ok, the problem is that some parts of VDSM are using imp which is pending deprecation in favor of importlib.
as you can see in: https://docs.python.org/3/library/imp.html

a search in vdsm will show you that the following code still uses imp:
lib/sos/vdsm.py.in
static/usr/bin/vdsm-tool
tests/bridge_test

I notice it while I was working on packaging sos,
probably because I once wrote a similar patch for otopi: https://gerrit.ovirt.org/#/c/91908/

Comment 3 Dan Kenigsberg 2019-03-07 20:49:00 UTC
None of the occurrences of "imp" is related to network, moving to infra.

Comment 6 Lucie Leistnerova 2019-10-23 05:46:15 UTC
Verification is that vdsm-tool still works correctly.

Comment 7 Petr Matyáš 2020-03-11 12:18:56 UTC
Verified on vdsm-4.40.5-1.el8ev.x86_64

Comment 8 Sandro Bonazzola 2020-05-20 20:02:23 UTC
This bugzilla is included in oVirt 4.4.0 release, published on May 20th 2020.

Since the problem described in this bug report should be
resolved in oVirt 4.4.0 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.