On Fri, Dec 7, 2018 at 11:01 AM Nir Soffer <nsoffer@redhat.com> wrote:
On Fri, Dec 7, 2018, 10:34 Richard W.M. Jones <rjones@redhat.com wrote:
On Fri, Dec 07, 2018 at 02:44:21AM +0200, Nir Soffer wrote:
> Fix rhv-cafile option access, broken by commit 6694028f9827 (v2v: -o
> rhv-upload: Only set SSL context for https connections).

Ugh yes indeed.  Strong typing FTW _again_

"pylint -E" may detect such issues.

pylint detected this error, and some other:

$ pylint -E v2v
************* Module rhv-upload-plugin
v2v/rhv-upload-plugin.py:213:48: E0602: Undefined variable 'cafile' (undefined-variable)
v2v/rhv-upload-plugin.py:343:8: E1137: 'headers' does not support item assignment (unsupported-assignment-operation)
v2v/rhv-upload-plugin.py:436:22: E0602: Undefined variable 'buffer' (undefined-variable)
************* Module test-v2v-o-rhv-upload-module.ovirtsdk4.types
v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/types.py:22:0: E0611: No name 'imageio_port' in module 'ovirtsdk4' (no-name-in-module)
************* Module test-v2v-o-rhv-upload-module.ovirtsdk4
v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py:66:15: E0602: Undefined variable 'types' (undefined-variable)
v2v/test-v2v-o-rhv-upload-module/ovirtsdk4/__init__.py:86:19: E0602: Undefined variable 'types' (undefined-variable)

pylint is usually too old on RHEL and even Fedora, so the best way to install it is
using virtualenv.

Here is an example how to build isolated virtual python environment with latest pylint:

$ python3 -m venv venv
$ source venv/bin/activate
$ pip install -U pip
$ PYCURL_SSL_LIBRARY=openssl pip install --compile pycurl
$ pip install ovirt-engine-sdk-python pylint

Nir