aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmailconf
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-06-05 04:15:30 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-06-05 04:15:30 +0000
commit24f5685b15ad4cc3bbb6ba0ad2d2c8a6537c4314 (patch)
tree0b716f92f8924fa3d760f89b8deab739cb4b9c1a /fetchmailconf
parent19f995c58d5bc011bb2b94f2a1ef759b3925b066 (diff)
downloadfetchmail-24f5685b15ad4cc3bbb6ba0ad2d2c8a6537c4314.tar.gz
fetchmail-24f5685b15ad4cc3bbb6ba0ad2d2c8a6537c4314.tar.bz2
fetchmail-24f5685b15ad4cc3bbb6ba0ad2d2c8a6537c4314.zip
Catch configuration errors.
svn path=/trunk/; revision=1903
Diffstat (limited to 'fetchmailconf')
-rwxr-xr-xfetchmailconf16
1 files changed, 10 insertions, 6 deletions
diff --git a/fetchmailconf b/fetchmailconf
index 0157e57f..a30b6d35 100755
--- a/fetchmailconf
+++ b/fetchmailconf
@@ -1242,21 +1242,25 @@ if __name__ == '__main__':
cmd = "fetchmail -f " + rcfile + " --configdump >" + tmpfile
else:
cmd = "fetchmail --configdump >" + tmpfile
+
try:
s = os.system(cmd)
if s != 0:
print "`" + cmd + "' run failure, status " + `s`
raise SystemExit
-
- s = execfile(tmpfile)
- if s:
- print "Invalid configuration, status " + `s`
- raise SystemExit
except:
+ print "Unknown error while running fetchmail --configdump"
os.remove(tmpfile)
sys.exit(1)
- else:
+
+ try:
+ execfile(tmpfile)
+ except:
+ print "Can't read configuration output of fetchmail --configdump."
os.remove(tmpfile)
+ sys.exit(1)
+
+ os.remove(tmpfile)
# The tricky part -- initializing objects from the configuration global
# `Configuration' is the top level of the object tree we're going to mung.