Remove unsecure and unused function 03/11103/2
authorDavid Garcia <david.garcia@canonical.com>
Tue, 10 Aug 2021 15:50:21 +0000 (17:50 +0200)
committerDavid Garcia <david.garcia@canonical.com>
Wed, 11 Aug 2021 09:46:49 +0000 (11:46 +0200)
Fixes this critical vulnerability:
  https://osm.etsi.org/gitlab/osm/n2vc/-/security/vulnerabilities/948

Change-Id: If3ab88575028808855f2e068c816fccd8be6cb88
Signed-off-by: David Garcia <david.garcia@canonical.com>
n2vc/k8s_helm_base_conn.py

index 4a43ee2..89f6199 100644 (file)
@@ -26,7 +26,6 @@ import time
 import shlex
 import shutil
 import stat
-import subprocess
 import os
 import yaml
 from uuid import uuid4
@@ -1142,22 +1141,6 @@ class K8sHelmBaseConnector(K8sConnector):
                 new_list.append(new_dict)
         return new_list
 
-    def _local_exec(self, command: str) -> (str, int):
-        command = self._remove_multiple_spaces(command)
-        self.log.debug("Executing sync local command: {}".format(command))
-        # raise exception if fails
-        output = ""
-        try:
-            output = subprocess.check_output(
-                command, shell=True, universal_newlines=True
-            )
-            return_code = 0
-            self.log.debug(output)
-        except Exception:
-            return_code = 1
-
-        return output, return_code
-
     async def _local_async_exec(
         self,
         command: str,