diff options
-rw-r--r-- | src/lib/Bcfg2/Server/Lint/__init__.py | 16 | ||||
-rwxr-xr-x | src/sbin/bcfg2-lint | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/__init__.py b/src/lib/Bcfg2/Server/Lint/__init__.py index a59214048..11afdd75d 100644 --- a/src/lib/Bcfg2/Server/Lint/__init__.py +++ b/src/lib/Bcfg2/Server/Lint/__init__.py @@ -118,26 +118,26 @@ class ErrorHandler (object): else: self._wrapper = lambda s: [s] - self.errors = dict() + self.errortypes = dict() if config is not None: - self.RegisterErrors(config.items()) + self.RegisterErrors(dict(config.items())) def RegisterErrors(self, errors): """ Register a dict of errors (name: default level) that a plugin may raise """ for err, action in errors.items(): - if err not in self.errors: + if err not in self.errortypes: if "warn" in action: - self.errors[err] = self.warn + self.errortypes[err] = self.warn elif "err" in action: - self.errors[err] = self.error + self.errortypes[err] = self.error else: - self.errors[err] = self.debug + self.errortypes[err] = self.debug def dispatch(self, err, msg): """ Dispatch an error to the correct handler """ - if err in self.errors: - self.errors[err](msg) + if err in self.errortypes: + self.errortypes[err](msg) self.logger.debug(" (%s)" % err) else: # assume that it's an error, but complain diff --git a/src/sbin/bcfg2-lint b/src/sbin/bcfg2-lint index 0321d3045..9e5f7b339 100755 --- a/src/sbin/bcfg2-lint +++ b/src/sbin/bcfg2-lint @@ -152,7 +152,7 @@ def main(): errorhandler.RegisterErrors(getattr(plugin, 'Errors')()) print("%-35s %-35s" % ("Error name", "Handler")) - for err, handler in errorhandler.errors.items(): + for err, handler in errorhandler.errortypes.items(): print("%-35s %-35s" % (err, handler.__name__)) raise SystemExit(0) |