Merge ~pieq/bugit/+git/qabro:fix1891609-snap-attribute into bugit:master

Proposed by Pierre Equoy
Status: Merged
Approved by: Pierre Equoy
Approved revision: 3cbfd0f3a3fb9fa47c069bcb8c4280a46dd39d13
Merged at revision: f6f0ab34c7ad5ff2c5d883c97212279cdbc9c02a
Proposed branch: ~pieq/bugit/+git/qabro:fix1891609-snap-attribute
Merge into: bugit:master
Diff against target: 24 lines (+2/-2)
2 files modified
qabro/__version__.py (+1/-1)
qabro/bug_assistant.py (+1/-1)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+389322@code.launchpad.net

Description of the change

See commit message for more information.

Some checkbox project snaps do not use the Title attribute from snaps, resulting in a KeyError when trying to locate the most recent Checkbox session.

(Pdb) pprint([e.get('name') for e in ss.get_snaps()])
['core18',
 'core20',
 'qabro',
 'checkbox-xxx-classic',
 'checkbox20',
 'core']
(Pdb) pprint([e.get('title') for e in ss.get_snaps()])
[None, 'checkbox20', 'core', 'Core 18', 'core20', None, 'qabro']

Using the `name` attribute fixes this issue.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Temped to use gir1.2-snapd-1 ?

+1 for the name change

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/qabro/__version__.py b/qabro/__version__.py
2index ea4a7aa..5368ec7 100644
3--- a/qabro/__version__.py
4+++ b/qabro/__version__.py
5@@ -1,5 +1,5 @@
6 __title__ = 'qabro'
7-__version__ = '0.13'
8+__version__ = '0.14dev'
9 __description__ = 'Tool to generate a Launchpad bug report and attach useful logs (using sosreport and the like).'
10 __author__ = 'Pierre Equoy'
11 __author_email__ = 'pierre.equoy@canonical.com'
12diff --git a/qabro/bug_assistant.py b/qabro/bug_assistant.py
13index a32fd96..ed55c9d 100644
14--- a/qabro/bug_assistant.py
15+++ b/qabro/bug_assistant.py
16@@ -277,7 +277,7 @@ class AttachmentAssistant:
17 rootpath = classic_path
18 else:
19 ss = snapdsocket()
20- snap_list = [e['title'] for e in ss.get_snaps() if 'checkbox-' in e['name']]
21+ snap_list = [e['name'] for e in ss.get_snaps() if 'checkbox-' in e['name']]
22 for snap_name in snap_list:
23 sp = ["/home/$USER/snap/{}/current/.cache/plainbox/sessions",
24 "/root/snap/{}/current/.cache/plainbox/sessions"]

Subscribers

People subscribed via source and target branches

to all changes: