diff options
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 |