diff options
author | Kiel Christofferson <kiel@endpoint.com> | 2014-05-02 19:19:35 -0400 |
---|---|---|
committer | Kiel Christofferson <kiel@endpoint.com> | 2014-06-17 13:32:37 -0400 |
commit | 846e8a079578507f576f6cb9e2628cb8ff8ca138 (patch) | |
tree | 6db7b2ea6086a92124a961b01afb1592a26629e9 /components/chroot-hooks | |
parent | e8cbbb09d378145d5467326de5e0f5144827eb38 (diff) | |
download | vyos-live-build-846e8a079578507f576f6cb9e2628cb8ff8ca138.tar.gz vyos-live-build-846e8a079578507f576f6cb9e2628cb8ff8ca138.zip |
Replace subprocess.call() with subprocess.check_call().
Using check_call(), a non-zero return value from the subprocess will cause the
desired behavior of an aborted build with a stack trace.
Diffstat (limited to 'components/chroot-hooks')
-rwxr-xr-x | components/chroot-hooks | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/chroot-hooks b/components/chroot-hooks index a7a24816c..6d973afea 100755 --- a/components/chroot-hooks +++ b/components/chroot-hooks @@ -72,8 +72,8 @@ def main(): os.makedirs('chroot/live-build/config', exist_ok=True) - mount = subprocess.call('mount -o bind config chroot/live-build/config', shell=True) - remount = subprocess.call('mount -o remount,ro,bind chroot/live-build/config', shell=True) + mount = subprocess.check_call('mount -o bind config chroot/live-build/config', shell=True) + remount = subprocess.check_call('mount -o remount,ro,bind chroot/live-build/config', shell=True) # process hooks os.makedirs('chroot/live-build', exist_ok=True) @@ -90,11 +90,11 @@ def main(): print('I: Executing \' ' + hook + '\'') os.chmod(hook, 0o755) - exec_hook = subprocess.call('chroot chroot /live-build/' + os.path.basename(hook), shell=True) + exec_hook = subprocess.check_call('chroot chroot /live-build/' + os.path.basename(hook), shell=True) os.remove('chroot/live-build/' + os.path.basename(hook)) # unmount coniguration directory - umount = subprocess.call('umount chroot/live-build/config', shell=True) + umount = subprocess.check_call('umount chroot/live-build/config', shell=True) os.rmdir('chroot/live-build/config') os.rmdir('chroot/live-build') |