New API for get_creds_file and adding operationHistory for get_creds
Change-Id: Ibe163ac0302b4456f26550719e6717969b15fe10
Signed-off-by: shahithya <shahithya.y@tataelxsi.co.in>
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
diff --git a/osm_nbi/base_topic.py b/osm_nbi/base_topic.py
index 35514a5..a327260 100644
--- a/osm_nbi/base_topic.py
+++ b/osm_nbi/base_topic.py
@@ -411,7 +411,9 @@
return None
@staticmethod
- def format_on_operation(content, operation_type, operation_params):
+ def format_on_operation(
+ content, operation_type, operation_params=None, launch_workflow=True
+ ):
if content["current_operation"] is None:
op_id = str(uuid4())
content["current_operation"] = op_id
@@ -423,14 +425,15 @@
operation = {}
operation["operationType"] = operation_type
- operation["git_operation_info"] = None
operation["op_id"] = op_id
operation["result"] = None
- operation["workflowState"] = "PROCESSING"
- operation["resourceState"] = "NOT_READY"
operation["creationDate"] = now
operation["endDate"] = None
- operation["operationParams"] = operation_params
+ if launch_workflow:
+ operation["workflowState"] = "PROCESSING"
+ operation["resourceState"] = "NOT_READY"
+ operation["git_operation_info"] = None
+ operation["operationParams"] = operation_params
content["operationHistory"].append(operation)
return op_id