Merge lp:~sylvain-pineau/checkbox/no_pkaction_for_snappy into lp:checkbox

Proposed by Sylvain Pineau
Status: Merged
Approved by: Paul Larson
Approved revision: no longer in the source branch.
Merged at revision: 4489
Proposed branch: lp:~sylvain-pineau/checkbox/no_pkaction_for_snappy
Merge into: lp:checkbox
Diff against target: 15 lines (+5/-0)
1 file modified
plainbox/plainbox/impl/ctrl.py (+5/-0)
To merge this branch: bzr merge lp:~sylvain-pineau/checkbox/no_pkaction_for_snappy
Reviewer Review Type Date Requested Status
Paul Larson Approve
Sylvain Pineau (community) Needs Resubmitting
Review via email: mp+305332@code.launchpad.net

Description of the change

Tiny fix to avoid the following warning when running on snappy:

Cannot check if plainbox-trusted-launcher-1 is available: [Errno 2] No such file or directory: 'pkaction'

To post a comment you must log in.
Revision history for this message
Paul Larson (pwlars) wrote :

The only comment I would have, is that this got inserted between the try: block, and the comment saying why you needed to catch the exeception, so it separates the comment from the thing it is commenting on a bit. I don't think it's so much that it would cause a lot of confusion, but it may be worth moving it just a bit. Otherwise, +1 so you can decide which you want to do.

review: Approve
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

Good catch, thanks Paul.
Fixed and repushed.

review: Needs Resubmitting
Revision history for this message
Paul Larson (pwlars) wrote :

+1

review: Approve
4489. By Sylvain Pineau

"automatic merge of lp:~sylvain-pineau/checkbox/no_pkaction_for_snappy/ by tarmac [r=pwlars][bug=][author=sylvain-pineau]"

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plainbox/plainbox/impl/ctrl.py'
2--- plainbox/plainbox/impl/ctrl.py 2016-08-30 08:09:18 +0000
3+++ plainbox/plainbox/impl/ctrl.py 2016-09-09 15:02:40 +0000
4@@ -1197,6 +1197,11 @@
5 Initialize a new RootViaPTL1ExecutionController
6 """
7 super().__init__(provider_list)
8+ # The plainbox-trusted-launcher does not work with snappy env (requires
9+ # policykit)
10+ if (os.getenv("SNAP") or os.getenv("SNAP_APP_PATH")):
11+ self.is_supported = False
12+ return
13 # Ask pkaction(1) if the "run-plainbox-job" policykit action is
14 # registered on this machine.
15 action_id = b"org.freedesktop.policykit.pkexec.run-plainbox-job"

Subscribers

People subscribed via source and target branches