]> git.llucax.com Git - software/pymin.git/blobdiff - pymin/procman.py
Check for name uniqueness when a new process is added to ProcessManager.
[software/pymin.git] / pymin / procman.py
index adfa792ca68be7ecc0c5f924fd7d8f76df17653b..4fc75a8949b3ad21adfe22ae1ce470c43123cce8 100644 (file)
@@ -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)