From: Peter Palfrader Date: Sat, 8 Dec 2012 22:33:47 +0000 (+0100) Subject: On problems, exit 1 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=d86040d0efcda94abf9077dae1e2d5ac887b751b;p=mirror%2Fdsa-puppet.git On problems, exit 1 --- diff --git a/modules/roles/files/static-mirroring/static-master-run b/modules/roles/files/static-mirroring/static-master-run index 0d7003d45..d9aa164a3 100755 --- a/modules/roles/files/static-mirroring/static-master-run +++ b/modules/roles/files/static-mirroring/static-master-run @@ -5,6 +5,7 @@ import os import shutil import subprocess import string +import sys import tempfile import time @@ -162,15 +163,21 @@ def run_mirror(): log("Cleaning up.") shutil.rmtree(tmpdir_old) log("Done.") + return True else: log("Aborted.") + return False +ok = False try: - run_mirror() + ok = run_mirror() finally: for p in cleanup_dirs: if os.path.exists(p): shutil.rmtree(p) + +if not ok: + sys.exit(1) # vim:set et: # vim:set ts=2: # vim:set shiftwidth=2: