Unit hooks fail on windows if PATH is uppercase
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | juju-core |
High
|
Nate Finch | ||
| | 1.24 |
High
|
Nate Finch | ||
Bug Description
The uniter hook var population code does not correctly handle the case-insensitive case-preserving nature of environment variables on windows. Any windows machine with casing of the path variable other than 'Path' will fail to find hook tools.
On the CI windows vm unit test run, this manifests as the following test failures:
FAIL: uniter_
FAIL: uniter_
FAIL: uniter_
FAIL: util_windows_
FAIL: uniter_
FAIL: uniter_test.go:291: UniterSuite.
FAIL: uniter_test.go:399: UniterSuite.
FAIL: uniter_test.go:675: UniterSuite.
FAIL: uniter_test.go:365: UniterSuite.
FAIL: uniter_test.go:165: UniterSuite.
FAIL: uniter_
FAIL: uniter_
FAIL: uniter_
FAIL: uniter_test.go:208: UniterSuite.
FAIL: uniter_test.go:448: UniterSuite.
FAIL: uniter_
...
[LOG] 0:03.493 INFO unit.u/0.install
c:\users\
deadbeef-
[LOG] 0:03.493 INFO unit.u/0.install 'juju-log.exe' is not recognized
as an internal or external command,
[LOG] 0:03.493 INFO unit.u/0.install operable program or batch file.
...
waiting for hooks: []string{"install", "config-changed", "start"}
ctx.hooksCompl
...
util_test.go:718:
c.
The mergeEnvironment from juju/utils and copied in juju/juju needs to do case-insensitive variable name matching, similar to the fix already made to juju/testing:
| Changed in juju-core: | |
| assignee: | nobody → Nate Finch (natefinch) |
| Changed in juju-core: | |
| status: | Triaged → In Progress |
| Changed in juju-core: | |
| milestone: | 1.24-alpha1 → 1.24.0 |
| Changed in juju-core: | |
| milestone: | 1.24.0 → 1.25.0 |
| Changed in juju-core: | |
| status: | In Progress → Fix Committed |
| Martin Packman (gz) wrote : | #2 |
Change as landed is incorrect, the casing logic in mergeEnvironment is wrong (and untested).
| Changed in juju-core: | |
| status: | Fix Committed → In Progress |
| Nate Finch (natefinch) wrote : | #3 |
Can you please explain how the logic is wrong? It definitely is tested, though it's possible the tests are flawed.
| Nate Finch (natefinch) wrote : | #4 |
| Martin Packman (gz) wrote : | #5 |
Nate, the first merge proposal to fix this was incorrect:
<http://
So I commented here, set the bug back to In Progress, and reverted:
<http://
You then landed a corrected version:
<http://
But apparently only marked this bug as fixed in 1.24, not master.
| Changed in juju-core: | |
| status: | In Progress → Fix Released |


A fix is currently under review: http:// reviews. vapour. ws/r/1487/