]>
git.llucax.com Git - software/pymin.git/log
Leandro Lucarella [Tue, 24 Jun 2008 04:24:25 +0000 (01:24 -0300)]
Add validation to DhcpHandler (refs #20)
Leandro Lucarella [Sun, 22 Jun 2008 05:09:40 +0000 (02:09 -0300)]
Validate index on XxxSubHandler methods (#refs 20)
Leandro Lucarella [Wed, 25 Jun 2008 03:12:41 +0000 (00:12 -0300)]
Add common Int related validators (refs #20)
Is very common to validate a number that must be in the range of an
(unsigned) integer of 8/16/32/64 bits. Int8, UInt8, Int16, UInt16, Int32,
UInt32, Int64 and UInt64 are provided for that.
Leandro Lucarella [Tue, 24 Jun 2008 03:09:58 +0000 (00:09 -0300)]
Add IPAddress validator to pymin.validation (refs #20)
Leandro Lucarella [Tue, 24 Jun 2008 04:19:35 +0000 (01:19 -0300)]
Add host name related validators to pymin.validation (refs #20)
This add classes HostName and FullyQualifiedHostName.
Leandro Lucarella [Tue, 24 Jun 2008 03:11:06 +0000 (00:11 -0300)]
Improve and document UpOneOf validator (refs #20)
Leandro Lucarella [Sun, 22 Jun 2008 02:17:27 +0000 (23:17 -0300)]
Move common validation code to new pymin.validation module (refs #20)
This module includes all the validators from formencode plus some custom
validators specific to pymin.
Leandro Lucarella [Sat, 28 Jun 2008 04:50:39 +0000 (01:50 -0300)]
Use ip command to configure VPN networks in vpn service (closes #34)
Leandro Lucarella [Sat, 28 Jun 2008 04:45:08 +0000 (01:45 -0300)]
Use more meaningful names in Vpn items from vpn service (closes #35)
Leandro Lucarella [Sat, 28 Jun 2008 04:00:45 +0000 (01:00 -0300)]
Import HandlerError in vpn service handler (closes #32)
Leandro Lucarella [Sat, 28 Jun 2008 04:43:33 +0000 (01:43 -0300)]
Rearrange Host attributes from vpn service (closes #33)
The attribute names are named after the tinc configuration variables to
avoid confusion and the name of the host is now the HostHandler key.
Leandro Lucarella [Thu, 26 Jun 2008 00:39:37 +0000 (21:39 -0300)]
Add an example of regular attributes usage with a ValidatedClass
ValidatedClass were only used with Field instances as attributes.
Sometimes regular (not validated) attributes are needed.
Leandro Lucarella [Wed, 25 Jun 2008 03:06:17 +0000 (00:06 -0300)]
Call ComposedSubHandler._attr() with cont parameter (closes #31)
Leandro Lucarella [Sun, 22 Jun 2008 05:07:34 +0000 (02:07 -0300)]
Convert serializer data to unicode in PyminDaemon (closes #28).
Leandro Lucarella [Sat, 21 Jun 2008 00:36:21 +0000 (21:36 -0300)]
Remove invalid TODO comment in proxy host subhandler (closes #8).
DictSubHandler fits just fine for proxy host management.
Leandro Lucarella [Fri, 20 Jun 2008 21:06:02 +0000 (18:06 -0300)]
Split proxy handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:09:41 +0000 (01:09 -0300)]
Split vpn handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:00:38 +0000 (01:00 -0300)]
Split qos handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:05:36 +0000 (01:05 -0300)]
Split ppp handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:05:02 +0000 (01:05 -0300)]
Split ip handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:04:11 +0000 (01:04 -0300)]
Split nat handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:03:32 +0000 (01:03 -0300)]
Split firewall handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:03:01 +0000 (01:03 -0300)]
Split dns handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:02:15 +0000 (01:02 -0300)]
Split dhcp handler in submodules (refs #2).
Leandro Lucarella [Fri, 20 Jun 2008 04:12:05 +0000 (01:12 -0300)]
vrrp service code cleanup.
Leandro Lucarella [Fri, 20 Jun 2008 03:51:27 +0000 (00:51 -0300)]
Use standard Item*Error and Container*Error exceptions in QoS handler.
Leandro Lucarella [Fri, 20 Jun 2008 03:45:10 +0000 (00:45 -0300)]
Fix example configuration file for development.
ppp configuration was broken because the name of the service were used
twice in the path where to store the configuration files.
Leandro Lucarella [Thu, 19 Jun 2008 03:29:25 +0000 (00:29 -0300)]
Add example configuration files for initialization logging (refs #7).
Includes both development and production examples.
Leandro Lucarella [Thu, 19 Jun 2008 03:28:50 +0000 (00:28 -0300)]
Add initialization logging configuration customization (refs #7).
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.
Leandro Lucarella [Thu, 19 Jun 2008 01:29:47 +0000 (22:29 -0300)]
Add an example production logging configuration file (refs #7).
Leandro Lucarella [Thu, 19 Jun 2008 01:29:24 +0000 (22:29 -0300)]
Add an example development logging configuration file (refs #7).
Leandro Lucarella [Thu, 19 Jun 2008 01:17:42 +0000 (22:17 -0300)]
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).
Leandro Lucarella [Thu, 19 Jun 2008 03:32:25 +0000 (00:32 -0300)]
Add logging configuration capabilities (closes #7).
Add an option (log-config-files) to specify logging (standard Python's)
configuration files to use to configure the logging system.
Leandro Lucarella [Wed, 18 Jun 2008 03:40:53 +0000 (00:40 -0300)]
Shutdown logging properly when exiting pymind.
Leandro Lucarella [Tue, 17 Jun 2008 03:53:51 +0000 (00:53 -0300)]
Add die() function to pymind for fatal errors.
Leandro Lucarella [Tue, 17 Jun 2008 03:46:25 +0000 (00:46 -0300)]
Use critical as the log level for fatal errors in pymind.
Leandro Lucarella [Thu, 19 Jun 2008 01:39:29 +0000 (22:39 -0300)]
Move ip_forward activation to a function.
This has to go away, but for now put it in a function and evaluate it just
before we start serving requests.
Leandro Lucarella [Mon, 19 May 2008 02:11:53 +0000 (23:11 -0300)]
Remove configuration examples.
Leandro Lucarella [Mon, 16 Jun 2008 23:39:38 +0000 (20:39 -0300)]
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.
This closes #3, closes #4 and closes #6.
Leandro Lucarella [Mon, 16 Jun 2008 21:49:15 +0000 (18:49 -0300)]
Move logging module setup to pymind.
logging module setup should go in a configuration file, but for now we
keep it in the pymind program to leave things functional until then.
Leandro Lucarella [Mon, 16 Jun 2008 21:44:06 +0000 (18:44 -0300)]
Move ip_forward activation from config to pymind.
This should go away anyways (either documenting that that feature should
be enabled before pymind starts or by moving it to the IP service).
Leandro Lucarella [Mon, 16 Jun 2008 21:39:36 +0000 (18:39 -0300)]
Use logging module to report errors in pymind.
Leandro Lucarella [Mon, 16 Jun 2008 21:35:01 +0000 (18:35 -0300)]
Use a nice name for exit status.
Leandro Lucarella [Mon, 16 Jun 2008 20:03:41 +0000 (17:03 -0300)]
Remove plug-in code from handler module in services (refs #27).
Leandro Lucarella [Mon, 16 Jun 2008 20:01:05 +0000 (17:01 -0300)]
Cosmetic changes to service's imports.
Leandro Lucarella [Mon, 16 Jun 2008 19:52:07 +0000 (16:52 -0300)]
Split plug-in code from handler code for services (refs #27).
Leandro Lucarella [Mon, 16 Jun 2008 19:37:10 +0000 (16:37 -0300)]
Add logging to pymin.service module (refs #27).
Leandro Lucarella [Mon, 16 Jun 2008 19:26:44 +0000 (16:26 -0300)]
Move services outside the "static" pymin modules structure (refs #27).
Leandro Lucarella [Mon, 16 Jun 2008 18:43:45 +0000 (15:43 -0300)]
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.
Leandro Lucarella [Mon, 26 May 2008 02:08:04 +0000 (23:08 -0300)]
Fix a typo in a log message format in VrrpHandler (closes #26).
Leandro Lucarella [Sun, 25 May 2008 02:28:53 +0000 (23:28 -0300)]
Fix procman.ProcessInfo.__repr__() (refs #11).
Callback could be "dereferenced" even being None.
Leandro Lucarella [Sun, 25 May 2008 02:27:22 +0000 (23:27 -0300)]
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 (13:40 -0300)]
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 (01:13 -0300)]
Make procman.ProcessInfo.error_count a read-only property.
Leandro Lucarella [Tue, 20 May 2008 04:28:13 +0000 (01:28 -0300)]
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 (01:11 -0300)]
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 (23:21 -0300)]
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 (00:42 -0300)]
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 (00:24 -0300)]
Make procman.ProcessInfo.process a read-only property.
Leandro Lucarella [Mon, 19 May 2008 02:20:24 +0000 (23:20 -0300)]
Mark procman.ProcessInfo.signal as private.
Leandro Lucarella [Mon, 19 May 2008 02:19:56 +0000 (23:19 -0300)]
Mark procman.ProcessInfo.dont_run as private.
Leandro Lucarella [Mon, 19 May 2008 02:17:28 +0000 (23:17 -0300)]
Make procman.ProcessInfo.name a read-only property.
Leandro Lucarella [Sat, 17 May 2008 17:11:21 +0000 (14:11 -0300)]
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 (02:36 -0300)]
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 (02:08 -0300)]
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 (01:36 -0300)]
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 (01:33 -0300)]
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 (00:09 -0300)]
Improve procman testcase.
Leandro Lucarella [Sat, 17 May 2008 04:30:35 +0000 (01:30 -0300)]
Tidy procman.ProcessInfo constructor related arguments.
Leandro Lucarella [Fri, 16 May 2008 21:59:53 +0000 (18:59 -0300)]
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 (21:08 -0300)]
Fix ConfigWriter class documentation.
Leandro Lucarella [Thu, 15 May 2008 00:07:25 +0000 (21:07 -0300)]
Remove imports for unused modules.
Leandro Lucarella [Mon, 12 May 2008 15:45:38 +0000 (12:45 -0300)]
Use the "virual deletion" facilities from XxxSubHandler (fixes #23).
Leandro Lucarella [Mon, 12 May 2008 15:32:24 +0000 (12:32 -0300)]
Give a nice error if a VPN key can't be readed (refs #22).
Leandro Lucarella [Mon, 12 May 2008 15:12:00 +0000 (12:12 -0300)]
Remove duplicated code.
Leandro Lucarella [Mon, 12 May 2008 15:29:53 +0000 (12:29 -0300)]
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 (13:23 -0300)]
Convert to unicode before encoding to UTF-8 in firewall template (fixes #16).
Leandro Lucarella [Sat, 10 May 2008 22:06:04 +0000 (19:06 -0300)]
Don't override the ListSubHandler.delete() method in HopHandler (fixes #19).
Leandro Lucarella [Sat, 10 May 2008 04:28:22 +0000 (01:28 -0300)]
Use the ContainerSubHandler._attr method as a method (fixes #18).
Leandro Lucarella [Sat, 10 May 2008 03:55:59 +0000 (00:55 -0300)]
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 (22:57 -0300)]
Remove TODO list (moved to issues tracker).
Leandro Lucarella [Thu, 3 Jan 2008 09:15:28 +0000 (07:15 -0200)]
Convert Rule to Item for validation in firewall service handler.
Leandro Lucarella [Wed, 2 Jan 2008 02:33:14 +0000 (00:33 -0200)]
Bugfix: use index/key to report ItemAlreadyExistsError.
Leandro Lucarella [Wed, 2 Jan 2008 02:32:22 +0000 (00:32 -0200)]
Remove unused formencode validators imports.
Leandro Lucarella [Wed, 2 Jan 2008 02:31:38 +0000 (00:31 -0200)]
Add __all__ to pymin.item.
Leandro Lucarella [Wed, 2 Jan 2008 02:31:24 +0000 (00:31 -0200)]
Bugfix: replace __ALL__ with the correct __all__.
Leandro Lucarella [Tue, 1 Jan 2008 04:59:59 +0000 (02:59 -0200)]
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 (17:36 -0200)]
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 (16:37 -0200)]
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 (15:08 -0200)]
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 (14:38 -0200)]
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 (13:32 -0200)]
Bugfix: don't call the handler twice.
Leandro Lucarella [Mon, 31 Dec 2007 01:59:30 +0000 (23:59 -0200)]
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 (21:17 -0200)]
Move handler decorator help checking to avoid an extra level in the stack trace.
Leandro Lucarella [Sat, 29 Dec 2007 05:41:37 +0000 (02:41 -0300)]
Add an INSTALL file, at least to keep track of the dependencies.
Leandro Lucarella [Sat, 29 Dec 2007 05:40:17 +0000 (02:40 -0300)]
Bugfix: fix pymin.serializer test case import.
Leandro Lucarella [Sat, 29 Dec 2007 05:30:36 +0000 (02:30 -0300)]
Add pymin.item module.
Leandro Lucarella [Sat, 29 Dec 2007 05:20:25 +0000 (02:20 -0300)]
Add pymin.validatedclass module.
Leandro Lucarella [Thu, 27 Dec 2007 15:53:47 +0000 (12:53 -0300)]
Add logging support to procman module.
Leandro Lucarella [Thu, 27 Dec 2007 15:53:10 +0000 (12:53 -0300)]
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