From cc2c1a77e8a59d961714f0ac336595fa0992e21f Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 17 May 2008 02:36:46 -0300 Subject: [PATCH] Check for name uniqueness when a new process is added to ProcessManager. This check is against both current running processes (namemap) and the registered processes (services) to ensure that the name is unique and so process gets overriden. --- pymin/procman.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pymin/procman.py b/pymin/procman.py index adfa792..4fc75a8 100644 --- a/pymin/procman.py +++ b/pymin/procman.py @@ -72,6 +72,7 @@ class ProcessManager: max_errors=3, *args, **kwargs): log.debug(u'ProcessManager.register(%s, %s, %s, %s, %s, %s, %s)', name, command, callback, persist, max_errors, args, kwargs) + assert not self.has(name) self.services[name] = ProcessInfo(name, command, callback, persist, max_errors, args, kwargs) @@ -87,6 +88,7 @@ class ProcessManager: max_errors=3, *args, **kwargs): log.debug(u'ProcessManager.call(%s, %s, %s, %s, %s, %s, %s)', name, command, callback, persist, max_errors, args, kwargs) + assert not self.has(name) pi = ProcessInfo(name, command, callback, persist, max_errors, args, kwargs) self._call(pi) -- 2.43.0