From 31dd675356efa4822c2f0b5ddb91672f0e315a7c Mon Sep 17 00:00:00 2001 From: tierno Date: Fri, 17 Jul 2020 11:47:32 +0000 Subject: [PATCH] 1156 fix path obtained for k8s_helm_conn cluster minor change at /k8s_juju_conn.py Change-Id: I1e7f4910bc726d5a693ce50f45798a2fc8363a96 Signed-off-by: tierno --- n2vc/k8s_helm_conn.py | 6 ++++-- n2vc/k8s_juju_conn.py | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/n2vc/k8s_helm_conn.py b/n2vc/k8s_helm_conn.py index e3b51ba..ad9d9d0 100644 --- a/n2vc/k8s_helm_conn.py +++ b/n2vc/k8s_helm_conn.py @@ -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( diff --git a/n2vc/k8s_juju_conn.py b/n2vc/k8s_juju_conn.py index 1de44cd..8cdf388 100644 --- a/n2vc/k8s_juju_conn.py +++ b/n2vc/k8s_juju_conn.py @@ -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( -- 2.25.1