From: limon Date: Thu, 21 Jul 2022 11:19:44 +0000 (+0200) Subject: Bug 2122 fixed: used cluster_id instead of cluster_uuid in repo_add.reverse_sync X-Git-Tag: v10.1.2~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F98%2F12398%2F5;p=osm%2FN2VC.git Bug 2122 fixed: used cluster_id instead of cluster_uuid in repo_add.reverse_sync Change-Id: I8185a892a2db23bdeecee3a826af9414b8f8a2f0 Signed-off-by: limon --- diff --git a/n2vc/k8s_helm_base_conn.py b/n2vc/k8s_helm_base_conn.py index 82ae067..d2de810 100644 --- a/n2vc/k8s_helm_base_conn.py +++ b/n2vc/k8s_helm_base_conn.py @@ -186,22 +186,20 @@ class K8sHelmBaseConnector(K8sConnector): ) # sync fs - self.fs.reverse_sync(from_path=cluster_uuid) + self.fs.reverse_sync(from_path=cluster_id) - async def repo_update(self, cluster_uuid: str, name: str, repo_type: str = "chart"): + async def repo_update(self, cluster_id: str, name: str, repo_type: str = "chart"): self.log.debug( - "Cluster {}, updating {} repository {}".format( - cluster_uuid, repo_type, name - ) + "Cluster {}, updating {} repository {}".format(cluster_id, repo_type, name) ) # init_env paths, env = self._init_paths_env( - cluster_name=cluster_uuid, create_if_not_exist=True + cluster_name=cluster_id, create_if_not_exist=True ) # sync local dir - self.fs.sync(from_path=cluster_uuid) + self.fs.sync(from_path=cluster_id) # helm repo update command = "{} repo update {}".format(self._helm_command, name) @@ -211,7 +209,7 @@ class K8sHelmBaseConnector(K8sConnector): ) # sync fs - self.fs.reverse_sync(from_path=cluster_uuid) + self.fs.reverse_sync(from_path=cluster_id) async def repo_list(self, cluster_uuid: str) -> list: """ @@ -492,7 +490,7 @@ class K8sHelmBaseConnector(K8sConnector): repo = self._split_repo(kdu_model) if repo: - self.repo_update(cluster_uuid, repo) + self.repo_update(cluster_id, repo) command = self._get_upgrade_command( kdu_model, diff --git a/n2vc/tests/unit/test_k8s_helm3_conn.py b/n2vc/tests/unit/test_k8s_helm3_conn.py index 40f3820..e32e56e 100644 --- a/n2vc/tests/unit/test_k8s_helm3_conn.py +++ b/n2vc/tests/unit/test_k8s_helm3_conn.py @@ -92,7 +92,7 @@ class TestK8sHelm3Conn(asynctest.TestCase): self.helm_conn.fs.sync.assert_called_once_with(from_path=self.cluster_id) self.helm_conn.fs.reverse_sync.assert_called_once_with( - from_path=self.cluster_uuid + from_path=self.cluster_id ) self.assertEqual( self.helm_conn._local_async_exec.call_count, diff --git a/n2vc/tests/unit/test_k8s_helm_conn.py b/n2vc/tests/unit/test_k8s_helm_conn.py index 5e36938..8a0c1ea 100644 --- a/n2vc/tests/unit/test_k8s_helm_conn.py +++ b/n2vc/tests/unit/test_k8s_helm_conn.py @@ -69,7 +69,7 @@ class TestK8sHelmConn(asynctest.TestCase): self.helm_conn.fs.sync.assert_called_once_with(from_path=self.cluster_id) self.helm_conn.fs.reverse_sync.assert_called_once_with( - from_path=self.cluster_uuid + from_path=self.cluster_id ) self.assertEqual( self.helm_conn._local_async_exec.call_count,