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.
Now the EventLoop has no support for timers but have general signals
handling support. Signals to be handled can be specified in the constructor
or by calling set_signal() method. Stop handling a particular type of
signals is supported too by calling to the unset_signal() method.
A callback can be specified for each type of signal, or all signal handling
can be done in the handle_signal() method, if overriden by EventLoop
subclasses.
Improve ProcessManager to manage registerable named services.
Besides call, now ProcessManager can register (and unregister) named
services. Once registered, they can be started and stopped (or killed if
multiple stop are issued before the process actually dies) at will, just
like regular processes. Processes can be signaled too.
Improve ProcessManager to manage registerable named services.
Besides call, now ProcessManager can register (and unregister) named
services. Once registered, they can be started and stopped (or killed if
multiple stop are issued before the process actually dies) at will, just
like regular processes. Processes can be signaled too.
Nicolas Emiliani [Mon, 12 Nov 2007 13:42:29 +0000 (10:42 -0300)]
Hack for DNS timer_handle added.
The hack consists in redifinig de timer_handle because
the generic one that was used to check if the process was running
returned a pid that did not belong with the process wanted (named),
that was due to teh fact that named is in a path used to execute
an option of the syslog deamon.
Nicolas Emiliani [Thu, 25 Oct 2007 14:54:54 +0000 (11:54 -0300)]
Verificacion de interfaces usando handle_timer().
En util.py se corrige get_network_devices para que
levante los link/ppp.
En ip/__init__.py se agrega refresh_devices para que
a travez del handle_timer se puedan agregar los devices
que se registran a travez del commando ppp y tambien
se borren los devices caidos.
Add support for a simple timer to do periodic tasks.
Base support is on EventLoop, who handles the timer
life and calls handle_timer() when the timer is
expired. dispatcher.Handler has a simple default
handle_timer() implementation that just promote the
"handle_timer message" to all subhandlers, while
PyDaemon just start "spreading the voice" by calling
the root handler handle_timer() method.