From 19cd1b9a783646522bcbe46a4e4f9580c0a1d512 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Fri, 21 Jun 2024 14:02:54 +0200 Subject: rest: add retcode field to POST /shell/run provide return code as result to ogserver. Update virtual mode driver to return dummy value, although this command is unimplemented, this seems to be broken due to possible TypeError when accessing result from caller. --- src/ogRest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/ogRest.py') diff --git a/src/ogRest.py b/src/ogRest.py index bd480a7..e7b9d95 100644 --- a/src/ogRest.py +++ b/src/ogRest.py @@ -92,7 +92,7 @@ class ogThread(): return try: - shellout = ogRest.operations.shellrun(request, ogRest) + (retcode, shellout) = ogRest.operations.shellrun(request, ogRest) except Exception as e: ogRest.send_internal_server_error(client, exc=e) return @@ -100,6 +100,7 @@ class ogThread(): if request.getEcho(): json_body = jsonBody() 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: -- cgit v1.2.3-18-g5258