Coverity-CWE 330: Use of Insufficiently Random Values
[osm/N2VC.git] / n2vc / k8s_helm_conn.py
index 0ea8920..bbe4c48 100644 (file)
@@ -78,12 +78,9 @@ class K8sHelmConnector(K8sHelmBaseConnector):
             else "--skip-repos",
         )
         try:
-            asyncio.ensure_future(
+            asyncio.create_task(
                 self._local_async_exec(command=command, raise_exception_on_error=False)
             )
-            # loop = asyncio.get_event_loop()
-            # loop.run_until_complete(self._local_async_exec(command=command,
-            # raise_exception_on_error=False))
         except Exception as e:
             self.warning(
                 msg="helm init failed (it was already initialized): {}".format(e)
@@ -164,7 +161,6 @@ class K8sHelmConnector(K8sHelmBaseConnector):
         return True
 
     async def inspect_kdu(self, kdu_model: str, repo_url: str = None) -> str:
-
         self.log.debug(
             "inspect kdu_model {} from (optional) repo: {}".format(kdu_model, repo_url)
         )
@@ -235,7 +231,6 @@ class K8sHelmConnector(K8sHelmBaseConnector):
         return paths, env
 
     async def _get_services(self, cluster_id, kdu_instance, namespace, kubeconfig):
-
         # init config, env
         paths, env = self._init_paths_env(
             cluster_name=cluster_id, create_if_not_exist=True
@@ -422,7 +417,6 @@ class K8sHelmConnector(K8sHelmBaseConnector):
             self.log.debug("namespace not found")
 
     async def _instances_list(self, cluster_id):
-
         # init paths, env
         paths, env = self._init_paths_env(
             cluster_name=cluster_id, create_if_not_exist=True
@@ -469,7 +463,6 @@ class K8sHelmConnector(K8sHelmBaseConnector):
         yaml_format: bool = False,
         show_error_log: bool = False,
     ) -> Union[str, dict]:
-
         self.log.debug(
             "status of kdu_instance: {}, namespace: {} ".format(kdu_instance, namespace)
         )
@@ -606,7 +599,6 @@ class K8sHelmConnector(K8sHelmBaseConnector):
         timeout,
         kubeconfig,
     ) -> str:
-
         timeout_str = ""
         if timeout:
             timeout_str = "--timeout {}".format(timeout)