From 99588fc8159d7e1f3a972de76afde8b9bb18b76b Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 20 Jan 2022 14:38:04 +0100 Subject: [PATCH] fix handling commands - commands have to import arguments and export the result properly Change-Id: I4ff8879e4e9a93b0a3c57e015b7df8a6328a9bbc Reviewed-on: https://forge.frm2.tum.de/review/c/sine2020/secop/playground/+/27577 Tested-by: Jenkins Automated Tests Reviewed-by: Enrico Faulhaber Reviewed-by: Markus Zolliker --- secop/protocol/dispatcher.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/secop/protocol/dispatcher.py b/secop/protocol/dispatcher.py index 832e319..311f1d8 100644 --- a/secop/protocol/dispatcher.py +++ b/secop/protocol/dispatcher.py @@ -216,9 +216,14 @@ class Dispatcher: if cobj is None: raise NoSuchCommandError('Module %r has no command %r' % (modulename, cname or exportedname)) + if cobj.argument: + argument = cobj.argument.import_value(argument) # now call func # note: exceptions are handled in handle_request, not here! - return cobj.do(moduleobj, argument), dict(t=currenttime()) + result = cobj.do(moduleobj, argument) + if cobj.result: + result = cobj.result.export_value(result) + return result, dict(t=currenttime()) def _setParameterValue(self, modulename, exportedname, value): moduleobj = self.get_module(modulename)