Read environment variables in Constants.py
[csit.git] / resources / libraries / python / PapiExecutor.py
index 4e4e082..74ff7a0 100644 (file)
@@ -166,8 +166,8 @@ class PapiSocketExecutor(object):
         if self.vpp_instance:
             return
         cls = self.__class__  # Shorthand for setting class fields.
-        tmp_dir = tempfile.mkdtemp(dir="/tmp")
         package_path = None
+        tmp_dir = tempfile.mkdtemp(dir="/tmp")
         try:
             # Pack, copy and unpack Python part of VPP installation from _node.
             # TODO: Use rsync or recursive version of ssh.scp_node instead?
@@ -193,6 +193,7 @@ class PapiSocketExecutor(object):
             # Package path has to be one level above the vpp_papi directory.
             package_path = package_path.rsplit('/', 1)[0]
             sys.path.append(package_path)
+            # pylint: disable=import-error
             from vpp_papi.vpp_papi import VPPApiClient as vpp_class
             vpp_class.apidir = api_json_directory
             # We need to create instance before removing from sys.path.