Merge lp:~hopem/charms/trusty/ceph-radosgw/lp1449279-stable-backport into lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/trunk

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 39
Proposed branch: lp:~hopem/charms/trusty/ceph-radosgw/lp1449279-stable-backport
Merge into: lp:~openstack-charmers-archive/charms/trusty/ceph-radosgw/trunk
Diff against target: 51 lines (+11/-8)
3 files modified
hooks/hooks.py (+3/-5)
unit_tests/test_hooks.py (+7/-2)
unit_tests/test_utils.py (+1/-1)
To merge this branch: bzr merge lp:~hopem/charms/trusty/ceph-radosgw/lp1449279-stable-backport
Reviewer Review Type Date Requested Status
Billy Olsen Approve
Review via email: mp+257755@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Billy Olsen (billy-olsen) wrote :

LGTM, Approved

review: Approve

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 2015-01-15 15:43:50 +0000
3+++ hooks/hooks.py 2015-04-29 13:38:38 +0000
4@@ -199,11 +199,9 @@
5 hosts = []
6 for relid in relation_ids('mon'):
7 for unit in related_units(relid):
8- hosts.append(
9- '{}:6789'.format(get_host_ip(
10- relation_get('private-address',
11- unit, relid)))
12- )
13+ host_ip = get_host_ip(relation_get('ceph-public-address',
14+ unit, relid))
15+ hosts.append('{}:6789'.format(host_ip))
16
17 hosts.sort()
18 return hosts
19
20=== modified file 'unit_tests/test_hooks.py'
21--- unit_tests/test_hooks.py 2015-03-30 17:04:31 +0000
22+++ unit_tests/test_hooks.py 2015-04-29 13:38:38 +0000
23@@ -213,8 +213,13 @@
24 def test_get_mon_hosts(self):
25 self.relation_ids.return_value = ['monrelid']
26 self.related_units.return_value = ['monunit']
27- self.relation_get.return_value = '10.0.0.1'
28- self.get_host_ip.return_value = '10.0.0.1'
29+
30+ def rel_get(k, *args):
31+ return {'private-address': '127.0.0.1',
32+ 'ceph-public-address': '10.0.0.1'}[k]
33+
34+ self.relation_get.side_effect = rel_get
35+ self.get_host_ip.side_effect = lambda x: x
36 self.assertEquals(ceph_hooks.get_mon_hosts(), ['10.0.0.1:6789'])
37
38 def test_get_conf(self):
39
40=== modified file 'unit_tests/test_utils.py'
41--- unit_tests/test_utils.py 2015-03-30 17:04:31 +0000
42+++ unit_tests/test_utils.py 2015-04-29 13:38:38 +0000
43@@ -25,7 +25,7 @@
44
45 if not config:
46 logging.error('Could not find config.yaml in any parent directory '
47- 'of %s. ' % file)
48+ 'of %s. ' % f)
49 raise Exception
50
51 return yaml.safe_load(open(config).read())['options']

Subscribers

People subscribed via source and target branches