summaryrefslogtreecommitdiff
path: root/bin/sync_members
diff options
context:
space:
mode:
authorbwarsaw1999-11-30 21:17:33 +0000
committerbwarsaw1999-11-30 21:17:33 +0000
commit2fac41d42ec6532f0be6bc190fc08d7706ba05fa (patch)
treec0a8c60aab6a22501d74497526fde50edcf83963 /bin/sync_members
parent5b9548432717f4bd959213c8e81b7828cbbe74c3 (diff)
downloadmailman-2fac41d42ec6532f0be6bc190fc08d7706ba05fa.tar.gz
mailman-2fac41d42ec6532f0be6bc190fc08d7706ba05fa.tar.zst
mailman-2fac41d42ec6532f0be6bc190fc08d7706ba05fa.zip
Fixed -n/--no-change, i.e. dryrun mode, to conform to documented
behavior.
Diffstat (limited to 'bin/sync_members')
-rwxr-xr-xbin/sync_members12
1 files changed, 6 insertions, 6 deletions
diff --git a/bin/sync_members b/bin/sync_members
index 00cbf9b0a..dfbb0054c 100755
--- a/bin/sync_members
+++ b/bin/sync_members
@@ -122,6 +122,7 @@ def main():
elif opt in ('-n', '--no-change'):
dryrun = 1
i = i + 1
+ print 'Dry run mode'
elif opt in ('-d', '--digest'):
digest = 1
i = i + 1
@@ -226,8 +227,6 @@ def main():
# addrs contains now all the addresses that need removing
for laddr, addr in needsadding.items():
- if dryrun:
- continue
pw = '%s%s' % (Mailman.Utils.GetRandomSeed(),
Mailman.Utils.GetRandomSeed())
# should not already be subscribed, otherwise our test above is
@@ -235,16 +234,17 @@ def main():
# than once. Second and subsequent ones trigger an
# MMAlreadyAMember error. Just catch it and go on.
try:
- mlist.ApprovedAddMember(addr, pw, digest, welcome, notifyadmin)
+ if not dryrun:
+ mlist.ApprovedAddMember(addr, pw, digest,
+ welcome, notifyadmin)
print 'Added : %30s (%30s)' % (laddr, addr)
except Mailman.Errors.MMAlreadyAMember:
pass
for laddr, addr in addrs.items():
- if dryrun:
- continue
# should be a member, otherwise our test above is broken
- mlist.DeleteMember(addr, admin_notif=notifyadmin)
+ if not dryrun:
+ mlist.DeleteMember(addr, admin_notif=notifyadmin)
print 'Removed: %30s (%30s)' % (laddr, addr)
mlist.Save()