3 commits - pykolab/auth wallace/__init__.py wallace/module_resources.py

Thomas Brüderli bruederli at kolabsys.com
Thu Oct 23 11:04:10 CEST 2014


 pykolab/auth/__init__.py    |    3 +++
 wallace/__init__.py         |    4 +---
 wallace/module_resources.py |   12 +++++-------
 3 files changed, 9 insertions(+), 10 deletions(-)

New commits:
commit 5a1f75bfef79a0c1f41d90e6562c33893f52d9ea
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Tue Oct 21 22:09:41 2014 +0200

    Skip recipient lookup if no iTip parts are found in the message

diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index 0eb4659..c9b5eef 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -112,7 +112,7 @@ def execute(*args, **kw):
         if not os.path.isdir(os.path.join(mybasepath, stage)):
             os.makedirs(os.path.join(mybasepath, stage))
 
-    log.debug(_("Resource Management called for %r, %r") % (args, kw), level=9)
+    log.debug(_("Resource Management called for %r, %r") % (args, kw), level=8)
 
     auth = Auth()
     imap = IMAP()
@@ -169,7 +169,7 @@ def execute(*args, **kw):
 
     any_itips = False
     any_resources = False
-    possibly_any_resources = True
+    possibly_any_resources = False
     reference_uid = None
 
     # An iTip message may contain multiple events. Later on, test if the message
@@ -197,11 +197,9 @@ def execute(*args, **kw):
 
     if any_itips:
         # See if any iTip actually allocates a resource.
-        if len([x['resources'] for x in itip_events if x.has_key('resources')]) == 0:
-            if len([x['attendees'] for x in itip_events if x.has_key('attendees')]) == 0:
-                possibly_any_resources = False
-        else:
-            possibly_any_resources = False
+        if len([x['resources'] for x in itip_events if x.has_key('resources')]) > 0 \
+            or len([x['attendees'] for x in itip_events if x.has_key('attendees')]) > 0:
+                possibly_any_resources = True
 
     if possibly_any_resources:
         auth.connect()


commit 36e6988b8ca4ecba317b8b13ceec52928586fdc0
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Tue Oct 21 22:08:30 2014 +0200

    Connect to LDAP if not yet done

diff --git a/pykolab/auth/__init__.py b/pykolab/auth/__init__.py
index 010ab9b..ac75118 100644
--- a/pykolab/auth/__init__.py
+++ b/pykolab/auth/__init__.py
@@ -200,6 +200,9 @@ class Auth(pykolab.base.Base):
         """
             Find one or more resources corresponding to the recipient address.
         """
+        if not self._auth or self._auth == None:
+            self.connect()
+
         result = self._auth.find_resource(address)
 
         if isinstance(result, list) and len(result) == 1:


commit ecdf5c764329d181c965dd40818b95d01ec0e48f
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Tue Oct 21 21:37:28 2014 +0200

    Remove hard-coded resources module and rely on config

diff --git a/wallace/__init__.py b/wallace/__init__.py
index 41db60a..6e41654 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -159,9 +159,7 @@ class WallaceDaemon(object):
 
         self.modules = conf.get_list('wallace', 'modules')
         if self.modules == None:
-            self.modules = ['resources']
-        elif not 'resources' in self.modules:
-            self.modules.append('resources')
+            self.modules = []
 
     def do_wallace(self):
         if version.StrictVersion(sys.version[:3]) >= version.StrictVersion("2.7"):




More information about the commits mailing list