extra_packages does not work with more than one package
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Apache2 Charm |
Fix Released
|
Medium
|
Benjamin Allot |
Bug Description
When setting the extra_packages configuration to "irssi screen" I hav the following log
| 2020-02-19 09:03:39 DEBUG config-changed E: Unable to locate package irssi screen
The reason is the way the command is computed. I added some logs to confirm it:
| 020-02-19 09:03:38 INFO juju-log Running ['apt-get', '-y', 'install', '-qq', 'irssi screen']
A quick fix that works (and we could expand to integrate comma as well) is to simply iterate over the string passed to the apt_get_install method.
diff --git a/hooks/hooks.py b/hooks/hooks.py
index b2647f7..bbfd91a 100755
--- a/hooks/hooks.py
+++ b/hooks/hooks.py
@@ -57,7 +57,8 @@ def apt_get_
if package is None:
return False
cmd_line = ['apt-get', '-y', 'install', '-qq']
- cmd_line.
+ for pkg in package.split(' '):
+ cmd_line.
return subprocess.
Related branches
- Junien F: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 85 lines (+13/-7)3 files modified.gitignore (+2/-0)
hooks/hooks.py (+6/-5)
hooks/tests/test_balancer_hook.py (+5/-2)
- Tom Haddon: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 28 lines (+6/-2)2 files modifiedconfig.yaml (+4/-1)
hooks/hooks.py (+2/-1)
Changed in apache2-charm: | |
importance: | Undecided → Medium |
assignee: | nobody → Benjamin Allot (ballot) |
status: | New → Fix Released |