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 <pedersen+jenkins@frm2.tum.de>
Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de>
Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
zolliker 2022-01-20 14:38:04 +01:00
parent bbc4663266
commit 99588fc815

View File

@ -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)