juju-deployer (maybe?) doing crazy things with include-file and include-base64 configurations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mojo: Continuous Delivery for Juju |
Invalid
|
Low
|
Unassigned | ||
juju-deployer |
Fix Released
|
Critical
|
Unassigned |
Bug Description
Filed as https:/
export MOJO_PROJECT=
export MOJO_STAGE=devel
export MOJO_WORKSPACE=
export MOJO_SERIES=bionic
$ echo "Whatever, this will be borked by mojo I think." > vhost.template
$ cat << EOF > services
foo:
series: bionic
services:
EOF
$ mojo deploy-show --options config=services
series: bionic
services:
apache:
charm: cs:apache2
options:
vhost_
series: bionic
Notice that vhost_template_vars is !!binary, which it shouldn't be.
I went poking around mojo itself, and its jinja2 template substitution correctly yields something like:
foo:
series: bionic
services:
I then pass this file to deployer:
$ juju-deployer --diff -c /home/ubuntu/
services:
modified:
apache:
cfg-config:
env-config:
so AHA< it *is* deployer munging those .template files.
Funny thing is, deployer does not seem to have changed since March...
Mojo does this using deployer code directly:
deployment = deployer_
This small patch to deployer (it's entirely incomplete) improves things a bit:
=== modified file 'deployer/
--- deployer/
+++ deployer/
@@ -270,7 +270,7 @@
v = fh.read()
if include_type == "base64":
- return v
+ return v.encode('utf-8')
if feedback:
return feedback
$ juju-deployer --diff -c /home/ubuntu/
services:
modified:
apache:
cfg-config:
env-config:
(presumably a similar transform is needed for env-config).
Noticing that the package Mojo depends on is python3-
Related branches
- Tom Haddon: Needs Fixing
- Canonical IS Reviewers: Pending requested
-
Diff: 11 lines (+1/-1)1 file modifieddeployer/deployment.py (+1/-1)
- Benjamin Allot: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 53 lines (+13/-5)3 files modifieddeployer/deployment.py (+5/-2)
deployer/tests/test_data/blog.snippet (+2/-1)
deployer/tests/test_deployment.py (+6/-2)
Changed in mojo: | |
status: | New → Triaged |
importance: | Undecided → Critical |
Changed in juju-deployer: | |
status: | New → Triaged |
importance: | Undecided → Critical |
Changed in mojo: | |
status: | Triaged → Invalid |
importance: | Critical → Undecided |
Changed in mojo: | |
importance: | Undecided → Low |
An implication of the fact that this is a juju-deployer issue might be that bundle phases will be unaffected by this problem :)