summaryrefslogtreecommitdiffstats
path: root/src/ogRest.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-11-26 11:50:52 +0100
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-11-27 13:53:19 +0100
commite4be5c34eb71da9a705bc62fdfcfe6d763022747 (patch)
tree70883c72fd8baa07ca225e5a7fee173158283bd2 /src/ogRest.py
parenta36c4daa23d32aeee9539374aa591152ef2c914b (diff)
src: add support for direct command executionv1.3.2-25
Update live shell run mode for the new REST API interface. Evaluate the "inline" field to diferentiate between execution of script in /opt/opengnsys/shell/ and a cmd execution. Remove usage of echo argument of the API REST. Update Windows and Linux mode for direct command execution. Set OutputEncoding environment variable to 'utf-8' in Windows to unify the encoding of stdout for the invoked programs. Decode stdout to utf-8-sig to remove potential BOM. While at this, remove strange legacy ;|\n\r terminator.
Diffstat (limited to 'src/ogRest.py')
-rw-r--r--src/ogRest.py16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/ogRest.py b/src/ogRest.py
index 5731350..a30c494 100644
--- a/src/ogRest.py
+++ b/src/ogRest.py
@@ -97,16 +97,12 @@ class ogThread():
ogRest.send_internal_server_error(client, exc=e)
return
- if request.getEcho():
- json_body = jsonBody()
- json_body.add_element('cmd', cmd)
- json_body.add_element('out', shellout)
- json_body.add_element('retcode', retcode)
- response = restResponse(ogResponses.OK, json_body, seq=client.seq)
- client.send(response.get())
- else:
- response = restResponse(ogResponses.OK, seq=client.seq)
- client.send(response.get())
+ json_body = jsonBody()
+ json_body.add_element('cmd', cmd)
+ json_body.add_element('out', shellout)
+ json_body.add_element('retcode', retcode)
+ response = restResponse(ogResponses.OK, json_body, seq=client.seq)
+ client.send(response.get())
ogRest.state = ThreadState.IDLE