Merge lp:~thedac/charms/trusty/mysql/bug1577556 into lp:charms/trusty/mysql

Proposed by David Ames
Status: Merged
Merged at revision: 159
Proposed branch: lp:~thedac/charms/trusty/mysql/bug1577556
Merge into: lp:charms/trusty/mysql
Diff against target: 14 lines (+3/-1)
1 file modified
hooks/lib/utils.py (+3/-1)
To merge this branch: bzr merge lp:~thedac/charms/trusty/mysql/bug1577556
Reviewer Review Type Date Requested Status
Review Queue (community) automated testing Needs Fixing
Liam Young (community) Approve
Review via email: mp+293576@code.launchpad.net

Description of the change

Fix Bug#1577556

The traceback in Bug #1577556 shows this error occurs during "load time" as unit-get is executed in the parameter list of get_host_ip. unit-get will not actually be called for real till much later. Allow that time to pass.

Loop testing that caught the original bug (installing many mysqls on loop) has not seen this error with this fix.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #1927 mysql for thedac mp293576
    UNIT OK: passed

Build: http://10.245.162.36:8080/job/charm_unit_test/1927/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #2463 mysql for thedac mp293576
    LINT OK: passed

Build: http://10.245.162.36:8080/job/charm_lint_check/2463/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #734 mysql for thedac mp293576
    AMULET OK: passed

Build: http://10.245.162.36:8080/job/charm_amulet_test/734/

Revision history for this message
Liam Young (gnuoy) wrote :

This is a much better, +1

review: Approve
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-lxc/3969/

review: Needs Fixing (automated testing)
Revision history for this message
Review Queue (review-queue) wrote :

This item has failed automated testing! Results available here http://juju-ci.vapour.ws:8080/job/charm-bundle-test-aws/4010/

review: Needs Fixing (automated testing)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/lib/utils.py'
2--- hooks/lib/utils.py 2014-12-17 17:29:07 +0000
3+++ hooks/lib/utils.py 2016-05-02 23:31:49 +0000
4@@ -148,7 +148,9 @@
5 return socket.gethostname()
6
7
8-def get_host_ip(hostname=unit_get('private-address')):
9+def get_host_ip(hostname=None):
10+ if hostname is None:
11+ hostname = unit_get('private-address')
12 try:
13 # Test to see if already an IPv4 address
14 socket.inet_aton(hostname)

Subscribers

People subscribed via source and target branches

to all changes: