summaryrefslogtreecommitdiffstats
path: root/modules/opnfv/utils
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-09-25 00:18:36 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-09-26 02:26:34 +0200
commitf28386431c4ecbc9c7bee24b60eb9f4371ca3c63 (patch)
tree5eb6dbd381bf4a4855ad19fc49c1df98b62c44df /modules/opnfv/utils
parent133e35d5d89e48e46d3e5818a9e70dac84827334 (diff)
modules.opnfv: fuel adapter: Switch to MCP
The current codebase was intended for Fuel@OPNFV up to and including the Danube release (based on Fuel@Openstack). Starting with the Euphrates release, Fuel@OPNFV is based on Mirantis Cloud Platform (MCP), so the Fuel adapter in modules.opnfv needs a rework to accomodate the new platform: - remove unused obsolete code in opnfv.utils; - switch to key-based SSH auth instead of password-based; - drop proxy-ing SSH to cluster nodes via installer node, instead SSH directly via PXE/admin network; Notes: - MaaS node (when present) is marked with 'installer' role to prevent ovs-vsctl queries on it; - gtw01 node (when present) is not marked with any role yet; JIRA: FUEL-394 Change-Id: If2b7744b950cd502df8eaca0137c9f845a9d077d Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'modules/opnfv/utils')
-rw-r--r--modules/opnfv/utils/Credentials.py11
-rw-r--r--modules/opnfv/utils/ssh_utils.py3
2 files changed, 5 insertions, 9 deletions
diff --git a/modules/opnfv/utils/Credentials.py b/modules/opnfv/utils/Credentials.py
index 141ecbd93..193a10aac 100644
--- a/modules/opnfv/utils/Credentials.py
+++ b/modules/opnfv/utils/Credentials.py
@@ -7,9 +7,9 @@
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
-# Usage example:
+# Usage example (note: Fuel actually uses key-based auth, not user/pass):
# from opnfv.utils.Credentials import Credentials as credentials
-# credentials("fuel", "10.20.0.2", "root", "r00tme").fetch('./openrc')
+# credentials("fuel", "10.20.0.2", "user", "password").fetch('./openrc')
#
import os
@@ -74,12 +74,7 @@ class Credentials(object):
pass
def __fetch_creds_fuel(self, target_path):
- creds_file = '/root/openrc'
- try:
- self.handler.get_file_from_controller(creds_file, target_path)
- except Exception as e:
- self.logger.error(
- "Cannot get %s from controller. %e" % (creds_file, e))
+ # TODO
pass
def __fetch_creds_joid(self, target_path):
diff --git a/modules/opnfv/utils/ssh_utils.py b/modules/opnfv/utils/ssh_utils.py
index 175a38078..22727170b 100644
--- a/modules/opnfv/utils/ssh_utils.py
+++ b/modules/opnfv/utils/ssh_utils.py
@@ -49,10 +49,11 @@ def get_ssh_client(hostname,
client = paramiko.SSHClient()
else:
client = ProxyHopClient()
+ proxy_password = proxy.get('password', None)
proxy_pkey_file = proxy.get('pkey_file', '/root/.ssh/id_rsa')
client.configure_jump_host(proxy['ip'],
proxy['username'],
- proxy['password'],
+ proxy_password,
proxy_pkey_file)
if client is None:
raise Exception('Could not connect to client')