diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-07-08 16:44:37 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-07-08 16:44:37 +0300 |
commit | 005d712d988425c7c5387a8d82ae4d4844ac2243 (patch) | |
tree | a51dd81ab28b1913497c585ef26fb798863ae57d | |
parent | d9bdbb09c08e3a9e516bb6bedd2ce722a5240e85 (diff) | |
download | v-i-005d712d988425c7c5387a8d82ae4d4844ac2243.tar.gz |
fix: discard blocks securely when possible, otherwise insecurely
Sponsored-by: author
-rwxr-xr-x | v-i | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -34,7 +34,15 @@ def error(msg): def run(argv, **kwargs): log(f"RUN: {argv} {kwargs}") - return subprocess.run(argv, **kwargs) + check = False + if "check" in kwargs: + check = True + del kwargs["check"] + p = subprocess.run(argv, **kwargs) + if check and p.returncode != 0: + error(f"Ran command that failed: {argv}\n{p.stderr.decode()}") + sys.exit("command failed") + return p def physical_volumes(): |