From d86040d0efcda94abf9077dae1e2d5ac887b751b Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Sat, 8 Dec 2012 23:33:47 +0100 Subject: [PATCH] On problems, exit 1 --- modules/roles/files/static-mirroring/static-master-run | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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: -- 2.20.1