check if configured item is available before setting

if neither a property nor a parameter exists for a given
configured item, just an attribute was created
This commit is contained in:
l_samenv
2021-04-08 10:16:24 +02:00
parent 4d8390c1fe
commit d768d84ea1

View File

@ -383,11 +383,12 @@ class Module(HasAccessibles):
try:
# this checks also for the proper datatype
# note: this will NOT call write_* methods!
setattr(self, k, v)
if hasattr(self, k):
setattr(self, k, v)
cfgdict.pop(k)
except (ValueError, TypeError):
# self.log.exception(formatExtendedStack())
errors.append('module %s, parameter %s: %s' % (self.name, k, e))
cfgdict.pop(k)
# Modify units AFTER applying the cfgdict
for k, v in self.parameters.items():