aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbwarsaw <>2004-03-04 14:06:01 +0000
committerbwarsaw <>2004-03-04 14:06:01 +0000
commit765cb5dd2836297a946e5a08cd6cf1cec67621fa (patch)
treee620f8e3ca3d9b648db4f57681dab46d57e172af
parentfc558e4026969a9d549a771f9050deace0b25e17 (diff)
downloadmailman2-765cb5dd2836297a946e5a08cd6cf1cec67621fa.tar.gz
mailman2-765cb5dd2836297a946e5a08cd6cf1cec67621fa.tar.xz
mailman2-765cb5dd2836297a946e5a08cd6cf1cec67621fa.zip
Load(): Only gain the lock and attempt to repair the config file if file ==
plast or file == dlast.
-rw-r--r--Mailman/MailList.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/Mailman/MailList.py b/Mailman/MailList.py
index 68d2aae2..6ee0a00d 100644
--- a/Mailman/MailList.py
+++ b/Mailman/MailList.py
@@ -610,16 +610,18 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin,
# copy the fallback into the primary so that the logic in Save() will
# still work. For giggles, we'll copy it to a safety backup. Note we
# MUST do this with the underlying list lock acquired.
- unlock = True
- try:
+ if file == plast or file == dlast:
+ syslog('error', 'fixing corrupt config files')
+ unlock = True
try:
- self.__lock.lock()
- except LockFile.AlreadyLockedError:
- unlock = False
- self.__fix_corrupt_pckfile(file, pfile, plast, dfile, dlast)
- finally:
- if unlock:
- self.__lock.unlock()
+ try:
+ self.__lock.lock()
+ except LockFile.AlreadyLockedError:
+ unlock = False
+ self.__fix_corrupt_pckfile(file, pfile, plast, dfile, dlast)
+ finally:
+ if unlock:
+ self.__lock.unlock()
# Copy the loaded dictionary into the attributes of the current
# mailing list object, then run sanity check on the data.
self.__dict__.update(dict)