Bug 1663661 - vdsm uses obsolete python module 'imp'
Summary: vdsm uses obsolete python module 'imp'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: General
Version: 4.30.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ovirt-4.4.0
: ---
Assignee: Marcin Sobczyk
QA Contact: Petr Matyáš
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-01-06 07:30 UTC by Gal Zaidman
Modified: 2020-05-20 20:02 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2020-05-20 20:02:23 UTC
oVirt Team: Infra
Embargoed:
mtessun: ovirt-4.4?


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 104117 0 'None' MERGED py3: tests: Port 'bridge_test' to py3 2020-03-26 14:55:30 UTC
oVirt gerrit 104139 0 'None' MERGED vdsm-tool: Drop support for 4.16 upgrade fix 2020-03-26 14:55:31 UTC
oVirt gerrit 104140 0 'None' MERGED vdsm-tool: Drop usage of 'imp' module 2020-03-26 14:55:33 UTC

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.


Note You need to log in before you can comment on or make changes to this bug.