Use a plug-in architecture for services (refs #27).
Service modules are loaded dinamically using the imp module. The config.py
file is simplified to avoid the need of defining pymind command handlers
"tree" in the configuration file.
Make procman.ProcessManager return True is an action could be taken (refs #11).
For start(), stop(), restart() and kill(), return True if the action could
be taken. That is True if the process wasn't already running for start(),
and for stop(), restart() and kill(), True if the process was already
running.
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.
Improve detection of bad arguments errors in dispatcher handlers.
The previos scheme was based on parsing TypeError messages, so it was very
poor because spourious errors could have been raised (is a subcall inside
a handler made a wrong function call). The new scheme involves a wrapper
with a dummy function with the same signature as the original handler.
The wrapper then call the dummy function to check the arguments and catches
any TypeError in that NOP call. If an error is catched, it's translated to
a WrongArgumentError, if not, the real hanlder is called with that (now
knonw to be right) arguments.
Improve detection of bad arguments errors in dispatcher handlers.
The previos scheme was based on parsing TypeError messages, so it was very
poor because spourious errors could have been raised (is a subcall inside
a handler made a wrong function call). The new scheme involves a wrapper
with a dummy function with the same signature as the original handler.
The wrapper then call the dummy function to check the arguments and catches
any TypeError in that NOP call. If an error is catched, it's translated to
a WrongArgumentError, if not, the real hanlder is called with that (now
knonw to be right) arguments.
* procman:
Bugfix: set the catched signal to None *after* calling the signal handler.
Improve vrrp restorable defaults readability.
Use procman.restart() to restart vrrp service.
Add ProcessManager.restart() method to block until the restart is done.
Use procman to manage vrrp service.
Bugfix: raise a KeyError, don't return it.
Bugfix: call ProcessInfo.stop() in the right way (without parameters).
Bugfix: use self instead of an unbinded pi object when killing a process.
Remove unused ProcessInfo.last_return attribute.
Bugfix: use correct module for simbol ECHILD.
Handle SIGCHLD in PyminDaemon.
Add a global ProcessManager instance and functions to procman module.
Implement timer in PyminDaemon using EventLoop signal handling.
Support general signals handling in EventLoop.
Replace time.sleep() for signal.pause() in the ProcessManager test.
Improve ProcessManager to manage registerable named services.
Add a ProcessManager class to manage processes.
Improve ProcessManager to manage registerable named services.
Add a ProcessManager class to manage processes.
Merge branch 'master' of git.llucax.com.ar:/var/lib/git/software/pymin into logging
* 'master' of git.llucax.com.ar:/var/lib/git/software/pymin:
Add protocol specification of firewall and nat commands.
Added the protocol specification.
Root class inyects ip forwrading in constructor.
Added route handling capabilities and service restarting
Fix so that when a device is brought back up, the routes
Added support to hook services to IPHandler.
Support for inactive devices added in IPHandler.
Merge branch 'master' of git.llucax.com.ar:/var/lib/git/software/pymin into procman
* 'master' of git.llucax.com.ar:/var/lib/git/software/pymin:
Add protocol specification of firewall and nat commands.
Added the protocol specification.
Root class inyects ip forwrading in constructor.
Added route handling capabilities and service restarting
Fix so that when a device is brought back up, the routes
Added support to hook services to IPHandler.
Support for inactive devices added in IPHandler.
Remove ReturnNot0Error, use subprocess.check_call instead.
qos implementation (working)
qos template fixes
Nicolas Emiliani [Mon, 26 Nov 2007 12:52:34 +0000 (09:52 -0300)]
Added support to hook services to IPHandler.
A service that has to be restarted after detection
of a device bring up, can be hooked to do so by calling
the method device_up_hook. The service while be added to
the hook list only in case it has the attributes start
and stop.