Merge ~sylvain-pineau/plainbox:preserve-cwd-auto into plainbox:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Jonathan Cave
Approved revision: cce68f4fba2b5b1f52113ace165f014ff1cd1b4a
Merged at revision: 164d9f9f7de05e80cb559bb6ebd9ecddafdb5547
Proposed branch: ~sylvain-pineau/plainbox:preserve-cwd-auto
Merge into: plainbox:master
Diff against target: 13 lines (+1/-1)
1 file modified
plainbox/impl/ctrl.py (+1/-1)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Maciej Kisielewski Approve
Review via email: mp+327633@code.launchpad.net

Description of the change

since adding preserve-cwd flag is mandatory to run other snaps commands, let's default to this mode to run all job commands on snappy.

Tested with the wireless tests on caracalla, they all pass now.

To post a comment you must log in.
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

Mm. Simple and nice!
+1

review: Approve
Revision history for this message
Jonathan Cave (jocave) wrote :

Nice.

I will top approve to get this in nightly builds too.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/ctrl.py b/plainbox/impl/ctrl.py
2index 1ef04d3..75c4332 100644
3--- a/plainbox/impl/ctrl.py
4+++ b/plainbox/impl/ctrl.py
5@@ -560,7 +560,7 @@ class CheckBoxExecutionController(IExecutionController):
6 job, job_state, config, session_dir, nest_dir)
7 with self.temporary_cwd(job, config) as cwd_dir:
8 # run the command
9- if 'preserve-cwd' in job.get_flag_set():
10+ if 'preserve-cwd' in job.get_flag_set() or os.getenv("SNAP"):
11 logger.debug(_("job[%s] executing %r with env %r"),
12 job.id, cmd, env)
13 return_code = extcmd_popen.call(cmd, env=env)

Subscribers

People subscribed via source and target branches