Bug 1980 fixed
Added the `yaml_format` argument to the `status_kdu` abstract method of
the class `K8sConnector`, and changed the corresponding Helm connectors
methods accordingly, while maintaining backward compatibility
Change-Id: Ic78c951825b7654ccf8246c4fe1fc4d488221bfc
Signed-off-by: Pedro Escaleira <escaleira@av.it.pt>
diff --git a/n2vc/k8s_helm_conn.py b/n2vc/k8s_helm_conn.py
index 444f2da..8c526f5 100644
--- a/n2vc/k8s_helm_conn.py
+++ b/n2vc/k8s_helm_conn.py
@@ -20,6 +20,7 @@
# contact with: nfvlabs@tid.es
##
import asyncio
+from typing import Union
import os
import yaml
@@ -464,9 +465,9 @@
cluster_id: str,
kdu_instance: str,
namespace: str = None,
+ yaml_format: bool = False,
show_error_log: bool = False,
- return_text: bool = False,
- ):
+ ) -> Union[str, dict]:
self.log.debug(
"status of kdu_instance: {}, namespace: {} ".format(kdu_instance, namespace)
@@ -486,7 +487,7 @@
env=env,
)
- if return_text:
+ if yaml_format:
return str(output)
if rc != 0:
@@ -544,7 +545,7 @@
)
status = await self._status_kdu(
- cluster_id=cluster_id, kdu_instance=kdu_instance, return_text=False
+ cluster_id=cluster_id, kdu_instance=kdu_instance, yaml_format=False
)
# extract info.status.resources-> str