Merge lp:~brian-murray/apport/kernel-package-version into lp:~apport-hackers/apport/trunk

Proposed by Brian Murray
Status: Merged
Merged at revision: 2799
Proposed branch: lp:~brian-murray/apport/kernel-package-version
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 89 lines (+29/-6)
5 files modified
apport/hookutils.py (+1/-1)
data/apportcheckresume (+7/-1)
data/iwlwifi_error_dump (+7/-1)
data/kernel_crashdump (+7/-1)
data/kernel_oops (+7/-2)
To merge this branch: bzr merge lp:~brian-murray/apport/kernel-package-version
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Evan (community) Approve
Review via email: mp+217650@code.launchpad.net

Description of the change

For kernel crashes when creating the crash file for the Package key we also need to add the version of the package otherwise the data in the error tracker is incomplete.

https://errors.ubuntu.com/bucket/?id=iwlwifi:22.24.8.0:0x00000038%20|%20BAD_COMMAND

To post a comment you must log in.
Revision history for this message
Evan (ev) wrote :

Looks good. We could probably refactor this into a separate function, but that's not worth blocking the MP on.

review: Approve
Revision history for this message
Martin Pitt (pitti) wrote :

LGTM, thanks! Merging with a NEWS entry.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'apport/hookutils.py'
2--- apport/hookutils.py 2013-07-17 05:39:38 +0000
3+++ apport/hookutils.py 2014-04-29 17:43:07 +0000
4@@ -490,7 +490,7 @@
5 '''Extract recent messages from a logfile which match a regex.
6
7 pattern should be a "re" object. By default this catches at most the last
8- 1000 lines, but this can be modified with a different maxlines argument.
9+ 10000 lines, but this can be modified with a different maxlines argument.
10 '''
11 lines = ''
12 try:
13
14=== modified file 'data/apportcheckresume'
15--- data/apportcheckresume 2012-12-10 11:48:26 +0000
16+++ data/apportcheckresume 2014-04-29 17:43:07 +0000
17@@ -39,7 +39,13 @@
18 pr.add_os_info()
19 pr.add_proc_info()
20 pr.add_user_info()
21- pr['Package'] = 'linux-image-' + os.uname()[2]
22+ package = apport.packaging.get_kernel_package()
23+ try:
24+ package_version = apport.packaging.get_version(package)
25+ except ValueError as e:
26+ if 'does not exist' in e.message:
27+ package_version = 'unknown'
28+ pr['Package'] = '%s %s' % (package, package_version)
29
30 # grab the contents of the suspend/resume flag file
31 attach_file_if_exists(pr, flagfile, 'Failure')
32
33=== modified file 'data/iwlwifi_error_dump'
34--- data/iwlwifi_error_dump 2014-04-28 16:38:55 +0000
35+++ data/iwlwifi_error_dump 2014-04-29 17:43:07 +0000
36@@ -24,7 +24,13 @@
37 sys.exit(1)
38
39 pr = apport.Report('KernelCrash')
40-pr['Package'] = apport.packaging.get_kernel_package()
41+package = apport.packaging.get_kernel_package()
42+try:
43+ package_version = apport.packaging.get_version(package)
44+except ValueError as e:
45+ if 'does not exist' in e.message:
46+ package_version = 'unknown'
47+pr['Package'] = '%s %s' % (package, package_version)
48 pr['Title'] = 'iwlwifi firmware error'
49 pr.add_os_info()
50
51
52=== modified file 'data/kernel_crashdump'
53--- data/kernel_crashdump 2013-03-18 16:25:49 +0000
54+++ data/kernel_crashdump 2014-04-29 17:43:07 +0000
55@@ -18,7 +18,13 @@
56 vmcore_path = os.path.join(vmcore_root, 'vmcore')
57
58 pr = apport.Report('KernelCrash')
59-pr['Package'] = apport.packaging.get_kernel_package()
60+package = apport.packaging.get_kernel_package()
61+try:
62+ package_version = apport.packaging.get_version(package)
63+except ValueError as e:
64+ if 'does not exist' in e.message:
65+ package_version = 'unknown'
66+pr['Package'] = '%s %s' % (package, package_version)
67
68 pr.add_os_info()
69 if os.path.exists(vmcore_path + '.log'):
70
71=== modified file 'data/kernel_oops'
72--- data/kernel_oops 2013-09-19 21:18:22 +0000
73+++ data/kernel_oops 2014-04-29 17:43:07 +0000
74@@ -26,8 +26,13 @@
75 pr['Failure'] = 'oops'
76 pr['Tags'] = 'kernel-oops'
77 pr['Annotation'] = _('Your system might become unstable now and might need to be restarted.')
78-
79-pr['Package'] = 'linux-image-' + os.uname()[2]
80+package = apport.packaging.get_kernel_package()
81+try:
82+ package_version = apport.packaging.get_version(package)
83+except ValueError as e:
84+ if 'does not exist' in e.message:
85+ package_version = 'unknown'
86+pr['Package'] = '%s %s' % (package, package_version)
87 pr['SourcePackage'] = 'linux'
88
89 pr['OopsText'] = oops

Subscribers

People subscribed via source and target branches