Manage situations where ODU workflows fail before it is launched (empty workflow_name)
Change-Id: I63a2113eee3626b6bc018519ca324b95ada1dc73
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osm_lcm/k8s.py b/osm_lcm/k8s.py
index 744e5c0..445c3a2 100644
--- a/osm_lcm/k8s.py
+++ b/osm_lcm/k8s.py
@@ -98,7 +98,7 @@
self.logger.info("cluster Create Enter")
db_cluster = content["cluster"]
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_cluster", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -247,7 +247,7 @@
self.logger.info("cluster delete Enter")
db_cluster = content["cluster"]
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_cluster", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -358,7 +358,7 @@
self.logger.info("profile type is : {}".format(profile_type))
self.logger.info("profile id is : {}".format(profile_id))
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"attach_profile_to_cluster", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -421,7 +421,7 @@
self.logger.info("profile type is : {}".format(profile_type))
self.logger.info("profile id is : {}".format(profile_id))
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"detach_profile_from_cluster", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -479,7 +479,7 @@
self.logger.info("cluster register enter")
db_cluster = content["cluster"]
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"register_cluster", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -538,7 +538,7 @@
self.logger.info("db_cluster is : {}".format(db_cluster))
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"deregister_cluster", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -625,7 +625,7 @@
self.logger.info("Cluster update Enter")
db_cluster = content["cluster"]
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"update_cluster", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -699,7 +699,7 @@
async def add(self, op_id, op_params, content):
self.logger.info("Cloud Credentials create")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_cloud_credentials", op_id, op_params, content
)
@@ -739,7 +739,7 @@
return
async def edit(self, op_id, op_params, content):
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"update_cloud_credentials", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -770,7 +770,7 @@
async def remove(self, op_id, op_params, content):
self.logger.info("Cloud Credentials delete")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_cloud_credentials", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -805,7 +805,7 @@
async def create(self, op_id, op_params, content):
self.logger.info("App Create Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -853,7 +853,7 @@
async def delete(self, op_id, op_params, content):
self.logger.info("App delete Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -914,7 +914,7 @@
async def create(self, op_id, op_params, content):
self.logger.info("Resource Create Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -963,7 +963,7 @@
self.logger.info("Resource delete Enter")
content = self.db.get_one("k8sresource", {"_id": content["_id"]})
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -1024,7 +1024,7 @@
async def create(self, op_id, op_params, content):
self.logger.info("Infra controller Create Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -1072,7 +1072,7 @@
async def delete(self, op_id, op_params, content):
self.logger.info("Infra controller delete Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -1133,7 +1133,7 @@
async def create(self, op_id, op_params, content):
self.logger.info("Infra config Create Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -1181,7 +1181,7 @@
async def delete(self, op_id, op_params, content):
self.logger.info("Infra config delete Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_profile", op_id, op_params, content
)
self.logger.info("workflow_name is :{}".format(workflow_name))
@@ -1244,7 +1244,7 @@
self.logger.info("OKA Create Enter")
db_content = content
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_oka", op_id, op_params, db_content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -1295,7 +1295,7 @@
self.logger.info("OKA Edit Enter")
db_content = content
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"update_oka", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -1343,7 +1343,7 @@
self.logger.info("OKA delete Enter")
db_content = content
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_oka", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -1406,7 +1406,7 @@
async def create(self, op_id, op_params, content):
self.logger.info("ksu Create Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"create_ksus", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -1466,7 +1466,7 @@
async def edit(self, op_id, op_params, content):
self.logger.info("ksu edit Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"update_ksus", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -1531,7 +1531,7 @@
async def delete(self, op_id, op_params, content):
self.logger.info("ksu delete Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"delete_ksus", op_id, op_params, content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -1585,7 +1585,7 @@
async def clone(self, op_id, op_params, db_content):
self.logger.info("ksu clone Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"clone_ksus", op_id, op_params, db_content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(
@@ -1631,7 +1631,7 @@
async def move(self, op_id, op_params, db_content):
self.logger.info("ksu move Enter")
- workflow_name = await self.odu.launch_workflow(
+ _, workflow_name = await self.odu.launch_workflow(
"move_ksus", op_id, op_params, db_content
)
workflow_status, workflow_msg = await self.odu.check_workflow_status(