Merge lp:~niedbalski/charms/trusty/rabbitmq-server/stable-backport-1489053 into lp:charms/trusty/rabbitmq-server

Proposed by Jorge Niedbalski
Status: Merged
Merged at revision: 104
Proposed branch: lp:~niedbalski/charms/trusty/rabbitmq-server/stable-backport-1489053
Merge into: lp:charms/trusty/rabbitmq-server
Diff against target: 97 lines (+27/-20)
3 files modified
hooks/charmhelpers/contrib/network/ip.py (+5/-1)
hooks/rabbit_utils.py (+4/-11)
hooks/rabbitmq_server_relations.py (+18/-8)
To merge this branch: bzr merge lp:~niedbalski/charms/trusty/rabbitmq-server/stable-backport-1489053
Reviewer Review Type Date Requested Status
Jorge Niedbalski (community) Approve
Billy Olsen Approve
Review via email: mp+272170@code.launchpad.net

Description of the change

Backport of fix for LP: #1489053

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

charm_lint_check #10580 rabbitmq-server for niedbalski mp272170
    LINT FAIL: lint-test failed
    LINT FAIL: charm-proof failed

LINT Results (max last 2 lines):
make: *** [lint] Error 100
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/12534576/
Build: http://10.245.162.77:8080/job/charm_lint_check/10580/

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

charm_unit_test #9768 rabbitmq-server for niedbalski mp272170
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/9768/

Revision history for this message
Billy Olsen (billy-olsen) wrote :

Changes LGTM - I'm awaiting the rest of OSCI's tests then I'll merge

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

charm_amulet_test #6714 rabbitmq-server for niedbalski mp272170
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6714/

Revision history for this message
Billy Olsen (billy-olsen) wrote :

LGTM, Approved!

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

charm_lint_check #10681 rabbitmq-server for niedbalski mp272170
    LINT FAIL: lint-test failed
    LINT FAIL: charm-proof failed

LINT Results (max last 2 lines):
make: *** [lint] Error 100
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/12543376/
Build: http://10.245.162.77:8080/job/charm_lint_check/10681/

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

charm_unit_test #9863 rabbitmq-server for niedbalski mp272170
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/9863/

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

charm_amulet_test #6720 rabbitmq-server for niedbalski mp272170
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6720/

Revision history for this message
Jorge Niedbalski (niedbalski) :
review: Approve
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #10698 rabbitmq-server for niedbalski mp272170
    LINT FAIL: lint-test failed
    LINT FAIL: charm-proof failed

LINT Results (max last 2 lines):
make: *** [lint] Error 100
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/12545759/
Build: http://10.245.162.77:8080/job/charm_lint_check/10698/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/charmhelpers/contrib/network/ip.py'
--- hooks/charmhelpers/contrib/network/ip.py 2015-09-23 12:04:43 +0000
+++ hooks/charmhelpers/contrib/network/ip.py 2015-09-23 19:38:09 +0000
@@ -437,8 +437,12 @@
437437
438 rev = dns.reversename.from_address(address)438 rev = dns.reversename.from_address(address)
439 result = ns_query(rev)439 result = ns_query(rev)
440
440 if not result:441 if not result:
441 return None442 try:
443 result = socket.gethostbyaddr(address)[0]
444 except:
445 return None
442 else:446 else:
443 result = address447 result = address
444448
445449
=== modified file 'hooks/rabbit_utils.py'
--- hooks/rabbit_utils.py 2015-09-10 16:16:02 +0000
+++ hooks/rabbit_utils.py 2015-09-23 19:38:09 +0000
@@ -2,7 +2,6 @@
2import pwd2import pwd
3import grp3import grp
4import re4import re
5import socket
6import sys5import sys
7import subprocess6import subprocess
8import glob7import glob
@@ -270,18 +269,12 @@
270 address = relation_get('private-address',269 address = relation_get('private-address',
271 rid=r_id, unit=unit)270 rid=r_id, unit=unit)
272 if address is not None:271 if address is not None:
273 try:272 node = get_hostname(address, fqdn=False)
274 node = get_hostname(address, fqdn=False)273 if node:
275 except:274 available_nodes.append(node)
275 else:
276 log('Cannot resolve hostname for {} '276 log('Cannot resolve hostname for {} '
277 'using DNS servers'.format(address), level='WARNING')277 'using DNS servers'.format(address), level='WARNING')
278 log('Falling back to use socket.gethostname()',
279 level='WARNING')
280 # If the private-address is not resolvable using DNS
281 # then use the current hostname
282 node = socket.gethostname()
283
284 available_nodes.append(node)
285278
286 if len(available_nodes) == 0:279 if len(available_nodes) == 0:
287 log('No nodes available to cluster with')280 log('No nodes available to cluster with')
288281
=== modified file 'hooks/rabbitmq_server_relations.py'
--- hooks/rabbitmq_server_relations.py 2015-09-10 16:16:02 +0000
+++ hooks/rabbitmq_server_relations.py 2015-09-23 19:38:09 +0000
@@ -273,11 +273,18 @@
273273
274@hooks.hook('cluster-relation-joined')274@hooks.hook('cluster-relation-joined')
275def cluster_joined(relation_id=None):275def cluster_joined(relation_id=None):
276 relation_settings = {
277 'hostname': get_local_nodename(),
278 }
279
276 if config('prefer-ipv6'):280 if config('prefer-ipv6'):
277 relation_settings = {'hostname': socket.gethostname(),281 relation_settings['private-address'] = get_ipv6_addr()[0]
278 'private-address': get_ipv6_addr()[0]}282 else:
279 relation_set(relation_id=relation_id,283 relation_settings['private-address'] = get_host_ip(
280 relation_settings=relation_settings)284 unit_get('private-address'))
285
286 relation_set(relation_id=relation_id,
287 relation_settings=relation_settings)
281288
282 if is_relation_made('ha') and \289 if is_relation_made('ha') and \
283 config('ha-vip-only') is False:290 config('ha-vip-only') is False:
@@ -324,10 +331,13 @@
324 log('cluster_joined: cookie not yet set.', level=INFO)331 log('cluster_joined: cookie not yet set.', level=INFO)
325 return332 return
326333
327 if config('prefer-ipv6') and rdata.get('hostname'):334 rdata = relation_get()
328 private_address = rdata.get('private-address')335
329 hostname = rdata.get('hostname')336 if rdata:
330 if hostname:337 hostname = rdata.get('hostname', None)
338 private_address = rdata.get('private-address', None)
339
340 if hostname and private_address:
331 rabbit.update_hosts_file({private_address: hostname})341 rabbit.update_hosts_file({private_address: hostname})
332342
333 if not is_sufficient_peers():343 if not is_sufficient_peers():

Subscribers

People subscribed via source and target branches