diff options
author | 2019-10-24 01:42:27 -0400 | |
---|---|---|
committer | 2019-10-24 01:45:31 -0400 | |
commit | 35ab81bb9ff203e14116de10bc2735ffb2883f67 (patch) | |
tree | 574ff6ea87e099971bc41184cafbc72638b0bf4a /components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py | |
parent | 4433fa9514ed0a031b797367a0daa9aea611d138 (diff) |
Improve Remote Python Executor error handling and allow for structured response
Issue-ID: CCSDK-1855
Signed-off-by: Serge Simard <serge@agilitae.com>
Change-Id: I924918fb06a5a0f118772dedaa41c536c7eca9e7
Signed-off-by: Serge Simard <serge@agilitae.com>
Diffstat (limited to 'components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py')
-rw-r--r-- | components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py index 5e20e2291..fae5855cf 100644 --- a/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py +++ b/components/model-catalog/blueprint-model/test-blueprint/remote_scripts/Scripts/python/SamplePython.py @@ -2,4 +2,14 @@ import sys -print(sys.argv[1])
\ No newline at end of file +#Optional : import this utility class if returning payload +from cds_utils.payload_coder import send_response_data_payload + +# Do your work... using try .. except to handle errors and return False if error +print(sys.argv[1]) + +# Optional : return a JSON payload to the be published under the response-data output attribute +send_response_data_payload({"étudiant": ["Mélanie", "Joséphine"]}) + +# Always return a boolean indicating success or not.. +sys.exit(True)
\ No newline at end of file |