fix: only raise exception on command failure with stderr output

- Change run() function to check returncode before raising exception
- Use re.search() instead of re.match() for ignore pattern matching
- Fix false positive errors from waydroid informational stderr messages

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
MAHMETT
2026-03-08 00:47:34 +07:00
co-authored by Qwen-Coder
parent d5289cfd89
commit 7e979602c7
+2 -2
View File
@@ -40,9 +40,9 @@ def run(args: list, env: Optional[str] = None, ignore: Optional[str] = None):
) )
# print(result.stdout.decode()) # print(result.stdout.decode())
if result.stderr: if result.returncode != 0 and result.stderr:
error = result.stderr.decode("utf-8") error = result.stderr.decode("utf-8")
if ignore and re.match(ignore, error): if ignore and re.search(ignore, error):
return result return result
Logger.error(error) Logger.error(error)
raise subprocess.CalledProcessError( raise subprocess.CalledProcessError(