diff options
author | Daniil Baturin <daniil@vyos.io> | 2024-04-29 14:33:25 +0000 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-05-05 15:13:07 +0200 |
commit | d3696d878f9ed6eed46723550dff8c1b914b62da (patch) | |
tree | 1fa148403389203ce1bb7ec32a9e88d76ae24443 /scripts/image-build/utils.py | |
parent | 78819c07645a41fc5328b6636755d887282ad109 (diff) | |
download | vyos-build-d3696d878f9ed6eed46723550dff8c1b914b62da.tar.gz vyos-build-d3696d878f9ed6eed46723550dff8c1b914b62da.zip |
build: T3664: fail the build on external command errors
(cherry picked from commit 7dfd9232da787a7befbc4338d4eb21fee4325174)
Diffstat (limited to 'scripts/image-build/utils.py')
-rw-r--r-- | scripts/image-build/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/image-build/utils.py b/scripts/image-build/utils.py index 6906c52d..8c3ccbab 100644 --- a/scripts/image-build/utils.py +++ b/scripts/image-build/utils.py @@ -23,6 +23,7 @@ from distutils.spawn import find_executable # Local modules import defaults +import vyos def check_build_config(): if not os.path.exists(defaults.BUILD_CONFIG): @@ -76,3 +77,8 @@ def check_system_dependencies(deps): raise OSError(checker.format_missing_dependencies()) else: pass + +def cmd(command): + res = vyos.utils.process.call(command, shell=True) + if res > 0: + raise OSError(f"Command '{command}' failed") |