Merge lp:~dweaver/charms/precise/mysql/fix-for-lp1314763 into lp:charms/mysql

Proposed by Darryl Weaver on 2014-08-13
Status: Merged
Merged at revision: 126
Proposed branch: lp:~dweaver/charms/precise/mysql/fix-for-lp1314763
Merge into: lp:charms/mysql
Diff against target: 44 lines (+12/-3)
2 files modified
hooks/master-relation-changed (+11/-2)
revision (+1/-1)
To merge this branch: bzr merge lp:~dweaver/charms/precise/mysql/fix-for-lp1314763
Reviewer Review Type Date Requested Status
Marco Ceppi 2014-08-13 Approve on 2014-08-13
Review via email: mp+230730@code.launchpad.net

Description of the change

Fix for bug 1314763.
Changed the master-relation-changed hook to handle either apache 2.2 or apache 2.4 site configurations.

To post a comment you must log in.
Marco Ceppi (marcoceppi) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/master-relation-changed'
2--- hooks/master-relation-changed 2014-04-10 16:06:25 +0000
3+++ hooks/master-relation-changed 2014-08-13 23:11:12 +0000
4@@ -10,6 +10,7 @@
5 snapdir=/var/www/snaps
6 mkdir -p $snapdir
7 apt-get -y install apache2
8+APACHE_VERSION=`dpkg-query -W -f='${Version}\n' apache2 | cut -c1-3`
9 # disable wide-open access (restrict to each db IP)
10 rhosts=""
11 remote_ip=""
12@@ -31,7 +32,11 @@
13 rhosts=${rhosts##,}
14
15 # if there are no hosts, we simply disable all access
16-target=/etc/apache2/sites-available/mysql-dumps
17+if [ "$APACHE_VERSION" = "2.2" ] ; then
18+ target=/etc/apache2/sites-available/mysql-dumps
19+else
20+ target=/etc/apache2/sites-available/mysql-dumps.conf
21+fi
22 cat > $target <<EOF
23 DocumentRoot /var/www
24 <Directory /var/www>
25@@ -48,7 +53,11 @@
26 </Directory>
27 EOF
28 a2ensite mysql-dumps
29-a2dissite default
30+if [ "$APACHE_VERSION" = "2.2" ] ; then
31+ a2dissite default
32+else
33+ a2dissite 000-default
34+fi
35 service apache2 reload
36
37 pass=`pwgen -s 16`
38
39=== modified file 'revision'
40--- revision 2014-05-09 11:17:36 +0000
41+++ revision 2014-08-13 23:11:12 +0000
42@@ -1,1 +1,1 @@
43-325
44+326

Subscribers

People subscribed via source and target branches