[ovirt-devel] [VDSM] User facing warnings because of warnings in vdscli.py
Nir Soffer
nsoffer at redhat.com
Sun Sep 18 12:20:12 UTC 2016
Hi all,
Since [0], any program importing vdscli issues a user facing
warnings - for example:
$ vdsClient -s 0 getVdsCaps
client/vdsClient.py:35: DeprecationWarning: vdscli uses xmlrpc. since ovirt
3.6 xmlrpc is deprecated, please use vdsm.jsonrpcvdscli
from vdsm import utils, vdscli, constants
...
This is *not* the purpose of Python's warnings. They are for
developers, not users.
Unfortunately, we configured the warnings filter in vdscli,
so the application importing this module cannot control
warnings.
This cause unwanted warnings in vdsClient, hosted-engine
and any other program importing this module.
See bug [1].
Lately we decided to remove the warnings module from vdsm,
as it is leaking memory - one instance of each warning is
kept in a dict even if you configure warning to ignore all
warnings.
Francesco sent patch [2], replacing the warning with
log message to the "devel" logger. This fixes the issue
in vdsm, but does not solve the issue for other tools.
I sent this patch [3] for vdsClient, but we still need a fix
for vdsm-tool, hosted-engine, and any other program importing
this library.
So it seems that using a special logger for deprecation
warnings is not a good solution for library like vdscli,
and we should keep the warning module for this
purpose.
I sent also this minimal patch [4] that can be easily
backported to 4.0.
Please review, we should fix this regression quickly.
[0] https://gerrit.ovirt.org/61187
[1] https://bugzilla.redhat.com/1377069
[2] https://gerrit.ovirt.org/62209
[3] https://gerrit.ovirt.org/64099
[4] https://gerrit.ovirt.org/64100
Thanks,
Nir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20160918/0242c60f/attachment-0001.html>
More information about the Devel
mailing list