diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2016-11-16 10:54:23 +0100 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2016-11-16 16:46:11 +0100 |
commit | 03d40b81352f1f9de985f2cf598ac6c18be13b69 (patch) | |
tree | 69e822dacd399486130b55487d2e3b982e33f38a | |
parent | 1b9ae8e0b83cf0372d3812b5a5c67fb3bf5841c7 (diff) |
Move installer adapters to the new modules directory
JIRA: RELENG-149
JIRA: RELENG-161
Now that we have a modules directory in place, let's
move all the shared python code to this location.
We need to create a setup.py to install these
modules in the system so that we don't have to
modify the pythonpath.
Change-Id: I7e608ce6e1e6b3d111405bc789cdb2ff7fcb49c3
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
-rw-r--r-- | modules/README.rst (renamed from modules/Readme.txt) | 4 | ||||
-rw-r--r-- | modules/opnfv/__init__.py (renamed from utils/installer-adapter/__init__.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/InstallerHandler.py (renamed from utils/installer-adapter/InstallerHandler.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/__init__.py (renamed from modules/__init.py__) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/apex/ApexAdapter.py (renamed from utils/installer-adapter/ApexAdapter.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/apex/__init__.py (renamed from modules/installer_adapters/__init.py__) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/compass/CompassAdapter.py (renamed from utils/installer-adapter/CompassAdapter.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/compass/__init__.py (renamed from modules/utils/__init.py__) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/fuel/FuelAdapter.py (renamed from utils/installer-adapter/FuelAdapter.py) | 6 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/fuel/__init__.py | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/fuel/example.py (renamed from utils/installer-adapter/example.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/joid/JoidAdapter.py (renamed from utils/installer-adapter/JoidAdapter.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/installer_adapters/joid/__init__.py | 0 | ||||
-rw-r--r-- | modules/opnfv/utils/OPNFVLogger.py (renamed from utils/installer-adapter/RelengLogger.py) | 0 | ||||
-rw-r--r-- | modules/opnfv/utils/SSHUtils.py (renamed from utils/installer-adapter/SSHUtils.py) | 5 | ||||
-rw-r--r-- | modules/opnfv/utils/__init__.py | 0 |
16 files changed, 8 insertions, 7 deletions
diff --git a/modules/Readme.txt b/modules/README.rst index 32becc21e..7c91eca5a 100644 --- a/modules/Readme.txt +++ b/modules/README.rst @@ -3,8 +3,8 @@ This directory may be used to add new tools that might be useful for any project in OPNFV. This tools must be python based and shall be imported as follows: - from releng.modules.utils import SSHUtils - from releng.modules.utils import RelengLogger + from opnfv.utils import SSHUtils + from opnfv.utils import RelengLogger ... For further information about how to use this modules directory, contact: diff --git a/utils/installer-adapter/__init__.py b/modules/opnfv/__init__.py index e69de29bb..e69de29bb 100644 --- a/utils/installer-adapter/__init__.py +++ b/modules/opnfv/__init__.py diff --git a/utils/installer-adapter/InstallerHandler.py b/modules/opnfv/installer_adapters/InstallerHandler.py index b81b806ca..b81b806ca 100644 --- a/utils/installer-adapter/InstallerHandler.py +++ b/modules/opnfv/installer_adapters/InstallerHandler.py diff --git a/modules/__init.py__ b/modules/opnfv/installer_adapters/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/__init.py__ +++ b/modules/opnfv/installer_adapters/__init__.py diff --git a/utils/installer-adapter/ApexAdapter.py b/modules/opnfv/installer_adapters/apex/ApexAdapter.py index 17a27b10a..17a27b10a 100644 --- a/utils/installer-adapter/ApexAdapter.py +++ b/modules/opnfv/installer_adapters/apex/ApexAdapter.py diff --git a/modules/installer_adapters/__init.py__ b/modules/opnfv/installer_adapters/apex/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/installer_adapters/__init.py__ +++ b/modules/opnfv/installer_adapters/apex/__init__.py diff --git a/utils/installer-adapter/CompassAdapter.py b/modules/opnfv/installer_adapters/compass/CompassAdapter.py index 47cbc646d..47cbc646d 100644 --- a/utils/installer-adapter/CompassAdapter.py +++ b/modules/opnfv/installer_adapters/compass/CompassAdapter.py diff --git a/modules/utils/__init.py__ b/modules/opnfv/installer_adapters/compass/__init__.py index e69de29bb..e69de29bb 100644 --- a/modules/utils/__init.py__ +++ b/modules/opnfv/installer_adapters/compass/__init__.py diff --git a/utils/installer-adapter/FuelAdapter.py b/modules/opnfv/installer_adapters/fuel/FuelAdapter.py index 672fd5175..95b2ab673 100644 --- a/utils/installer-adapter/FuelAdapter.py +++ b/modules/opnfv/installer_adapters/fuel/FuelAdapter.py @@ -8,8 +8,8 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -import SSHUtils as ssh_utils -import RelengLogger as rl +import opnfv.modules.utils.SSHUtils as ssh_utils +import opnfv.modules.utils.OPNFVLogger as logger class FuelAdapter: @@ -22,7 +22,7 @@ class FuelAdapter: installer_ip, self.installer_user, password=self.installer_password) - self.logger = rl.Logger("Handler").getLogger() + self.logger = logger.Logger("FuelHandler").getLogger() def runcmd_fuel_installer(self, cmd): _, stdout, stderr = (self diff --git a/modules/opnfv/installer_adapters/fuel/__init__.py b/modules/opnfv/installer_adapters/fuel/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/opnfv/installer_adapters/fuel/__init__.py diff --git a/utils/installer-adapter/example.py b/modules/opnfv/installer_adapters/fuel/example.py index 804d79c3d..804d79c3d 100644 --- a/utils/installer-adapter/example.py +++ b/modules/opnfv/installer_adapters/fuel/example.py diff --git a/utils/installer-adapter/JoidAdapter.py b/modules/opnfv/installer_adapters/joid/JoidAdapter.py index be8c2ebac..be8c2ebac 100644 --- a/utils/installer-adapter/JoidAdapter.py +++ b/modules/opnfv/installer_adapters/joid/JoidAdapter.py diff --git a/modules/opnfv/installer_adapters/joid/__init__.py b/modules/opnfv/installer_adapters/joid/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/opnfv/installer_adapters/joid/__init__.py diff --git a/utils/installer-adapter/RelengLogger.py b/modules/opnfv/utils/OPNFVLogger.py index 6fa4ef2e2..6fa4ef2e2 100644 --- a/utils/installer-adapter/RelengLogger.py +++ b/modules/opnfv/utils/OPNFVLogger.py diff --git a/utils/installer-adapter/SSHUtils.py b/modules/opnfv/utils/SSHUtils.py index c93888694..2f48addbf 100644 --- a/utils/installer-adapter/SSHUtils.py +++ b/modules/opnfv/utils/SSHUtils.py @@ -10,10 +10,10 @@ import paramiko -import RelengLogger as rl +import opnfv.modules.utils.OPNFVLogger as OPNFVLogger import os -logger = rl.Logger('SSHUtils').getLogger() +logger = OPNFVLogger.Logger('SSHUtils').getLogger() def get_ssh_client(hostname, username, password=None, jumphost=None): @@ -66,6 +66,7 @@ class JumpHostHopClient(paramiko.SSHClient): ''' Connect to a remote server using a jumphost hop ''' + def __init__(self, *args, **kwargs): self.logger = rl.Logger("JumpHostHopClient").getLogger() self.jumphost_ssh = None diff --git a/modules/opnfv/utils/__init__.py b/modules/opnfv/utils/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/modules/opnfv/utils/__init__.py |