1156 fix path obtained for k8s_helm_conn cluster 09/9609/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 17 Jul 2020 11:47:32 +0000 (11:47 +0000)
committerDavid Garcia <david.garcia@canonical.com>
Thu, 20 Aug 2020 09:47:32 +0000 (11:47 +0200)
minor change at /k8s_juju_conn.py

Change-Id: I1e7f4910bc726d5a693ce50f45798a2fc8363a96
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
n2vc/k8s_helm_conn.py
n2vc/k8s_juju_conn.py

index e3b51ba..ad9d9d0 100644 (file)
@@ -837,6 +837,7 @@ class K8sHelmConnector(K8sConnector):
                            kdu_instance: str,
                            namespace: str) -> list:
 
+        _, cluster_id = self._get_namespace_cluster_id(cluster_uuid)
         self.log.debug(
             "get_services: cluster_uuid: {}, kdu_instance: {}".format(
                 cluster_uuid, kdu_instance
@@ -844,7 +845,7 @@ class K8sHelmConnector(K8sConnector):
         )
 
         status = await self._status_kdu(
-            cluster_uuid, kdu_instance, return_text=False
+            cluster_id, kdu_instance, return_text=False
         )
 
         service_names = self._parse_helm_status_service_info(status)
@@ -866,8 +867,9 @@ class K8sHelmConnector(K8sConnector):
         )
 
         # get paths
+        _, cluster_id = self._get_namespace_cluster_id(cluster_uuid)
         _kube_dir, helm_dir, config_filename, _cluster_dir = self._get_paths(
-            cluster_name=cluster_uuid, create_if_not_exist=True
+            cluster_name=cluster_id, create_if_not_exist=True
         )
 
         command = "{} --kubeconfig={} --namespace={} get service {} -o=yaml".format(
index 1de44cd..8cdf388 100644 (file)
@@ -758,6 +758,7 @@ class K8sJujuConnector(K8sConnector):
         self.log.debug(
             "Adding model '{}' to cluster_uuid '{}'".format(model_name, cluster_uuid)
         )
+        model = None
         try:
             if self.juju_public_key is not None:
                 model = await self.controller.add_model(