summaryrefslogtreecommitdiffstats
path: root/wallace/module_optout.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-22 03:46:06 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-22 03:46:06 +0100
commit7184d5f07958887e500907d28a38659595ea62c6 (patch)
tree33d7a43e33fea241271a7413ed9b035e472e313e /wallace/module_optout.py
parentfd2cee5019d765fa28e1f2d9c33bd5c4af08c367 (diff)
downloadpykolab-7184d5f07958887e500907d28a38659595ea62c6.tar.gz
Create the necessary directories way after init
Diffstat (limited to 'wallace/module_optout.py')
-rw-r--r--wallace/module_optout.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/wallace/module_optout.py b/wallace/module_optout.py
index 1aedc7e..5540d80 100644
--- a/wallace/module_optout.py
+++ b/wallace/module_optout.py
@@ -41,15 +41,19 @@ conf = pykolab.getConf()
mybasepath = '/var/spool/pykolab/wallace/optout/'
def __init__():
- if not os.path.isdir(mybasepath):
- os.makedirs(mybasepath)
-
modules.register('optout', execute, description=description())
def description():
return """Consult the opt-out service."""
def execute(*args, **kw):
+ if not os.path.isdir(mybasepath):
+ os.makedirs(mybasepath)
+
+ for stage in ['incoming', 'ACCEPT', 'REJECT', 'HOLD', 'DEFER' ]:
+ if not os.path.isdir(os.path.join(mybasepath, stage)):
+ os.makedirs(os.path.join(mybasepath, stage))
+
# TODO: Test for correct call.
filepath = args[0]