6 commits - kolab/__init__.py kolab/Makefile.am Makefile.am pykolab/setup wallace/__init__.py wallace/module_resources.py wallace/modules.py

Jeroen van Meeuwen vanmeeuwen at kolabsys.com
Tue Mar 4 13:25:45 CET 2014


 Makefile.am                  |    1 -
 kolab/Makefile.am            |    2 --
 kolab/__init__.py            |    1 -
 pykolab/setup/setup_mysql.py |    8 ++++----
 wallace/__init__.py          |    6 +++++-
 wallace/module_resources.py  |   18 ++++++++++++------
 wallace/modules.py           |    4 ++--
 7 files changed, 23 insertions(+), 17 deletions(-)

New commits:
commit b8e3042daddd8a77d97080ed61eb0f135817ce79
Merge: 4c57206 dd711f0
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Mar 4 13:25:37 2014 +0100

    Merge branch 'master' of ssh://git.kolabsys.com/git/pykolab



commit 4c572065c63e3bb830070ab71583e349cc109455
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Mar 4 13:25:17 2014 +0100

    The appending of a comment after a line-continuation character is not
    legal syntax

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:


commit 8fcd6441ed755f5ae81a6d9e5b6ec6ef3fab8393
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Mar 4 13:25:01 2014 +0100

    Take a result from modules being executed seriously

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)


commit 49a35d7e3710bb47ba8fdab9ec81bfc1ebf37a6b
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Mar 4 13:24:21 2014 +0100

    A little more verbosity on modules configured not available

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)


commit aff739d30fb9eb530aaf9949bf0ede61cbe25860
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Mar 4 13:23:50 2014 +0100

    Skip checking for resource (collection) records for recipients not in local domains

diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index b718ac4..e089c41 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -126,7 +126,7 @@ def execute(*args, **kw):
                         )
                 )
 
-            return
+            return filepath
     else:
         # Move to incoming
         new_filepath = os.path.join(
@@ -186,19 +186,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
@@ -672,6 +670,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


commit f288329dde656601a671234e0674fe33b5fbb98b
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date:   Tue Mar 4 13:11:39 2014 +0100

    Remove kolab/

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 *




More information about the commits mailing list