Skip to content

Commit 702bcf0

Browse files
committed
Merge remote-tracking branch 'origin/pr/587'
* origin/pr/587: qvm-features-request: unverbose logging of erroring qrexec calls Pull request description: Removes redundant stack trace from logs. While the error caused by `hostname not found` in QubesOS/qubes-issues#9245 is probably hinting at a separate underlying issue, this cleans up the output when errors trigger. Before: ``` (24/26) Updating the Qubes desktop file App Icons and features... Traceback (most recent call last): File "/usr/bin/qvm-features-request", line 111, in <module> sys.exit(main()) ^^^^^^ File "/usr/bin/qvm-features-request", line 102, in main subprocess.check_call( File "/usr/lib/python3.12/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['qrexec-client-vm', 'dom0', 'qubes.FeaturesRequest']' returned non-zero exit status 1. error: command failed to execute correctly (25/26) Updating the desktop file MIME type cache... (26/26) Updating X fontdir indices... ``` After: ``` (24/26) Updating the Qubes desktop file App Icons and features... Error: Command `qrexec-client-vm dom0 qubes.FeaturesRequest` returned exit code 1 error: command failed to execute correctly (25/26) Updating the desktop file MIME type cache... (26/26) Updating X fontdir indices... ```
2 parents c95d934 + adf0354 commit 702bcf0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

misc/qvm-features-request

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,15 @@ def main(args=None):
9999

100100
if args.commit:
101101
devnull = os.open(os.devnull, os.O_RDWR)
102-
subprocess.check_call(
103-
['qrexec-client-vm', 'dom0', 'qubes.FeaturesRequest'],
104-
stdin=devnull, stdout=devnull)
102+
cmd = ['qrexec-client-vm', 'dom0', 'qubes.FeaturesRequest']
103+
try:
104+
subprocess.check_call(cmd, stdin=devnull, stdout=devnull)
105+
except subprocess.CalledProcessError as e:
106+
print(
107+
f"Error: Command `{' '.join(cmd)}` returned exit code {e.returncode}",
108+
file=sys.stderr
109+
)
110+
any_error = True
105111

106112
if any_error:
107113
return 1

0 commit comments

Comments
 (0)