fix inheritance problem with mixin

- a mixin should not inherit from module then it has Parameters
- Parameters in mixins must be complete, not just overrides
- check precedence of read_<param> or handler

Change-Id: I72d9355a1982770d1a99d9552a20330103c97edb
This commit is contained in:
2021-03-18 13:32:54 +01:00
parent 6538500881
commit 48230334af
9 changed files with 55 additions and 24 deletions

View File

@ -228,11 +228,15 @@ class Server:
errors.append(self.unknown_options(cls, opts))
self.modules = OrderedDict()
badclass = None
failed = set() # python modules failed to load
self.lastError = None
for modname, options in self.module_cfg.items():
opts = dict(options)
try:
classname = opts.pop('class')
pymodule = classname.rpartition('.')[0]
if pymodule in failed:
continue
cls = get_class(classname)
modobj = cls(modname, self.log.getChild(modname), opts, self)
# all used args should be popped from opts!
@ -242,8 +246,12 @@ class Server:
except ConfigError as e:
errors.append(str(e))
except Exception as e:
badclass = classname
errors.append('error while loading %s' % badclass)
if str(e) == 'no such class':
errors.append('%s not found' % classname)
else:
failed.add(pymodule)
badclass = classname
errors.append('error importing %s' % pymodule)
poll_table = dict()
# all objs created, now start them up and interconnect