From e2cd56282525d942e82d2e55df9cbdca6cc3b98c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Fri, 6 Dec 2013 16:54:26 +0000 Subject: [PATCH] Don't always refresh the cache on import --- roles/mailman/files/import-mm2.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/roles/mailman/files/import-mm2.py b/roles/mailman/files/import-mm2.py index bdcb4a2b16..a508aa5632 100755 --- a/roles/mailman/files/import-mm2.py +++ b/roles/mailman/files/import-mm2.py @@ -23,8 +23,9 @@ class Importer(object): def __init__(self, opts, config): self.opts = opts self.config = config - self.existing_lists = cmdget( - ["sudo", "-u", "mailman", "mailman3", "lists", "-q"]) + self.existing_lists = [ l.strip() for l in + cmdget(["sudo", "-u", "mailman", + "mailman3", "lists", "-q"]).split("\n") ] self.index_path = self._get_index_path() def _get_index_path(self): @@ -65,10 +66,17 @@ class Importer(object): (list_is_new or not self.opts.new_only): call(["sudo", "kittystore-import", "-p", self.config["confdir"], "-s", "settings_admin", - "-l", listaddr, "--continue", archivefile]) + "-l", listaddr, "--continue", "--no-refresh", + archivefile]) if self.index_path: call(["sudo", "chown", "mailman:apache", "-R", self.index_path]) call(["sudo", "chmod", "g+w", self.index_path]) + if self.opts.no_archives: + call(["sudo", "kittystore-refresh-cache", "-p", + self.config["confdir"], "-s", "settings_admin"]) + else: + call(["sudo", "kittystore-refresh-cache", "-p", + self.config["confdir"], "-s", "settings_admin", "-f"])