diff --git a/README.md b/README.md index ae572707..231df415 100644 --- a/README.md +++ b/README.md @@ -30,3 +30,4 @@ The documentation is automatically generated by [Sphinx](https://www.sphinx-doc. of the [reStructuredText Docstring Format](https://peps.python.org/pep-0287/) comments present in the code. + diff --git a/src/krkn_lib/k8s/krkn_kubernetes.py b/src/krkn_lib/k8s/krkn_kubernetes.py index f8bd52a4..6af74065 100644 --- a/src/krkn_lib/k8s/krkn_kubernetes.py +++ b/src/krkn_lib/k8s/krkn_kubernetes.py @@ -219,8 +219,7 @@ def get_kubeconfig_path(self) -> str: kubeconfig.close() return kubeconfig_path - def get_version(self) -> str: - + def get_version(self) -> str: try: api_response = self.version_client.get_code() major_version = api_response.major diff --git a/src/krkn_lib/models/telemetry/models.py b/src/krkn_lib/models/telemetry/models.py index 4ae342e3..f7cbfeaa 100644 --- a/src/krkn_lib/models/telemetry/models.py +++ b/src/krkn_lib/models/telemetry/models.py @@ -218,7 +218,7 @@ class ChaosRunTelemetry: affected_pods: PodsStatus = PodsStatus() - def __init__(self, json_object: any = None): + def __init__(self, json_dict: any = None): self.scenarios = list[ScenarioTelemetry]() self.node_summary_infos = list[NodeInfo]() self.node_taints = list[Taint]() @@ -227,8 +227,8 @@ def __init__(self, json_object: any = None): self.timestamp = datetime.now(timezone.utc).strftime( "%Y-%m-%dT%H:%M:%SZ" ) - if json_object is not None: - scenarios = json_object.get("scenarios") + if json_dict is not None: + scenarios = json_dict.get("scenarios") if scenarios is None or isinstance(scenarios, list) is False: raise Exception("scenarios param must be a list of object") for scenario in scenarios: @@ -248,8 +248,8 @@ def __init__(self, json_object: any = None): self.kubernetes_objects_count = json_dict.get( "kubernetes_objects_count" ) - self.network_plugins = json_object.get("network_plugins") - self.run_uuid = json_object.get("run_uuid") + self.network_plugins = json_dict.get("network_plugins") + self.run_uuid = json_dict.get("run_uuid") def to_json(self) -> str: return json.dumps(self, default=lambda o: o.__dict__, indent=4)