From 08a92029a94e265061ab214e14f3189c3e5f77c1 Mon Sep 17 00:00:00 2001 From: Enrico Faulhaber Date: Wed, 27 Mar 2019 17:52:08 +0100 Subject: [PATCH] Dispatcher: fix activate Change-Id: Ib97e69794cba97f2d1f6823f983ea64aaed00efa Reviewed-on: https://forge.frm2.tum.de/review/20250 Tested-by: JenkinsCodeReview Reviewed-by: Enrico Faulhaber Tested-by: Enrico Faulhaber --- secop/protocol/dispatcher.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/secop/protocol/dispatcher.py b/secop/protocol/dispatcher.py index 964133e..da47271 100644 --- a/secop/protocol/dispatcher.py +++ b/secop/protocol/dispatcher.py @@ -331,13 +331,16 @@ class Dispatcher(object): if modulename not in self._export: raise NoSuchModuleError('Module does not exist on this SEC-Node!') moduleobj = self.get_module(modulename) - pname = moduleobj.accessiblename2attr.get(exportedname, True) - if pname and pname not in moduleobj.accessibles: - # what if we try to subscribe a command here ??? - raise NoSuchParameterError('Module has no such parameter on this SEC-Node!') + if exportedname is not None: + pname = moduleobj.accessiblename2attr.get(exportedname, True) + if pname and pname not in moduleobj.accessibles: + # what if we try to subscribe a command here ??? + raise NoSuchParameterError('Module has no such parameter on this SEC-Node!') + modules = [(modulename, pname)] + else: + modules = [(modulename, None)] # activate only ONE item (module or module:parameter) self.subscribe(conn, specifier) - modules = [(modulename, pname)] else: # activate all modules self._active_connections.add(conn)