projects
/
osm
/
N2VC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 1962 fixed: removed the variable cluster_uuid from init_env method
[osm/N2VC.git]
/
n2vc
/
k8s_helm_conn.py
diff --git
a/n2vc/k8s_helm_conn.py
b/n2vc/k8s_helm_conn.py
index
5a788e9
..
b11ddd0
100644
(file)
--- a/
n2vc/k8s_helm_conn.py
+++ b/
n2vc/k8s_helm_conn.py
@@
-131,19
+131,18
@@
class K8sHelmConnector(K8sHelmBaseConnector):
:param kwargs: Additional parameters (None yet)
:return: True if successful
"""
:param kwargs: Additional parameters (None yet)
:return: True if successful
"""
- _, cluster_id = self._get_namespace_cluster_id(cluster_uuid)
- self.log.debug("installing {} in cluster {}".format(kdu_model, cluster_id))
+ self.log.debug("installing {} in cluster {}".format(kdu_model, cluster_uuid))
# sync local dir
# sync local dir
- self.fs.sync(from_path=cluster_id)
+ self.fs.sync(from_path=cluster_
uu
id)
# init env, paths
paths, env = self._init_paths_env(
# init env, paths
paths, env = self._init_paths_env(
- cluster_name=cluster_id, create_if_not_exist=True
+ cluster_name=cluster_
uu
id, create_if_not_exist=True
)
await self._install_impl(
)
await self._install_impl(
- cluster_id,
+ cluster_
uu
id,
kdu_model,
paths,
env,
kdu_model,
paths,
env,
@@
-157,7
+156,7
@@
class K8sHelmConnector(K8sHelmBaseConnector):
)
# sync fs
)
# sync fs
- self.fs.reverse_sync(from_path=cluster_id)
+ self.fs.reverse_sync(from_path=cluster_
uu
id)
self.log.debug("Returning kdu_instance {}".format(kdu_instance))
return True
self.log.debug("Returning kdu_instance {}".format(kdu_instance))
return True
@@
-342,15
+341,13
@@
class K8sHelmConnector(K8sHelmBaseConnector):
else:
self.log.info("Helm client already initialized")
else:
self.log.info("Helm client already initialized")
- # remove old stable repo and add new one
- cluster_uuid = "{}:{}".format(namespace, cluster_id)
- repo_list = await self.repo_list(cluster_uuid)
+ repo_list = await self.repo_list(cluster_id)
for repo in repo_list:
if repo["name"] == "stable" and repo["url"] != self._stable_repo_url:
self.log.debug("Add new stable repo url: {}")
for repo in repo_list:
if repo["name"] == "stable" and repo["url"] != self._stable_repo_url:
self.log.debug("Add new stable repo url: {}")
- await self.repo_remove(cluster_
uu
id, "stable")
+ await self.repo_remove(cluster_id, "stable")
if self._stable_repo_url:
if self._stable_repo_url:
- await self.repo_add(cluster_
uu
id, "stable", self._stable_repo_url)
+ await self.repo_add(cluster_id, "stable", self._stable_repo_url)
break
return n2vc_installed_sw
break
return n2vc_installed_sw
@@
-407,8
+404,13
@@
class K8sHelmConnector(K8sHelmBaseConnector):
output, _rc = await self._local_async_exec(
command=command, raise_exception_on_error=False, env=env
)
output, _rc = await self._local_async_exec(
command=command, raise_exception_on_error=False, env=env
)
- command = "{} --kubeconfig={} --namespace kube-system delete serviceaccount/{}".format(
- self.kubectl_command, paths["kube_config"], self.service_account
+ command = (
+ "{} --kubeconfig={} --namespace {} delete serviceaccount/{}".format(
+ self.kubectl_command,
+ paths["kube_config"],
+ namespace,
+ self.service_account,
+ )
)
output, _rc = await self._local_async_exec(
command=command, raise_exception_on_error=False, env=env
)
output, _rc = await self._local_async_exec(
command=command, raise_exception_on_error=False, env=env