File tree Expand file tree Collapse file tree 2 files changed +25
-2
lines changed
python/understack-workflows/understack_workflows/oslo_event
workflows/argo-events/workflowtemplates Expand file tree Collapse file tree 2 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,30 @@ def handle_project_created(
55
55
logger .debug ("Project %s has tags: %s" , event .project_id , tags )
56
56
if SVM_PROJECT_TAG not in tags :
57
57
logger .info ("The %s is missing, not creating SVM." , SVM_PROJECT_TAG )
58
- exit ( 0 )
58
+ return 0
59
59
60
60
netapp_manager = NetAppManager ()
61
61
netapp_manager .create_svm (
62
62
project_id = event .project_id , aggregate_name = AGGREGATE_NAME
63
63
)
64
- netapp_manager .create_volume (
64
+ svm_name = netapp_manager .create_volume (
65
65
project_id = event .project_id ,
66
66
volume_size = VOLUME_SIZE ,
67
67
aggregate_name = AGGREGATE_NAME ,
68
68
)
69
+ with open ("/var/run/argo/output.svm_name" , "w" ) as f : # noqa: S108
70
+ if not svm_name :
71
+ svm_name = "not_returned"
72
+
73
+ f .write (svm_name )
74
+
75
+ _save_result ("success" , 0 )
69
76
return 0
77
+
78
+
79
+ def _save_result (msg , exit_code ):
80
+ with open ("/var/run/argo/output.msg" , "w" ) as f : # noqa: S108
81
+ f .write (msg )
82
+ with open ("/var/run/argo/output.exit_code" , "w" ) as f : # noqa: S108
83
+ f .write (str (exit_code ))
84
+ exit (exit_code )
Original file line number Diff line number Diff line change 62
62
- name : netapp-ini
63
63
secret :
64
64
secretName : netapp-config
65
+ outputs :
66
+ parameters :
67
+ - name : exit_code
68
+ valueFrom :
69
+ path : /var/run/argo/output.exit_code
70
+ - name : msg
71
+ valueFrom :
72
+ path : /var/run/argo/output.msg
You can’t perform that action at this time.
0 commit comments