Change in vdsm[master]: build: enforce abs_import check

danken at redhat.com danken at redhat.com
Wed Feb 3 13:41:36 UTC 2016


Dan Kenigsberg has uploaded a new change for review.

Change subject: build: enforce abs_import check
......................................................................

build: enforce abs_import check

commit 2154bc8 defined a check for absolute imports in a limited
whitelist, but failed to actually run it in every `make check`.

This patch adds abs_import to check, and fixes a couple of files that
collected lint while the check was off. It also remove vdsm/network
directory, which is no longer with us.

Change-Id: I0b2e8340f39e2e6d90eb89bdb2ae78d8dfb7b8e9
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M Makefile.am
M lib/api/process-schema.py
M lib/api/vdsmapi.py
M lib/vdsm/commands.py
M lib/vdsm/cpuarch.py
M lib/vdsm/cpuinfo.py
M lib/vdsm/dmidecodeUtil.py
M lib/vdsm/hooks.py
M lib/vdsm/host.py
M lib/vdsm/jobs.py
M lib/vdsm/jsonrpcvdscli.py
M lib/vdsm/netinfo/mtus.py
M lib/vdsm/netinfo/qos.py
M lib/vdsm/network/canonize.py
M lib/vdsm/network/utils.py
M lib/vdsm/panic.py
M lib/vdsm/ppc64HardwareInfo.py
M lib/vdsm/sslcompat.py
M lib/vdsm/supervdsm.py
19 files changed, 39 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/50/53050/1

diff --git a/Makefile.am b/Makefile.am
index ddb94e2..b0ca738 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -63,7 +63,6 @@
 
 ABS_IMPORT_WHITELIST = \
 	lib \
-	vdsm/network \
 	$(NULL)
 
 WHITELIST = \
@@ -125,7 +124,7 @@
 	fi
 
 # Note: dependencies ordered by time needed to run them
-check-recursive: gitignore python3 pyflakes pep8
+check-recursive: gitignore abs_imports python3 pyflakes pep8
 
 .PHONY: check-all
 check-all:
diff --git a/lib/api/process-schema.py b/lib/api/process-schema.py
index 4b1c3cf..2f8704d 100755
--- a/lib/api/process-schema.py
+++ b/lib/api/process-schema.py
@@ -19,6 +19,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 import sys
 import re
 import vdsmapi
diff --git a/lib/api/vdsmapi.py b/lib/api/vdsmapi.py
index 2f13ef2..cc24af7 100644
--- a/lib/api/vdsmapi.py
+++ b/lib/api/vdsmapi.py
@@ -24,6 +24,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 import os
 
 try:
diff --git a/lib/vdsm/commands.py b/lib/vdsm/commands.py
index 5ab5b4d..5c80902 100644
--- a/lib/vdsm/commands.py
+++ b/lib/vdsm/commands.py
@@ -17,6 +17,8 @@
 #
 # Refer to the README and COPYING files for full details of the license
 #
+from __future__ import absolute_import
+
 from StringIO import StringIO
 from cpopen import CPopen
 
diff --git a/lib/vdsm/cpuarch.py b/lib/vdsm/cpuarch.py
index 8cd6a76..bbb1332 100644
--- a/lib/vdsm/cpuarch.py
+++ b/lib/vdsm/cpuarch.py
@@ -18,6 +18,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 import platform
 
 from .config import config
diff --git a/lib/vdsm/cpuinfo.py b/lib/vdsm/cpuinfo.py
index 6ba146d..59a279e 100644
--- a/lib/vdsm/cpuinfo.py
+++ b/lib/vdsm/cpuinfo.py
@@ -18,6 +18,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 from collections import namedtuple
 
 from . import utils
diff --git a/lib/vdsm/dmidecodeUtil.py b/lib/vdsm/dmidecodeUtil.py
index add2526..2367b9e 100644
--- a/lib/vdsm/dmidecodeUtil.py
+++ b/lib/vdsm/dmidecodeUtil.py
@@ -18,6 +18,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 from vdsm import utils
 
 
diff --git a/lib/vdsm/hooks.py b/lib/vdsm/hooks.py
index 4723b6d..67cb77d 100644
--- a/lib/vdsm/hooks.py
+++ b/lib/vdsm/hooks.py
@@ -19,6 +19,8 @@
 #
 
 from __future__ import print_function
+from __future__ import absolute_import
+
 import glob
 import hashlib
 import itertools
diff --git a/lib/vdsm/host.py b/lib/vdsm/host.py
index f5041d9..10b814f 100644
--- a/lib/vdsm/host.py
+++ b/lib/vdsm/host.py
@@ -17,6 +17,8 @@
 #
 # Refer to the README and COPYING files for full details of the license
 #
+from __future__ import absolute_import
+
 import os
 import logging
 from .commands import execCmd
diff --git a/lib/vdsm/jobs.py b/lib/vdsm/jobs.py
index 84e9691..232981c 100644
--- a/lib/vdsm/jobs.py
+++ b/lib/vdsm/jobs.py
@@ -17,6 +17,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 import logging
 import threading
 
diff --git a/lib/vdsm/jsonrpcvdscli.py b/lib/vdsm/jsonrpcvdscli.py
index 4941ca8..86d30ae 100644
--- a/lib/vdsm/jsonrpcvdscli.py
+++ b/lib/vdsm/jsonrpcvdscli.py
@@ -18,6 +18,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 from functools import partial
 from uuid import uuid4
 import socket
diff --git a/lib/vdsm/netinfo/mtus.py b/lib/vdsm/netinfo/mtus.py
index 7cb95d3..57d9350 100644
--- a/lib/vdsm/netinfo/mtus.py
+++ b/lib/vdsm/netinfo/mtus.py
@@ -17,6 +17,9 @@
 #
 # Refer to the README and COPYING files for full details of the license
 #
+
+from __future__ import absolute_import
+
 DEFAULT_MTU = 1500
 
 
diff --git a/lib/vdsm/netinfo/qos.py b/lib/vdsm/netinfo/qos.py
index 1cb4bbb..7741118 100644
--- a/lib/vdsm/netinfo/qos.py
+++ b/lib/vdsm/netinfo/qos.py
@@ -17,6 +17,8 @@
 #
 # Refer to the README and COPYING files for full details of the license
 
+from __future__ import absolute_import
+
 from collections import defaultdict
 
 from vdsm import tc
diff --git a/lib/vdsm/network/canonize.py b/lib/vdsm/network/canonize.py
index 81baebc..e83158f 100644
--- a/lib/vdsm/network/canonize.py
+++ b/lib/vdsm/network/canonize.py
@@ -17,6 +17,7 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
 
 import six
 
diff --git a/lib/vdsm/network/utils.py b/lib/vdsm/network/utils.py
index 370d82e..4bb5e50 100644
--- a/lib/vdsm/network/utils.py
+++ b/lib/vdsm/network/utils.py
@@ -17,6 +17,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 
 def remove_custom_bond_option(options):
     """ Removes 'custom' option from bond options string.
diff --git a/lib/vdsm/panic.py b/lib/vdsm/panic.py
index 734e503..3f0766c 100644
--- a/lib/vdsm/panic.py
+++ b/lib/vdsm/panic.py
@@ -16,6 +16,9 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA
 #
 # Refer to the README and COPYING files for full details of the license
+
+from __future__ import absolute_import
+
 import logging
 import os
 import sys
diff --git a/lib/vdsm/ppc64HardwareInfo.py b/lib/vdsm/ppc64HardwareInfo.py
index 6db182d..f629851 100644
--- a/lib/vdsm/ppc64HardwareInfo.py
+++ b/lib/vdsm/ppc64HardwareInfo.py
@@ -16,6 +16,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 from vdsm import utils
 
 import os
diff --git a/lib/vdsm/sslcompat.py b/lib/vdsm/sslcompat.py
index a1af618..63489f5 100644
--- a/lib/vdsm/sslcompat.py
+++ b/lib/vdsm/sslcompat.py
@@ -17,6 +17,9 @@
 #
 # Refer to the README and COPYING files for full details of the license
 #
+
+from __future__ import absolute_import
+
 from .config import config
 
 if config.get('vars', 'ssl_implementation') == 'm2c':
diff --git a/lib/vdsm/supervdsm.py b/lib/vdsm/supervdsm.py
index ff6ce9c..91ddfe0 100644
--- a/lib/vdsm/supervdsm.py
+++ b/lib/vdsm/supervdsm.py
@@ -19,6 +19,8 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
+from __future__ import absolute_import
+
 import os
 from multiprocessing.managers import BaseManager, RemoteError
 import logging


-- 
To view, visit https://gerrit.ovirt.org/53050
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b2e8340f39e2e6d90eb89bdb2ae78d8dfb7b8e9
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list