summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorTimotheus Pokorra <tp@tbits.net>2015-06-09 08:17:10 +0200
committerTimotheus Pokorra <tp@tbits.net>2015-06-09 08:17:10 +0200
commitac1ab08b8611b7f5b8b6e0f0834f801f75e73918 (patch)
tree2195c5aeea414b646debfe6a21bdf319cd6e06d1 /pykolab
parent39cde352048254e3abaef60ef4abc1fba7845940 (diff)
downloadpykolab-ac1ab08b8611b7f5b8b6e0f0834f801f75e73918.tar.gz
adding parameter --domain for cli kolab sync (fixes #5091).
defaults to all domains. allows to run kolab sync only for one domain.
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/cli/cmd_sync.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/pykolab/cli/cmd_sync.py b/pykolab/cli/cmd_sync.py
index b9c6c9e..375303d 100644
--- a/pykolab/cli/cmd_sync.py
+++ b/pykolab/cli/cmd_sync.py
@@ -60,21 +60,34 @@ def cli_options():
help = _("Resync from the beginning")
)
+ my_option_group.add_option(
+ '--domain',
+ dest = "domain",
+ action = "store",
+ default = "all",
+ help = _("Only sync the specified domain")
+ )
+
def execute(*args, **kw):
global imap, pool
auth = Auth()
- log.debug(_("Listing domains..."), level=5)
- start_time = time.time()
- domains = auth.list_domains()
- end_time = time.time()
- log.debug(
+
+ if conf.domain == "all":
+ log.debug(_("Listing domains..."), level=5)
+ start_time = time.time()
+ domains = auth.list_domains()
+ end_time = time.time()
+ log.debug(
_("Found %d domains in %d seconds") % (
len(domains),
(end_time-start_time)
),
level=8
)
+ else:
+ domains = {}
+ domains[conf.domain] = conf.domain
if version.StrictVersion(sys.version[:3]) >= version.StrictVersion("2.7"):
pool = multiprocessing.Pool(conf.threads, worker_process, (), 1)