From: tierno Date: Tue, 11 Feb 2020 10:22:12 +0000 (+0000) Subject: Fix 1015. Remove non used paramiko dependencies at k8s_helm_conn X-Git-Tag: v7.1.0rc1~23 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=c90126db097a329610516115b7077a6de316f349;ds=sidebyside Fix 1015. Remove non used paramiko dependencies at k8s_helm_conn Change-Id: Id5c6333fb7feac8dce85f87641676771f346d062 Signed-off-by: tierno (cherry picked from commit 68eb809576112cf59add5f62f87e99b07c3ac17a) --- diff --git a/n2vc/k8s_helm_conn.py b/n2vc/k8s_helm_conn.py index aca528e..7ad1166 100644 --- a/n2vc/k8s_helm_conn.py +++ b/n2vc/k8s_helm_conn.py @@ -20,7 +20,6 @@ # contact with: nfvlabs@tid.es ## -import paramiko import subprocess import os import shutil @@ -1132,34 +1131,6 @@ class K8sHelmConnector(K8sConnector): else: return '', -1 - def _remote_exec( - self, - hostname: str, - username: str, - password: str, - command: str, - timeout: int = 10 - ) -> (str, int): - - command = K8sHelmConnector._remove_multiple_spaces(command) - self.debug('Executing sync remote ssh command: {}'.format(command)) - - ssh = paramiko.SSHClient() - ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) - ssh.connect(hostname=hostname, username=username, password=password) - ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(command=command, timeout=timeout) - output = ssh_stdout.read().decode('utf-8') - error = ssh_stderr.read().decode('utf-8') - if error: - self.error('ERROR: {}'.format(error)) - return_code = 1 - else: - return_code = 0 - output = output.replace('\\n', '\n') - self.debug('OUTPUT: {}'.format(output)) - - return output, return_code - def _check_file_exists(self, filename: str, exception_if_not_exists: bool = False): self.debug('Checking if file {} exists...'.format(filename)) if os.path.exists(filename):