diff options
author | Daniil Baturin <daniil@baturin.org> | 2024-09-18 12:52:04 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2024-09-18 13:06:49 +0100 |
commit | 3fe55e78132ca79efa89c9000028aa7d72a96698 (patch) | |
tree | 425ad032b258eb7adf47b10a8a1f8199ea4c6ed2 /scripts/image-build/utils.py | |
parent | ead4cc2eba2d16b389f166e94e052567b9802494 (diff) | |
download | vyos-build-3fe55e78132ca79efa89c9000028aa7d72a96698.tar.gz vyos-build-3fe55e78132ca79efa89c9000028aa7d72a96698.zip |
build: T3664: improve support for custom build hooks
Diffstat (limited to 'scripts/image-build/utils.py')
-rw-r--r-- | scripts/image-build/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/image-build/utils.py b/scripts/image-build/utils.py index 7002b281..081327cd 100644 --- a/scripts/image-build/utils.py +++ b/scripts/image-build/utils.py @@ -82,3 +82,10 @@ def cmd(command): res = vyos.utils.process.call(command, shell=True) if res > 0: raise OSError(f"Command '{command}' failed") + +def rc_cmd(command): + code, out = vyos.utils.process.rc_cmd(command, shell=True) + if code > 0: + raise OSError(f"Command '{command}' failed") + else: + return out |