From 8a12bf3b9202cfb02102c9f179dc2cc15be79a63 Mon Sep 17 00:00:00 2001 From: Luc Provoost Date: Fri, 16 Jul 2021 11:40:11 +0200 Subject: Using paramiko for all ssh & scp By using paramiko, we can now also use differnt credentials to login into the PROX instances. In the ssh section of the environment file, you can now also add the password parameter. Change-Id: I08d31cbf0d02d7e82b7fbe34268851f73ff5dde0 Signed-off-by: Luc Provoost --- VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py') diff --git a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py index d7d8fabc..eba71d96 100644 --- a/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py +++ b/VNFs/DPPD-PROX/helper-scripts/rapid/rapid_parser.py @@ -53,14 +53,21 @@ class RapidConfigParser(object): config = configparser.RawConfigParser() config.read(test_params['environment_file']) test_params['vim_type'] = config.get('Varia', 'vim') - test_params['key'] = config.get('ssh', 'key') test_params['user'] = config.get('ssh', 'user') - if test_params['user'] in ['rapid']: - if test_params['key'] != 'rapid_rsa_key': - RapidLog.debug(("Key file {} for user {} overruled by key file:" - " rapid_rsa_key").format(test_params['key'], - test_params['user'])) - test_params['key'] = 'rapid_rsa_key' + if config.has_option('ssh', 'key'): + test_params['key'] = config.get('ssh', 'key') + if test_params['user'] in ['rapid']: + if test_params['key'] != 'rapid_rsa_key': + RapidLog.debug(("Key file {} for user {} overruled by key file:" + " rapid_rsa_key").format(test_params['key'], + test_params['user'])) + test_params['key'] = 'rapid_rsa_key' + else: + test_params['key'] = None + if config.has_option('ssh', 'password'): + test_params['password'] = config.get('ssh', 'password') + else: + test_params['password'] = None test_params['total_number_of_machines'] = int(config.get('rapid', 'total_number_of_machines')) tests = [] -- cgit 1.2.3-korg