From d768d84ea141f3d7eaa3348ce8322e0265abc241 Mon Sep 17 00:00:00 2001 From: l_samenv Date: Thu, 8 Apr 2021 10:16:24 +0200 Subject: [PATCH] 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 --- secop/modules.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/secop/modules.py b/secop/modules.py index c3d1334..4a1d309 100644 --- a/secop/modules.py +++ b/secop/modules.py @@ -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():