Fix 1015. Remove non used paramiko dependencies at k8s_helm_conn 82/8582/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Tue, 11 Feb 2020 10:22:12 +0000 (10:22 +0000)
committerisraelad <adam.israel@canonical.com>
Tue, 11 Feb 2020 17:43:25 +0000 (18:43 +0100)
Change-Id: Id5c6333fb7feac8dce85f87641676771f346d062
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
(cherry picked from commit 68eb809576112cf59add5f62f87e99b07c3ac17a)

n2vc/k8s_helm_conn.py

index aca528e..7ad1166 100644 (file)
@@ -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):