From 8993a6a099e98f5cc12db0b676cb9695120fb2b7 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Wed, 30 Oct 2019 10:50:25 -0500 Subject: [PATCH] Fix up nfv tox targets for python3 basepython for tox.ini in nfv is not specified so it varies when running on different zuul machines. This fixes bandit (which is not enabled in zuul) to use alternative path declaration for excluded folders. See: https://github.com/PyCQA/bandit/issues/400 This fixes pylint when run in python3 since the suppression syntax is different in both versions (pylint: disable) vs (pylint disable) https://github.com/PyCQA/pylint/issues/986 This fixes a stricter check that was introduced by pylint 2.4.3 (released Oct 19, 2019) related to abs.abstractproperty https://github.com/PyCQA/pylint/issues/3150 Change-Id: I3718229d6d0e6074cf10347e6c6cb40fb26c25db Signed-off-by: Al Bailey --- nfv/nfv-vim/nfv_vim/nfvi/api/v1/_nfvi_sw_mgmt_api.py | 8 ++++---- nfv/pylint.rc | 3 ++- nfv/tox.ini | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/nfv/nfv-vim/nfv_vim/nfvi/api/v1/_nfvi_sw_mgmt_api.py b/nfv/nfv-vim/nfv_vim/nfvi/api/v1/_nfvi_sw_mgmt_api.py index 8714625a..ec412fad 100755 --- a/nfv/nfv-vim/nfv_vim/nfvi/api/v1/_nfvi_sw_mgmt_api.py +++ b/nfv/nfv-vim/nfv_vim/nfvi/api/v1/_nfvi_sw_mgmt_api.py @@ -40,28 +40,28 @@ class NFVISwMgmtAPI(object): """ pass - @abc.abstractproperty + @abc.abstractmethod def query_updates(self, future, callback): """ Query software updates using the plugin """ pass - @abc.abstractproperty + @abc.abstractmethod def query_hosts(self, future, callback): """ Query hosts using the plugin """ pass - @abc.abstractproperty + @abc.abstractmethod def update_host(self, future, host_name, callback): """ Apply a software update to a host using the plugin """ pass - @abc.abstractproperty + @abc.abstractmethod def update_hosts(self, future, host_names, callback): """ Apply a software update to a list of hosts using the plugin diff --git a/nfv/pylint.rc b/nfv/pylint.rc index 881e9ce3..c53c6897 100755 --- a/nfv/pylint.rc +++ b/nfv/pylint.rc @@ -46,7 +46,8 @@ load-plugins= # W0706: The except handler raises immediately (try-except-raise) # W1401 anomalous-backslash-in-string # W1505: Using deprecated method getargspec() (deprecated-method) -disable=C, R, W0120, W0125, W0212, W0221, W0223, W0231, W0235, +# E0012: pylint for python3 does not support inline deprecation +disable=C, R, E0012, W0120, W0125, W0212, W0221, W0223, W0231, W0235, W0401, W0404, W0511, W0603, W0612, W0613, W0621, W0622, W0703, W1401, W0107, W0706, W1505 diff --git a/nfv/tox.ini b/nfv/tox.ini index 62c5a52f..a63f4054 100644 --- a/nfv/tox.ini +++ b/nfv/tox.ini @@ -114,7 +114,8 @@ commands = pylint {[nfv]nfv_client_src_dir} \ # B310: Audit url open for permitted schemes # B506: Test for use of yaml load skips = B104,B108,B110,B310,B506 -exclude = nfv-docs,nfv-tests,nfv-debug-tools,unit_test +exclude = ./nfv-docs,./nfv-tests,./nfv-debug-tools,unit_test + [testenv:bandit] deps = {[nfv]deps}