Merge lp:~jhasaurabh/charms/precise/wildfly/trunk into lp:charms/wildfly

Proposed by saurabh on 2014-10-08
Status: Merged
Merged at revision: 8
Proposed branch: lp:~jhasaurabh/charms/precise/wildfly/trunk
Merge into: lp:charms/wildfly
Diff against target: 49 lines (+14/-14)
2 files modified
hooks/db-relation-changed (+13/-13)
hooks/db-relation-joined (+1/-1)
To merge this branch: bzr merge lp:~jhasaurabh/charms/precise/wildfly/trunk
Reviewer Review Type Date Requested Status
Marco Ceppi 2014-10-08 Approve on 2014-11-04
Cory Johns Approve on 2014-10-28
Review Queue (community) automated testing Approve on 2014-10-24
Review via email: mp+237591@code.launchpad.net

Description of the change

Hi,
I found out a bug in the charm.
It worked fine when we add the mysql relation with wildfly for the first time.
But when I removed the relation and again added it back again there was a file missing which caused charm to stop.
I have made the change and tested it as well.
Hence I request you to merge the updated version of code to the mature branch.

Thanks,
Saurabh

To post a comment you must log in.
Review Queue (review-queue) wrote :

The results (PASS) are in and available here: http://reports.vapour.ws/charm-tests/charm-bundle-test-1265-results

review: Approve (automated testing)
Cory Johns (johnsca) wrote :

Saurabh,

Thank you for this fix to the WildFly charm! The change looks good and works in my testing as well.

Out of curiosity, though, why did you change the name of the backup file? It seems that just changing the mv command to cp would have been sufficient and the smaller diff would have been a bit easier to review.

Regardless, the change is good and gets my +1. Thanks again for this fix!

review: Approve
Marco Ceppi (marcoceppi) wrote :

LGTM +1

review: Approve
8. By Marco Ceppi on 2014-11-04

[jhasaurabh] charm used to crash when adding mysql relation for the second time after removing the initial mysql relation

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/db-relation-changed'
2--- hooks/db-relation-changed 2014-02-16 14:30:53 +0000
3+++ hooks/db-relation-changed 2014-10-08 13:20:08 +0000
4@@ -14,19 +14,19 @@
5 if [ ! -f /opt/wildfly/standalone/deployments/wildfly-ds.xml ]; then
6
7 cat ${TMPL}/standalone2.xml >/opt/wildfly/standalone/configuration/standalone.xml
8-sed "4 c "\<connection-url\>jdbc:mysql://$host:3306/test\</connection-url\>"" /opt/wildfly/standalone/deployments/wildfly-ds.xml.bak >/tmp/ds.xml
9-
10-cat /tmp/ds.xml > /opt/wildfly/standalone/deployments/wildfly-ds.xml.bak
11-
12-sed "13 c "\<user-name\>$user\</user-name\>"" /opt/wildfly/standalone/deployments/wildfly-ds.xml.bak >/tmp/ds.xml
13-
14-cat /tmp/ds.xml > /opt/wildfly/standalone/deployments/wildfly-ds.xml.bak
15-
16-sed "14 c "\<password\>$password\</password\>"" /opt/wildfly/standalone/deployments/wildfly-ds.xml.bak >/tmp/ds.xml
17-
18-cat /tmp/ds.xml > /opt/wildfly/standalone/deployments/wildfly-ds.xml.bak
19-
20-mv /opt/wildfly/standalone/deployments/wildfly-ds.xml.bak /opt/wildfly/standalone/deployments/wildfly-ds.xml
21+sed "4 c "\<connection-url\>jdbc:mysql://$host:3306/test\</connection-url\>"" /opt/wildfly-ds.xml.bak >/tmp/ds.xml
22+
23+cat /tmp/ds.xml > /opt/wildfly-ds.xml.bak
24+
25+sed "13 c "\<user-name\>$user\</user-name\>"" /opt/wildfly-ds.xml.bak >/tmp/ds.xml
26+
27+cat /tmp/ds.xml > /opt/wildfly-ds.xml.bak
28+
29+sed "14 c "\<password\>$password\</password\>"" /opt/wildfly-ds.xml.bak >/tmp/ds.xml
30+
31+cat /tmp/ds.xml > /opt/wildfly-ds.xml.bak
32+
33+cp /opt/wildfly-ds.xml.bak /opt/wildfly/standalone/deployments/wildfly-ds.xml
34
35 else
36 juju-log "Database relation changed"
37
38=== modified file 'hooks/db-relation-joined'
39--- hooks/db-relation-joined 2014-02-16 14:30:53 +0000
40+++ hooks/db-relation-joined 2014-10-08 13:20:08 +0000
41@@ -13,7 +13,7 @@
42 mkdir -p /opt/wildfly/modules/system/layers/base/com/mysql/main
43 mv /opt/mysql/*jar /opt/wildfly/modules/system/layers/base/com/mysql/main
44 cp ${TMPL}/module.xml /opt/wildfly/modules/system/layers/base/com/mysql/main/
45-cat ${TMPL}/wildfly-ds.xml.bak >/opt/wildfly/standalone/deployments/wildfly-ds.xml.bak
46+cat ${TMPL}/wildfly-ds.xml.bak >/opt/wildfly-ds.xml.bak
47
48 else
49 juju-log " mysql conector is deployed "

Subscribers

People subscribed via source and target branches

to all changes: