Before user logging configuration can be loaded, pymin already can emit a
lot of logging information. This patch provides a way to customize the
logging configuration before the standard configuration framework take
place.
By default, it tries to read /etc/pymind/log.init.ini configuration file,
unless PYMIND_LOGINITCONF environment variable is set, in which case the
file specified by that variable it readed. If it fails to load the
configuration file, it use a reasonble default.
This is mostly useful for debugging/development purposes.
Hack to overcome Python's bug 3136 in logging system (refs #7).
logging.config.fileConfig() disables all existing loggers that are not
configured using the config file. This hack re-enable the loggers so
everything works as expected even when you don't specify *all* the loggers
in the configuration files (and child loggers really inherits their parent
configuration).
Add configuration and command-line option framework.
The new pymin.config module integrates both ConfigParser and optparse
Python modules, adding variables validation throw formencode library and
hooks for plug-ins to add options in run-time.
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