summaryrefslogtreecommitdiffstats
path: root/ms/command-executor/src/main/python/command_executor_handler.py
AgeCommit message (Collapse)AuthorFilesLines
2022-04-14Update cmd-exec for Python 3.7kuldipr1-1/+2
Issue-ID: CCSDK-3632 Signed-off-by: kuldipr <kuldip.rai@amdocs.com> Change-Id: I351203e1935ccee9327edf39b9809b873e391f86
2021-11-30CCSDK-3531 improve cmd-exec returned err msgOleg Mitsura1-67/+61
Issue-ID: CCSDK-3531 Improve end-user CBA's Python scripts ability to return error messages on failues. See JIRA story for examples: https://jira.onap.org/browse/CCSDK-3531 adds functions send_response_err_msg(err_message) and send_response_err_msg_and_exit(ret_err_msg, code=1) Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ideda64dd108f987c3c4515c70daf9f7b6d2b1f2f
2021-11-29Correct dynamic properties grpc json serializingAbdelmuhaimen Seaudi1-1/+1
Correct the json serializing and escaping in command executor for grpc server Issue-ID: CCSDK-3521 Signed-off-by: Abdelmuhaimen Seaudi <abdelmuhaimen.seaudi@orange.com> Change-Id: I5d0c9fbb7190e8de52bf954ef1af29a6f854f685
2021-10-20Add missing code for Metrics and PV/PVC eliminationJozsef Csongvai1-3/+12
Earlier patch introducing MeterRegistry to AbstractComponentFunction was not initializing the lateinit property and causing NPE. Also add additional code to handle compatibility issues after the introduction of PV/PVC elminiation for CommandExecutor. This allows blueprintsprocessor to communicate with earlier versions of command- executor which still use the shared pvc. Issue-ID: CCSDK-3471 Change-Id: I84a04601c4fe09c5f3a06664ce877800a30531f1 Signed-off-by: Jozsef Csongvai <jozsef.csongvai@bell.ca>
2021-09-01CCSDK-3451 Prometheus Metrics for command-executorKuldip Rai1-3/+67
Issue-ID: CCSDK-3451 Signed-off-by: Kuldip Rai <kuldip.rai@bell.ca> Change-Id: Ibd11257037ec6f1941b5dee08cc97177b2c798c9
2021-01-26PV/PVC eliminationOleg Mitsura1-44/+114
Issue-ID: CCSDK-3086 1. initial commit 2. fix accidental paste / rebased cleaned up unneeded validation call in cmd-exec upload Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ife5460c5be59aa8d8592d82099b27c507b08c6c6
2020-08-24Add request IDs in command-executor logJulien Fontaine1-24/+29
* Update gRPC interface to handle SubRequestID and Originator ID * Update command-executor log format to handle request IDs in the log statement * Add SubRequest ID and Originator ID in BP log statement Issue-ID: CCSDK-2687 Change-Id: If261bb0912df5800ed2fc65371c5ee784d6a45fb Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca>
2020-07-27Fix empty dict in the script arguments when running a script in the cmd-execJulien Fontaine1-1/+6
Add a test to check if dynamic properties are empty. If empty we don't pass them to the script. Issue-ID: CCSDK-2614 Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca> Change-Id: Iaa5a2b49e38d9a120fb193966af13f0843773e5f
2020-07-08cmd-exec server-side timeout.Oleg Mitsura1-28/+21
Issue-ID: CCSDK-2535 Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: I897678a5a8a23503a878f2d3eb836ba4597a6e6e
2020-07-02Command Executor : Invalid response_data when executed script failsJulien Fontaine1-15/+9
* Modified command exec returned value in case of failure during execution. It now prints the response_data defined by the user * Modified truncation method of the gRPC returned object to use ByteSize() to get the exact sizxe consumed within the buffer Issue-ID: CCSDK-2501 Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca> Change-Id: Ie1db8db265623b5137ab3946ff4e3abda1c54a78
2020-06-26Explicit error message in command-executor when script is failingJulien Fontaine1-1/+6
Changed error message to print the last execution log (if possible) when the executed script fails. Issue-ID: CCSDK-2481 Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca> Change-Id: I9df9dfeeaf95d98049c4f80f827deb85a29137da
2020-05-05Truncate message published on Kafka / Spike: Define solution for logs separationJulien Fontaine1-35/+37
Refactoring of cmd-exec component - Improve display of error messages within the response - Fix gRPC buffer limitation (4Mb) by truncating error messages and cmd-exec logs if too heavy (>3Mb) Truncation of BP responses (<4Kb) before sending them in kafka audit topics. - Truncation if needed of error messages for every response - Truncation of cmd-exec logs in cmd-exec responses (Spike) Add a flag in the application.properties to enable/disable the display of cmd-exec responses on the BP side (Fix) Correction of BP processing with kafka regression (Fix) Changed default SSL Endpoint Algo Issue-ID: CCSDK-2326 Change-Id: If4d0e661117d1dd156cf19c95774824e754d870a Signed-off-by: Julien Fontaine <julien.fontaine@bell.ca>
2020-04-15cmd-exec had a merge issue from elalto...Oleg Mitsura1-17/+19
Issue-ID: CCSDK-2049 Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: I611fff488b339f03b85c58ed097525a0bcda35a3
2020-04-08Improving CMD-exec err msgs/handling.Oleg Mitsura1-40/+80
Issue-ID: CCSDK-2049 rev1. initial commit rev2. added better logging/passing errors. rev3. bugfixes rev4. bugfix for CommandExecutorServer.prepareEnv return status was still returning bool. (was caught only during a defective mariadb pip package install!) Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ifbddaeb0e15857f42b121af10e30e29dec5c20b2
2019-11-28Pass requestID/subreqID to python script.Oleg Mitsura1-2/+10
Issue-ID: CCSDK-1860 1. initial commit 2. rebased with return value 3. CDS_CORRELATION_ID Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ia64a0ee9c8eb60e3f39ec00ee17e7ab1b4aa3638
2019-10-24Improve Remote Python Executor error handling and allow for structured responseSerge Simard1-4/+29
Issue-ID: CCSDK-1855 Signed-off-by: Serge Simard <serge@agilitae.com> Change-Id: I924918fb06a5a0f118772dedaa41c536c7eca9e7 Signed-off-by: Serge Simard <serge@agilitae.com>
2019-09-06Revert "Use ProcessPool rather than ThreadPool Executor"Alexis de Talhouët1-4/+3
This reverts commit cd29a05ccd4279d7fb740d03bbeee6a0839b287e. Issue-ID: CCSDK-1681 Change-Id: I5827256ea5dc76b6ff8806250c684d155656dfc5 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-09-03Use ProcessPool rather than ThreadPool ExecutorAlexis de Talhouët1-3/+4
Change-Id: I66a800bf30cabce35123b0ac24b3b3e00eef6026 Issue-ID: CCSDK-1681 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-08-09Add dynamic-properties as python script argAlexis de Talhouët1-3/+3
For the remote python executor, we have the ability to provide dynamic properties, that will end up marshall as Json. Through the gRPC session, it will be transform to a Google Proto Struct. Once in the remote python executor, we use utility method from Proto to convert the Struct into a Json string, and we pass it as the last argument of the script execution. That way, user can access them in their script, simply by loading the content using json.loads and then interact with the data through the python dict. Change-Id: Ib3552c06734aed252ec28f47173bc8668afe085d Issue-ID: CCSDK-1606 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-06-25Remote Python executor Handler class process fails with Arguments list too longSerge Simard1-0/+7
Issue-ID: CCSDK-1435 Change-Id: I02b1d8393c2506850cf37df6e3447d195f4fabb5 Signed-off-by: Serge Simard <serge@agilitae.com>
2019-06-25python-executor will provide output line-by-lineOleg Mitsura1-5/+12
* python-executor STDOUT contains cleaner logs * return status has been reworked to return a list of lines Issue-ID: CCSDK-1404 Signed-off-by: Oleg Mitsura <oleg.mitsura@amdocs.com> Change-Id: Ib17495e92a136ff4f950bb6e049246a9e100eb7d
2019-04-25Finalize ansible usageAlexis de Talhouët1-3/+12
Change-Id: Iaca6bb573e31607eaa9a3a603e1e4beae60c817c Issue-ID: CCSDK-1215 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-04-22Add support for requirements.txt for pip depsAlexis de Talhouët1-5/+11
Change-Id: I10bbe95a4d06ce9361d3ab6553953022e1196a3d Issue-ID: CCCSDK-125 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-04-22Update package type nameAlexis de Talhouët1-9/+11
- split log output: prepare-env and exec-cmd - fix proxy support when not provided Change-Id: I40cdf90e7e3ebe31b0152923f8b6a38f6b6e9ca0 Issue-ID: CCCSDK-125 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-04-18Add support for Ansible packagesAlexis de Talhouët1-13/+66
- rework how to provide packages - support proxy as parameters Change-Id: I1d10d921ead0837aa0f74b965cadf985424ceedc Issue-ID: CCCSDK-1215 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-04-16Add logger to python codeAlexis de Talhouët1-9/+14
Change-Id: I526059b2a18685dbb978c0776cc728bbbd90e9cd Issue-ID: CCSDK-1164 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
2019-04-16Add CommandExecutor handlerAlexis de Talhouët1-0/+100
Change-Id: I7a4fbd13d11618ed6b2c85827ec2ced1cb65b31f Issue-ID: CCCSDK-1215 Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>