5 commits - pykolab/cli pykolab/wap_client wallace/__init__.py
Jeroen van Meeuwen
vanmeeuwen at kolabsys.com
Fri Nov 14 11:58:16 CET 2014
pykolab/cli/cmd_set_quota.py | 11 ++++-------
pykolab/wap_client/__init__.py | 7 +++++--
wallace/__init__.py | 20 ++++++++++----------
3 files changed, 19 insertions(+), 19 deletions(-)
New commits:
commit 1894cee7e7b677b7002c16fe23dd8941574479bc
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Fri Nov 14 11:57:53 2014 +0100
Add a function ou_edit()
diff --git a/pykolab/wap_client/__init__.py b/pykolab/wap_client/__init__.py
index 1bd2b16..e74ed59 100644
--- a/pykolab/wap_client/__init__.py
+++ b/pykolab/wap_client/__init__.py
@@ -350,6 +350,9 @@ def ou_add(params={}):
def ou_delete(params={}):
return request('POST', 'ou.delete', post=json.dumps(params))
+def ou_edit(params={}):
+ return request('POST', 'ou.edit', post=json.dumps(params))
+
def ou_find(params=None):
post = { 'search': { 'params': {} } }
commit 12b04f4943959c406620b9f1b87e0621aaf4b9d2
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Nov 13 22:39:26 2014 +0100
Drop import for binascii
diff --git a/wallace/__init__.py b/wallace/__init__.py
index d2cf873..d5cfae3 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -18,7 +18,6 @@
#
import asyncore
-import binascii
from distutils import version
import grp
import multiprocessing
commit 639649d9730da7403abcf54e254096aba840c175
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Nov 13 22:35:52 2014 +0100
Make the number of threads to use a configurable option
diff --git a/wallace/__init__.py b/wallace/__init__.py
index fc11b62..d2cf873 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -42,13 +42,6 @@ conf = pykolab.getConf()
from modules import cb_action_ACCEPT
-#conf.finalize_conf()
-#if conf.debuglevel > 8:
-# max_threads = 1
-#else:
-# max_threads = 24
-max_threads = 24
-
def pickup_message(filepath, *args, **kw):
wallace_modules = args[0]
if kw.has_key('module'):
@@ -141,6 +134,14 @@ class WallaceDaemon(object):
)
daemon_group.add_option(
+ "--threads",
+ dest = "max_threads",
+ action = "store",
+ default = 24,
+ help = _("Number of threads to use.")
+ )
+
+ daemon_group.add_option(
"-p", "--pid-file",
dest = "pidfile",
action = "store",
@@ -183,9 +184,9 @@ class WallaceDaemon(object):
def do_wallace(self):
if version.StrictVersion(sys.version[:3]) >= version.StrictVersion("2.7"):
- self.pool = multiprocessing.Pool(max_threads, worker_process, (), 1)
+ self.pool = multiprocessing.Pool(conf.max_threads, worker_process, (), 1)
else:
- self.pool = multiprocessing.Pool(max_threads, worker_process, ())
+ self.pool = multiprocessing.Pool(conf.max_threads, worker_process, ())
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
commit 8c581d12608cdd92a68581d0ad9b5e892a2f48de
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Nov 13 15:12:14 2014 +0100
Allow specifying the domain to get the capabilities for
diff --git a/pykolab/wap_client/__init__.py b/pykolab/wap_client/__init__.py
index 2199e9f..1bd2b16 100644
--- a/pykolab/wap_client/__init__.py
+++ b/pykolab/wap_client/__init__.py
@@ -516,8 +516,8 @@ def sharedfolder_delete(params=None):
def sharedfolders_list(params={}):
return request('POST', 'sharedfolders.list', post=json.dumps(params))
-def system_capabilities():
- return request('GET', 'system.capabilities')
+def system_capabilities(domain=None):
+ return request('GET', 'system.capabilities', get={'domain':domain})
def system_get_domain():
return request('GET', 'system.get_domain')
commit 072e65ed0eec227855a9274269df685e53b692bf
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Thu Nov 13 15:11:43 2014 +0100
Allow wildcards to be specified in setting quota through the command-line.
diff --git a/pykolab/cli/cmd_set_quota.py b/pykolab/cli/cmd_set_quota.py
index cbfd529..aa0389f 100644
--- a/pykolab/cli/cmd_set_quota.py
+++ b/pykolab/cli/cmd_set_quota.py
@@ -56,12 +56,9 @@ def execute(*args, **kw):
if not imap.has_folder(folder):
print >> sys.stderr, _("No such folder %r") % (folder)
+ sys.exit(1)
- else:
- imap.set_quota(folder, quota)
-
- # See if the folder is an INBOX folder
- # If yes, edit LDAP (through WAP client)
- # If no, edit IMAP
+ for _folder in imap.lm(folder):
+ imap.set_quota(_folder, quota)
+ print >> sys.stdout, "Quota for folder '%s' set to %d" % (_folder, quota)
- # Verify the folder actually exists in IMAP
More information about the commits
mailing list