Merge ~pieq/bugit/+git/qabro:fix-1903229-acpidump-arm into bugit:master

Proposed by Pierre Equoy
Status: Merged
Approved by: Vic Liu
Approved revision: 860abc75e374d764bf2719b62065173cd2961678
Merged at revision: c6ca921c84755fb96675108f6aac3a62a75508d7
Proposed branch: ~pieq/bugit/+git/qabro:fix-1903229-acpidump-arm
Merge into: bugit:master
Diff against target: 20 lines (+8/-2)
1 file modified
qabro/bug_assistant.py (+8/-2)
Reviewer Review Type Date Requested Status
Vic Liu Approve
Review via email: mp+393431@code.launchpad.net

Description of the change

See linked bug and commit message for more info.

The original code raised an exception within qabro resulting in no logs being attached.

To post a comment you must log in.
Revision history for this message
Vic Liu (zongminl) wrote :

lgtm +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/qabro/bug_assistant.py b/qabro/bug_assistant.py
2index f8630e4..7af347c 100644
3--- a/qabro/bug_assistant.py
4+++ b/qabro/bug_assistant.py
5@@ -340,8 +340,14 @@ class AttachmentAssistant:
6 p = os.getenv('PATH')
7 if p:
8 command = ["sudo", "env", "PATH={}".format(p), "acpidump-acpica"]
9- output = subprocess.check_output(command)
10- self.attachments['acpidump.log'] = output
11+ process = subprocess.run(command,
12+ stdout=subprocess.PIPE,
13+ stderr=subprocess.PIPE)
14+ if process.returncode == 0:
15+ self.attachments['acpidump.log'] = process.stdout
16+ else:
17+ print("Error while running acpidump:")
18+ print(process.stderr)
19 else:
20 print("$PATH missing. Cannot run acpidump!")
21

Subscribers

People subscribed via source and target branches

to all changes: