summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rw-r--r--kolab/Makefile.am2
-rw-r--r--kolab/__init__.py1
-rw-r--r--pykolab/setup/setup_mysql.py8
-rw-r--r--wallace/__init__.py6
-rw-r--r--wallace/module_resources.py18
-rw-r--r--wallace/modules.py4
7 files changed, 23 insertions, 17 deletions
diff --git a/Makefile.am b/Makefile.am
index 954744d..83f9d02 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,7 +39,6 @@ EXTRA_DIST = \
SUBDIRS = \
conf \
- kolab \
kolabd \
po \
pykolab \
diff --git a/kolab/Makefile.am b/kolab/Makefile.am
deleted file mode 100644
index 383d8f7..0000000
--- a/kolab/Makefile.am
+++ /dev/null
@@ -1,2 +0,0 @@
-kolabdir = $(pythondir)/kolab
-kolab_PYTHON = $(wildcard *.py)
diff --git a/kolab/__init__.py b/kolab/__init__.py
deleted file mode 100644
index a136346..0000000
--- a/kolab/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from pykolab.constants import *
diff --git a/pykolab/setup/setup_mysql.py b/pykolab/setup/setup_mysql.py
index 36a0bec..586e134 100644
--- a/pykolab/setup/setup_mysql.py
+++ b/pykolab/setup/setup_mysql.py
@@ -64,10 +64,10 @@ def execute(*args, **kw):
}
answer = 0
- if os.path.exists('/var/lib/mysql/mysql.sock') or \ # Regular old-fashioned Enterprise Linux
- os.path.exists('/var/run/mysqld/mysqld.sock') or \ # Debian
- os.path.exists('/var/run/mysql/mysql.sock') or \ # (open)SUSE
- os.path.exists('/var/run/mysqld/mysqld.pid'): # "Unbreakable" Linux from Oracle
+ if os.path.exists('/var/lib/mysql/mysql.sock') or \
+ os.path.exists('/var/run/mysqld/mysqld.sock') or \
+ os.path.exists('/var/run/mysql/mysql.sock') or \
+ os.path.exists('/var/run/mysqld/mysqld.pid'):
answer = utils.ask_menu(_("What MySQL server are we setting up?"), options)
if answer == "1" or answer == 1:
diff --git a/wallace/__init__.py b/wallace/__init__.py
index 084425e..be23ffa 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -48,6 +48,8 @@ def pickup_message(filepath, *args, **kw):
# Cause the previous modules to be skipped
wallace_modules = wallace_modules[(wallace_modules.index(kw['module'])+1):]
+ log.debug(_("Wallace modules: %r") % (wallace_modules), level=8)
+
# Execute the module
if kw.has_key('stage'):
modules.execute(kw['module'], filepath, stage=kw['stage'])
@@ -55,7 +57,9 @@ def pickup_message(filepath, *args, **kw):
modules.execute(kw['module'], filepath)
for module in wallace_modules:
- filepath = modules.execute(module, filepath)
+ result_filepath = modules.execute(module, filepath)
+ if not result_filepath == None and not result_filepath == False:
+ filepath = result_filepath
def worker_process(*args, **kw):
log.debug(_("Worker process %s initializing") % (multiprocessing.current_process().name), level=1)
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index f4940ea..bc76dd4 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -127,7 +127,7 @@ def execute(*args, **kw):
)
)
- return
+ return filepath
else:
# Move to incoming
new_filepath = os.path.join(
@@ -187,19 +187,17 @@ def execute(*args, **kw):
if not any_itips:
log.debug(_("Not an iTip message, but sent to resource nonetheless. Reject message"), level=5)
reject(filepath)
- return
+ return False
else:
# Continue. Resources and iTips. We like.
pass
else:
if not any_itips:
log.debug(_("No itips, no resources, pass along"), level=5)
- accept(filepath)
- return
+ return filepath
else:
log.debug(_("iTips, but no resources, pass along"), level=5)
- accept(filepath)
- return
+ return filepath
# A simple list of merely resource entry IDs that hold any relevance to the
# iTip events
@@ -701,6 +699,14 @@ def resource_record_from_email_address(email_address):
resource_records = []
+ local_domains = auth.list_domains()
+
+ if not local_domains == None:
+ local_domains = list(set(local_domains.keys()))
+
+ if not email_address.split('@')[1] in local_domains:
+ return []
+
log.debug(
_("Checking if email address %r belongs to a resource (collection)") % (email_address),
level=8
diff --git a/wallace/modules.py b/wallace/modules.py
index 861da75..b3de82e 100644
--- a/wallace/modules.py
+++ b/wallace/modules.py
@@ -105,12 +105,12 @@ def list_modules(*args, **kw):
def execute(name, *args, **kw):
if not modules.has_key(name):
- log.error(_("No such module."))
+ log.error(_("No such module %r in modules %r (1).") % (name, modules))
sys.exit(1)
if not modules[name].has_key('function') and \
not modules[name].has_key('group'):
- log.error(_("No such module."))
+ log.error(_("No such module %r in modules %r (2).") %(name, modules))
sys.exit(1)
modules[name]['function'](*args, **kw)