Merge lp:~lutostag/charms/trusty/apache2/multiple-extra-packages into lp:charms/trusty/apache2

Proposed by Greg Lutostanski
Status: Needs review
Proposed branch: lp:~lutostag/charms/trusty/apache2/multiple-extra-packages
Merge into: lp:charms/trusty/apache2
Diff against target: 10 lines (+1/-1)
1 file modified
hooks/hooks.py (+1/-1)
To merge this branch: bzr merge lp:~lutostag/charms/trusty/apache2/multiple-extra-packages
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+307765@code.launchpad.net

Description of the change

Allow installing more than just 1 extra_package (as the name implies extra_packages).

if you set extra_packages="python-openssl python-pyramid"
neither will get installed with the following error:
2016-10-05 20:36:17 INFO reverseproxy-relation-joined E: Unable to locate package python-openssl python-pyramid

This is because with the subprocess.call it does not automatically split space delimited args and passes it as one commandline arg to apt-get which thinks it is just one package name.

To post a comment you must log in.

Unmerged revisions

73. By Greg Lutostanski

allow installing multiple extra_packages

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2016-02-25 20:46:58 +0000
3+++ hooks/hooks.py 2016-10-05 20:52:58 +0000
4@@ -57,7 +57,7 @@
5 if package is None:
6 return False
7 cmd_line = ['apt-get', '-y', 'install', '-qq']
8- cmd_line.append(package)
9+ cmd_line.extend(package.split(' '))
10 return subprocess.call(cmd_line)
11
12

Subscribers

People subscribed via source and target branches

to all changes: