Some checkbox_ng commands don't use the PlainboxConfig objects when running jobs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Next Generation Checkbox (CLI) |
Fix Released
|
Critical
|
Zygmunt Krynicki | ||
PlainBox (Toolkit) |
Fix Released
|
Critical
|
Zygmunt Krynicki |
Bug Description
I was looking at why when using canonical-
Variables I set in the config file didn't show up in env output. Interestingly this happened both with canonical-
So I went looking at the difference between canonical-
I found that sru has a _run_single_job method that uses the applogic.
job_state, job_result = run_job_
Then, run_job_if_possible does pass the config object to the runner's run_job:
if job_state.
job_result = runner.run_job(job, config)
However, CliInvocation (from cli.py) has a _run_single_
if job_state.
job_result = runner.run_job(job)
SO it's not passing the config object (which at this point is similarly available in self.config) and thus the settings, particularly the environment, are ignored.
Just to verify, I modified the call to this:
job_result = runner.run_job(job, self.config)
In this case my dummy job did print the variables correctly (although they're not uppercased as they should be).
This appears to also be the case with "plainbox run", as plainbox/
The code section where this is is nearly identical to the one from checkbox_ng cli.py.
Finally I found another instance of run_job() with no config passed in plainbox's analyze.py file.
Related branches
- Daniel Manrique (community): Approve
-
Diff: 192 lines (+24/-25)9 files modifiedcheckbox-ng/checkbox_ng/commands/cli.py (+2/-4)
checkbox-ng/checkbox_ng/commands/sru.py (+1/-2)
plainbox/plainbox/impl/commands/analyze.py (+6/-5)
plainbox/plainbox/impl/commands/checkbox.py (+2/-1)
plainbox/plainbox/impl/commands/dev.py (+3/-3)
plainbox/plainbox/impl/commands/run.py (+2/-3)
plainbox/plainbox/impl/commands/script.py (+1/-2)
plainbox/plainbox/impl/commands/special.py (+5/-4)
plainbox/plainbox/impl/test_box.py (+2/-1)
description: | updated |
Changed in checkbox: | |
status: | Triaged → In Progress |
Changed in checkbox: | |
status: | In Progress → Fix Committed |
Changed in plainbox: | |
milestone: | none → 0.5.3 |
Changed in checkbox-ng: | |
milestone: | none → 0.3 |
status: | New → Fix Committed |
Changed in plainbox: | |
status: | New → Fix Committed |
importance: | Undecided → Critical |
Changed in checkbox-ng: | |
importance: | Undecided → Critical |
assignee: | nobody → Zygmunt Krynicki (zkrynicki) |
Changed in plainbox: | |
assignee: | nobody → Zygmunt Krynicki (zkrynicki) |
Changed in checkbox: | |
milestone: | checkbox-ng-0.3 → none |
Changed in checkbox-ng: | |
status: | Fix Committed → Fix Released |
status: | Fix Released → Fix Committed |
Changed in plainbox: | |
status: | Fix Committed → Fix Released |
Changed in checkbox-ng: | |
status: | Fix Committed → Fix Released |
no longer affects: | checkbox |
Take it if you feel like it. It's pretty serious and we should fix it for the 0.3 release ASAP