From 5f9edf718448e15292caf7d12dde051882937465 Mon Sep 17 00:00:00 2001 From: Eva Sebestova Date: Thu, 12 Dec 2024 12:57:53 +0100 Subject: [PATCH 1/2] Add support for OCP items without resource_id --- nise/__init__.py | 2 +- nise/generators/ocp/ocp_generator.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nise/__init__.py b/nise/__init__.py index 5e6604d0..1555d212 100644 --- a/nise/__init__.py +++ b/nise/__init__.py @@ -1,4 +1,4 @@ -__version__ = "4.6.9" +__version__ = "4.6.10" VERSION = __version__.split(".") diff --git a/nise/generators/ocp/ocp_generator.py b/nise/generators/ocp/ocp_generator.py index f8501ace..63ddfd40 100644 --- a/nise/generators/ocp/ocp_generator.py +++ b/nise/generators/ocp/ocp_generator.py @@ -289,7 +289,7 @@ def _gen_nodes(self): "name": item.get("node_name", "node_" + self.fake.word()), "cpu_cores": item.get("cpu_cores", randint(2, 16)), "memory_bytes": memory_bytes, - "resource_id": "i-" + resource_id, + "resource_id": "i-" + resource_id if resource_id else resource_id, "namespaces": item.get("namespaces"), "node_labels": item.get("node_labels"), } From fea8308f92df471c126719a8a597f32876ee89fd Mon Sep 17 00:00:00 2001 From: Eva Sebestova Date: Thu, 12 Dec 2024 12:59:47 +0100 Subject: [PATCH 2/2] update --- nise/generators/ocp/ocp_generator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nise/generators/ocp/ocp_generator.py b/nise/generators/ocp/ocp_generator.py index 63ddfd40..f0a7133e 100644 --- a/nise/generators/ocp/ocp_generator.py +++ b/nise/generators/ocp/ocp_generator.py @@ -289,7 +289,7 @@ def _gen_nodes(self): "name": item.get("node_name", "node_" + self.fake.word()), "cpu_cores": item.get("cpu_cores", randint(2, 16)), "memory_bytes": memory_bytes, - "resource_id": "i-" + resource_id if resource_id else resource_id, + "resource_id": "i-" + resource_id if resource_id != "" else resource_id, "namespaces": item.get("namespaces"), "node_labels": item.get("node_labels"), }