Leandro Lucarella [Mon, 16 Jun 2008 18:57:51 +0000]
Simplify configuration to expose the Python's bug.
Leandro Lucarella [Mon, 16 Jun 2008 18:43:45 +0000]
Use a plug-in architecture for services.
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.
Leandro Lucarella [Mon, 26 May 2008 02:08:04 +0000]
Fix a typo in a log message format in VrrpHandler (closes #26).
Leandro Lucarella [Sun, 25 May 2008 02:28:53 +0000]
Fix procman.ProcessInfo.__repr__() (refs #11).
Callback could be "dereferenced" even being None.
Leandro Lucarella [Sun, 25 May 2008 02:27:22 +0000]
Make procman.ProcessManager accept a ProcessInfo as argument (refs #11).
Methods register(), unregister(), once(), start(), stop(), restart() and
kill() now accept a ProcessInfo as the *name* argument.
Leandro Lucarella [Wed, 21 May 2008 16:40:59 +0000]
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.
Leandro Lucarella [Wed, 21 May 2008 04:13:47 +0000]
Make procman.ProcessInfo.error_count a read-only property.
Leandro Lucarella [Tue, 20 May 2008 04:28:13 +0000]
Make procman.ProcessManager.restart(p) update pidmap when p was running.
pidmap was not updated, so extrange things could happen. A testcase was
added too.
Leandro Lucarella [Tue, 20 May 2008 04:11:57 +0000]
procman.ProcessManager.restart(p) call start(p) when p was not running.
Otherwise, the namemap and pidmap are not updated.
Leandro Lucarella [Tue, 20 May 2008 02:21:00 +0000]
Make some procman.ProcessManager's methods return the ProcessInfo instance.
Now registar(), unregister() and once() procman.ProcessManager's methods
returns the ProcessInfo instance just created/removed.
Leandro Lucarella [Mon, 19 May 2008 03:42:52 +0000]
Make magic methods of procman.ProcessManager aliases of normal methods.
Add a simple testcase too.
Leandro Lucarella [Mon, 19 May 2008 03:24:27 +0000]
Make procman.ProcessInfo.process a read-only property.
Leandro Lucarella [Mon, 19 May 2008 02:20:24 +0000]
Mark procman.ProcessInfo.signal as private.
Leandro Lucarella [Mon, 19 May 2008 02:19:56 +0000]
Mark procman.ProcessInfo.dont_run as private.
Leandro Lucarella [Mon, 19 May 2008 02:17:28 +0000]
Make procman.ProcessInfo.name a read-only property.
Leandro Lucarella [Sat, 17 May 2008 17:11:21 +0000]
Rename procman.ProcessManager.call to once.
call made not very clear that the process didn't remain registered.
Leandro Lucarella [Sat, 17 May 2008 05:36:46 +0000]
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.
Leandro Lucarella [Sat, 17 May 2008 05:08:43 +0000]
Change ProcessInfo.running to a read-only property.
It's dumb to duplicate that state when it can be more reliably obtained
using Popen.poll().
Add some checks to the testcase too.
Leandro Lucarella [Sat, 17 May 2008 04:36:34 +0000]
Add an example of process waiting to testcase.
This provides an example on how to access to the subprocess.Popen
associated to a procman.ProcessInfo object.
Leandro Lucarella [Sat, 17 May 2008 04:33:39 +0000]
Call wait() on the Popen object instead of the ProcessInfo object.
This should fix ProcessManager.restart() method, so we add it as a global
function too.
Leandro Lucarella [Sat, 17 May 2008 03:09:52 +0000]
Improve procman testcase.
Leandro Lucarella [Sat, 17 May 2008 04:30:35 +0000]
Tidy procman.ProcessInfo constructor related arguments.
Leandro Lucarella [Fri, 16 May 2008 21:59:53 +0000]
Catch exception when trying to write /proc/.../ip_forward in the config file.
This way pymind can be used by non-root users.
Leandro Lucarella [Thu, 15 May 2008 00:08:05 +0000]
Fix ConfigWriter class documentation.
Leandro Lucarella [Thu, 15 May 2008 00:07:25 +0000]
Remove imports for unused modules.
Leandro Lucarella [Mon, 12 May 2008 15:45:38 +0000]
Use the "virual deletion" facilities from XxxSubHandler (fixes #23).
Leandro Lucarella [Mon, 12 May 2008 15:32:24 +0000]
Give a nice error if a VPN key can't be readed (refs #22).
Leandro Lucarella [Mon, 12 May 2008 15:12:00 +0000]
Remove duplicated code.
Leandro Lucarella [Mon, 12 May 2008 15:29:53 +0000]
Use os.makedirs to create directories instead of exec mkdir (refs #22).
Also check for errors creating the new diretory.
Leandro Lucarella [Sun, 11 May 2008 16:23:36 +0000]
Convert to unicode before encoding to UTF-8 in firewall template (fixes #16).
Leandro Lucarella [Sat, 10 May 2008 22:06:04 +0000]
Don't override the ListSubHandler.delete() method in HopHandler (fixes #19).
Leandro Lucarella [Sat, 10 May 2008 04:28:22 +0000]
Use the ContainerSubHandler._attr method as a method (fixes #18).
Leandro Lucarella [Sat, 10 May 2008 03:55:59 +0000]
Convert HopHandler to a ListSubHandler (fixes #15, fixes #12).
HopHandler was doing all the dirty job in the old fashion. Now it inherits
from ListSubHandler, adding code only for the custom checks.
Leandro Lucarella [Thu, 8 May 2008 01:57:45 +0000]
Remove TODO list (moved to issues tracker).
Leandro Lucarella [Thu, 3 Jan 2008 09:15:28 +0000]
Convert Rule to Item for validation in firewall service handler.
Leandro Lucarella [Wed, 2 Jan 2008 02:33:14 +0000]
Bugfix: use index/key to report ItemAlreadyExistsError.
Leandro Lucarella [Wed, 2 Jan 2008 02:32:22 +0000]
Remove unused formencode validators imports.
Leandro Lucarella [Wed, 2 Jan 2008 02:31:38 +0000]
Add __all__ to pymin.item.
Leandro Lucarella [Wed, 2 Jan 2008 02:31:24 +0000]
Bugfix: replace __ALL__ with the correct __all__.
Leandro Lucarella [Tue, 1 Jan 2008 04:59:59 +0000]
Merge branch 'master' of git.llucax.com.ar:/var/lib/git/software/pymin
* 'master' of git.llucax.com.ar:/var/lib/git/software/pymin:
Improve detection of bad arguments errors in dispatcher handlers.
Leandro Lucarella [Mon, 31 Dec 2007 19:36:52 +0000]
Prepare pymindaemon to handle formencode.Invalid exceptions.
Now the pymindaemon can handle 2 kind of exceptions as "expected":
dispatcher.Error and formencode.Invalid.
The documentation and testcases has been improved.
Leandro Lucarella [Mon, 31 Dec 2007 18:37:22 +0000]
Improve description parsing again the TypeError.
Now the parsing is done in the WrongArgumentsError class, improving the
encapsulation. The parsing is improved too, to detect more errors.
Leandro Lucarella [Mon, 31 Dec 2007 17:08:45 +0000]
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.
Testcases were updated and extended too.
Leandro Lucarella [Mon, 31 Dec 2007 16:38:12 +0000]
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.
Testcases were updated and extended too.
Leandro Lucarella [Mon, 31 Dec 2007 15:32:02 +0000]
Bugfix: don't call the handler twice.
Leandro Lucarella [Mon, 31 Dec 2007 01:59:30 +0000]
Merge branch 'master' of git.llucax.com.ar:/var/lib/git/software/pymin
* 'master' of git.llucax.com.ar:/var/lib/git/software/pymin:
Move handler decorator help checking to avoid an extra level in the stack trace.
Leandro Lucarella [Sun, 30 Dec 2007 23:17:56 +0000]
Move handler decorator help checking to avoid an extra level in the stack trace.
Leandro Lucarella [Sat, 29 Dec 2007 05:41:37 +0000]
Add an INSTALL file, at least to keep track of the dependencies.
Leandro Lucarella [Sat, 29 Dec 2007 05:40:17 +0000]
Bugfix: fix pymin.serializer test case import.
Leandro Lucarella [Sat, 29 Dec 2007 05:30:36 +0000]
Add pymin.item module.
Leandro Lucarella [Sat, 29 Dec 2007 05:20:25 +0000]
Add pymin.validatedclass module.
Leandro Lucarella [Thu, 27 Dec 2007 15:53:47 +0000]
Add logging support to procman module.
Leandro Lucarella [Thu, 27 Dec 2007 15:53:10 +0000]
Merge branch 'procman'
* 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.
Conflicts:
pymin/eventloop.py
pymin/pymindaemon.py
pymin/services/vrrp/__init__.py
Leandro Lucarella [Mon, 24 Dec 2007 05:24:38 +0000]
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.
Conflicts:
pymin/services/ip/__init__.py
Leandro Lucarella [Mon, 24 Dec 2007 05:07:33 +0000]
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
Leandro Lucarella [Wed, 19 Dec 2007 17:41:39 +0000]
Merge branch 'master' of git.llucax.com.ar:/var/lib/git/software/pymin
Leandro Lucarella [Wed, 19 Dec 2007 17:37:43 +0000]
Merge commit 'llucax/logging' into logging
Conflicts:
config.py
pymin/pymindaemon.py
Leandro Lucarella [Wed, 19 Dec 2007 17:28:28 +0000]
Merge commit 'scm/master'
Leandro Lucarella [Wed, 19 Dec 2007 17:24:10 +0000]
Merge branch 'master' of baryon.com.ar:/home/luca/pymin
Conflicts:
config.py
Leandro Lucarella [Wed, 19 Dec 2007 17:22:43 +0000]
Add protocol specification of firewall and nat commands.
Nicolas Emiliani [Mon, 17 Dec 2007 19:30:18 +0000]
Added the protocol specification.
Nicolas Emiliani [Wed, 5 Dec 2007 15:57:36 +0000]
Root class inyects ip forwrading in constructor.
or3st3s [Mon, 3 Dec 2007 18:11:12 +0000]
Added route handling capabilities and service restarting
upon device events such as up and down.
or3st3s [Sat, 1 Dec 2007 12:10:50 +0000]
Fix so that when a device is brought back up, the routes
asociated to it get brought up too.
Nicolas Emiliani [Mon, 26 Nov 2007 12:52:34 +0000]
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.
or3st3s [Sun, 25 Nov 2007 11:03:37 +0000]
Support for inactive devices added in IPHandler.
Leandro Lucarella [Sun, 18 Nov 2007 18:56:21 +0000]
Add logging to pymin.eventloop module.
Leandro Lucarella [Sun, 18 Nov 2007 18:16:26 +0000]
Bugfix: set the catched signal to None *after* calling the signal handler.
Leandro Lucarella [Sun, 18 Nov 2007 18:13:36 +0000]
Improve vrrp restorable defaults readability.
Leandro Lucarella [Sun, 18 Nov 2007 18:12:57 +0000]
Use procman.restart() to restart vrrp service.
Leandro Lucarella [Sun, 18 Nov 2007 18:12:07 +0000]
Add ProcessManager.restart() method to block until the restart is done.
Leandro Lucarella [Sun, 18 Nov 2007 05:53:14 +0000]
Add logging to pymin.services.vrrp module.
Leandro Lucarella [Sun, 18 Nov 2007 05:53:06 +0000]
Add logging to pymin.services.vpn module.
Leandro Lucarella [Sun, 18 Nov 2007 05:52:58 +0000]
Add logging to pymin.services.proxy module.
Leandro Lucarella [Sun, 18 Nov 2007 05:52:52 +0000]
Add logging to pymin.services.ppp module.
Leandro Lucarella [Sun, 18 Nov 2007 05:52:41 +0000]
Add logging to pymin.services.nat module.
Leandro Lucarella [Sun, 18 Nov 2007 05:52:33 +0000]
Add logging to pymin.services.ip module.
Leandro Lucarella [Sun, 18 Nov 2007 05:52:22 +0000]
Add logging to pymin.services.firewall module.
Leandro Lucarella [Sun, 18 Nov 2007 05:52:13 +0000]
Add logging to pymin.services.dns module.
Leandro Lucarella [Sun, 18 Nov 2007 05:52:03 +0000]
Add logging to pymin.services.dhcp module.
Leandro Lucarella [Sun, 18 Nov 2007 05:51:10 +0000]
Add logging to pymin.services.util module.
Leandro Lucarella [Sat, 17 Nov 2007 22:40:13 +0000]
Add logging to pymin.dispatcher module.
Leandro Lucarella [Sat, 17 Nov 2007 22:39:52 +0000]
Improve logging format.
Leandro Lucarella [Sat, 17 Nov 2007 22:31:32 +0000]
Use %r instead of %s for logging.
Leandro Lucarella [Fri, 16 Nov 2007 19:50:12 +0000]
Add basic initial logging support.
Federico Cuello [Tue, 13 Nov 2007 02:06:03 +0000]
qos implementation (working)
Federico Cuello [Tue, 13 Nov 2007 01:16:19 +0000]
qos template fixes
Leandro Lucarella [Sun, 18 Nov 2007 02:38:21 +0000]
Remove ReturnNot0Error, use subprocess.check_call instead.
Leandro Lucarella [Fri, 16 Nov 2007 19:50:12 +0000]
Add basic initial logging support.
Leandro Lucarella [Thu, 15 Nov 2007 12:59:40 +0000]
Use procman to manage vrrp service.
Leandro Lucarella [Thu, 15 Nov 2007 12:58:57 +0000]
Bugfix: raise a KeyError, don't return it.
Leandro Lucarella [Thu, 15 Nov 2007 12:58:20 +0000]
Bugfix: call ProcessInfo.stop() in the right way (without parameters).
Leandro Lucarella [Thu, 15 Nov 2007 12:57:34 +0000]
Bugfix: use self instead of an unbinded pi object when killing a process.
Leandro Lucarella [Wed, 14 Nov 2007 15:27:43 +0000]
Merge commit 'scm/master'
Leandro Lucarella [Wed, 14 Nov 2007 15:26:39 +0000]
Merge commit 'nico-baryon/master'
Leandro Lucarella [Tue, 13 Nov 2007 19:25:45 +0000]
Remove unused ProcessInfo.last_return attribute.
Leandro Lucarella [Tue, 13 Nov 2007 18:24:17 +0000]
Bugfix: use correct module for simbol ECHILD.
Leandro Lucarella [Tue, 13 Nov 2007 18:22:10 +0000]
Handle SIGCHLD in PyminDaemon.
Leandro Lucarella [Tue, 13 Nov 2007 17:18:53 +0000]
Add a global ProcessManager instance and functions to procman module.
Leandro Lucarella [Tue, 13 Nov 2007 03:54:06 +0000]
Merge branch 'procman' of baryon.com.ar:/home/luca/pymin into procman
Conflicts:
pymin/procman.py
nothing to commit (working directory clean)