diff --git a/picomon/attrtree.py b/picomon/attrtree.py index d779c116edf56c326a7618069ee0985948250194..ea65a745b71c152af359648304490450e812c40f 100644 --- a/picomon/attrtree.py +++ b/picomon/attrtree.py @@ -22,7 +22,7 @@ class AttrTree(object): return self._attrs[key] def __setitem__(self, key, value): - if not key in self._attrs: + if key not in self._attrs: raise KeyError('Key "%s" does not exist' % key) elif isinstance(self._attrs[key], AttrTree): raise KeyError('Key "%s" is not settable' % key) diff --git a/picomon_watchdog.py b/picomon_watchdog.py index 7facb12e51d525d451fa4270814a99cfd9d2d98a..a55cdf91640708c46fb976dfdaa1762962c2b56c 100644 --- a/picomon_watchdog.py +++ b/picomon_watchdog.py @@ -9,21 +9,20 @@ from picomon import mails # launch picomon retcode = subprocess.call(["python3", "picomon.py"] + sys.argv[1:]) -# load config file -# (unprotected, will trigger exceptions if problems but real picomon beforehand) +# load config file (unprotected, will trigger exceptions if problems but real +# picomon beforehand) configfile = "config.py" if "-c" in sys.argv: - configfile = sys.argv[sys.argv.index("-c")+1] + configfile = sys.argv[sys.argv.index("-c")+1] if "--config" in sys.argv: - configfile = sys.argv[sys.argv.index("--config")+1] + configfile = sys.argv[sys.argv.index("--config")+1] sys.path.append(os.path.dirname(configfile)) -filename = os.path.basename(configfile) +filename = os.path.basename(configfile) base, ext = os.path.splitext(filename) importlib.import_module(base) # send warning mails.send_email(config.emails.watchdog_subject, "Picomon exited with status %s" % retcode) -