Bug 2410 Fix Configmap creation while creating nodegroup in AWS 16/15416/4
authoryshah <shahithya.y@tataelxsi.co.in>
Tue, 23 Sep 2025 10:09:58 +0000 (10:09 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Tue, 11 Nov 2025 10:01:25 +0000 (11:01 +0100)
Change-Id: I0feb1dfa0c1cb42b349aeb32e1d4ba8ea284f408
Signed-off-by: yshah <shahithya.y@tataelxsi.co.in>
osm_lcm/odu_libs/nodegroup.py

index 488fe62..ff40f9c 100644 (file)
@@ -17,6 +17,7 @@
 
 
 import yaml
+import json
 
 
 def gather_age_key(cluster):
@@ -65,7 +66,7 @@ async def add_nodegroup(self, op_id, op_params, content):
     public_subnet = op_params.get("public_subnet", [])
     subnet = private_subnet + public_subnet
     self.logger.info(f"Subnets: {subnet}")
-    formatted_subnet = f"{json.dumps(subnet)}"
+    formatted_subnet = f"{json.dumps(subnet)}"
     # self.logger.info(f"Formatted Subnet: {formatted_subnet}")
     # Create the ConfigMap for the subnets
     # TODO: this should be done in a declarative way, not imperative
@@ -73,7 +74,7 @@ async def add_nodegroup(self, op_id, op_params, content):
         await self.create_configmap(
             configmap_name,
             "managed-resources",
-            {"subnet": subnet},
+            {"subnet": formatted_subnet},
         )
     except Exception as e:
         self.logger.info(f"Cannot create configmap {configmap_name}: {e}")