Manage OKA profile_type in OKA operations and KSUs based on OKA
Change-Id: I9cc7eae62cdd40e1bf9d532b2a2915b98e5ba425
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osm_lcm/odu_libs/ksu.py b/osm_lcm/odu_libs/ksu.py
index 7f4d699..767e30b 100644
--- a/osm_lcm/odu_libs/ksu.py
+++ b/osm_lcm/odu_libs/ksu.py
@@ -21,7 +21,7 @@
MAP_PROFILE = {
"infra_controller_profiles": "infra-controllers",
- "infra_config_profiles": "infra-controllers",
+ "infra_config_profiles": "infra-configs",
"resource_profiles": "managed_resources",
"app_profiles": "apps",
}
@@ -45,7 +45,9 @@
if "sw_catalog_path" in oka_item:
oka_path = oka_item["sw_catalog_path"]
else:
- oka_type = "infra-controllers"
+ oka_type = MAP_PROFILE[
+ oka_item.get("profile_type", "infra_controller_profiles")
+ ]
oka_name = oka_item["git_name"]
oka_path = f"{oka_type}/{oka_name}/templates"
@@ -184,7 +186,9 @@
if "sw_catalog_path" in oka_item:
oka_path = oka_item["sw_catalog_path"]
else:
- oka_type = "infra-controllers"
+ oka_type = MAP_PROFILE[
+ oka_item.get("profile_type", "infra_controller_profiles")
+ ]
oka_name = oka_item["git_name"]
oka_path = f"{oka_type}/{oka_name}/templates"
diff --git a/osm_lcm/odu_libs/oka.py b/osm_lcm/odu_libs/oka.py
index 62207a3..ce07e96 100644
--- a/osm_lcm/odu_libs/oka.py
+++ b/osm_lcm/odu_libs/oka.py
@@ -19,6 +19,14 @@
import yaml
+MAP_PROFILE = {
+ "infra_controller_profiles": "infra-controllers",
+ "infra_config_profiles": "infra-configs",
+ "resource_profiles": "managed_resources",
+ "app_profiles": "apps",
+}
+
+
async def create_oka(self, op_id, op_params, content):
self.logger.info(f"create_oka Enter. Operation {op_id}. Params: {op_params}")
# self.logger.debug(f"Content: {content}")
@@ -28,7 +36,7 @@
# Additional params for the workflow
oka_name = content["git_name"].lower()
- oka_type = "infra-controllers"
+ oka_type = MAP_PROFILE[content.get("profile_type", "infra_controller_profiles")]
osm_project_name = "osm_admin" # TODO: get project name from content
# Get the OKA package
@@ -87,7 +95,7 @@
# Additional params for the workflow
oka_name = content["git_name"].lower()
- oka_type = "infra-controllers"
+ oka_type = MAP_PROFILE[content.get("profile_type", "infra_controller_profiles")]
osm_project_name = "osm_admin" # TODO: get project name from content
# Get the OKA package
@@ -143,7 +151,8 @@
# Additional params for the workflow
oka_name = content["git_name"].lower()
- oka_type = "infra-controllers"
+ oka_type = MAP_PROFILE[content.get("profile_type", "infra_controller_profiles")]
+
osm_project_name = "osm_admin" # TODO: get project name from content
# Render workflow