frappy.secnode: fix strange error message
when get_module_instance is called a second time after it failed, the 'cls' element in opts is missing: move opts dict copy from create_modules to get_module_instance Change-Id: Ie046f133a8fdbbb1c39643ca16dc5447a9d2d065 Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32745 Tested-by: Jenkins Automated Tests <pedersen+jenkins@frm2.tum.de> Reviewed-by: Alexander Zaft <a.zaft@fz-juelich.de> Reviewed-by: Enrico Faulhaber <enrico.faulhaber@frm2.tum.de> Reviewed-by: Markus Zolliker <markus.zolliker@psi.ch>
This commit is contained in:
parent
f6f433e6b2
commit
06bcf94fa2
@ -84,7 +84,7 @@ class SecNode:
|
|||||||
|
|
||||||
def get_module_instance(self, modulename):
|
def get_module_instance(self, modulename):
|
||||||
""" Returns the module in its current initialization state or creates a
|
""" Returns the module in its current initialization state or creates a
|
||||||
new uninitialized modle to return.
|
new uninitialized module to return.
|
||||||
|
|
||||||
When creating a new module, srv.module_config is accessed to get the
|
When creating a new module, srv.module_config is accessed to get the
|
||||||
modules configuration.
|
modules configuration.
|
||||||
@ -102,6 +102,7 @@ class SecNode:
|
|||||||
if opts is None:
|
if opts is None:
|
||||||
raise NoSuchModuleError(f'Module {modulename!r} does not exist on '
|
raise NoSuchModuleError(f'Module {modulename!r} does not exist on '
|
||||||
f'this SEC-Node!')
|
f'this SEC-Node!')
|
||||||
|
opts = dict(opts)
|
||||||
pymodule = None
|
pymodule = None
|
||||||
try: # pylint: disable=no-else-return
|
try: # pylint: disable=no-else-return
|
||||||
classname = opts.pop('cls')
|
classname = opts.pop('cls')
|
||||||
@ -157,7 +158,7 @@ class SecNode:
|
|||||||
# already created via Attached
|
# already created via Attached
|
||||||
continue
|
continue
|
||||||
# For Pinata modules: we need to access this in Self.get_module
|
# For Pinata modules: we need to access this in Self.get_module
|
||||||
self.srv.module_cfg[modname] = dict(options)
|
self.srv.module_cfg[modname] = options
|
||||||
modobj = self.get_module_instance(modname) # lazy
|
modobj = self.get_module_instance(modname) # lazy
|
||||||
if modobj is None:
|
if modobj is None:
|
||||||
self.log.debug('Module %s returned None', modname)
|
self.log.debug('Module %s returned None', modname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user