Merge ~sylvain-pineau/plainbox-provider-resource:fix-1781609 into plainbox-provider-resource:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: fc91b11404876559781285c3f4e46d6b414986fd
Merged at revision: fc9ba1857df5fb6515de4da8ad73fc71b831dd9a
Proposed branch: ~sylvain-pineau/plainbox-provider-resource:fix-1781609
Merge into: plainbox-provider-resource:master
Diff against target: 23 lines (+6/-2)
1 file modified
bin/snapd_resource (+6/-2)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+349596@code.launchpad.net

Description of the change

Fixes linked bug

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

self-approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/snapd_resource b/bin/snapd_resource
2index 749af75..5da6cc0 100755
3--- a/bin/snapd_resource
4+++ b/bin/snapd_resource
5@@ -130,12 +130,16 @@ class Snaps(SnapdQuery):
6
7 for snap in data['result']:
8 def print_field(key):
9- val = snap[key]
10+ try:
11+ val = snap[key]
12+ except KeyError:
13+ val = ""
14 if val != "":
15 print("{}: {}".format(key, val))
16 # Whitelist of information that is of interest
17 keys = ['name', 'type', 'channel', 'version', 'revision',
18- 'developer', 'install-date', 'confinement', 'devmode']
19+ 'developer', 'install-date', 'confinement', 'devmode',
20+ 'status']
21 for f in keys:
22 print_field(f)
23 print()

Subscribers

People subscribed via source and target branches