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
=== modified file 'hooks/hooks.py'
--- hooks/hooks.py 2015-01-15 15:43:50 +0000
+++ hooks/hooks.py 2015-04-29 13:38:38 +0000
@@ -199,11 +199,9 @@
199 hosts = []199 hosts = []
200 for relid in relation_ids('mon'):200 for relid in relation_ids('mon'):
201 for unit in related_units(relid):201 for unit in related_units(relid):
202 hosts.append(202 host_ip = get_host_ip(relation_get('ceph-public-address',
203 '{}:6789'.format(get_host_ip(203 unit, relid))
204 relation_get('private-address',204 hosts.append('{}:6789'.format(host_ip))
205 unit, relid)))
206 )
207205
208 hosts.sort()206 hosts.sort()
209 return hosts207 return hosts
210208
=== modified file 'unit_tests/test_hooks.py'
--- unit_tests/test_hooks.py 2015-03-30 17:04:31 +0000
+++ unit_tests/test_hooks.py 2015-04-29 13:38:38 +0000
@@ -213,8 +213,13 @@
213 def test_get_mon_hosts(self):213 def test_get_mon_hosts(self):
214 self.relation_ids.return_value = ['monrelid']214 self.relation_ids.return_value = ['monrelid']
215 self.related_units.return_value = ['monunit']215 self.related_units.return_value = ['monunit']
216 self.relation_get.return_value = '10.0.0.1'216
217 self.get_host_ip.return_value = '10.0.0.1'217 def rel_get(k, *args):
218 return {'private-address': '127.0.0.1',
219 'ceph-public-address': '10.0.0.1'}[k]
220
221 self.relation_get.side_effect = rel_get
222 self.get_host_ip.side_effect = lambda x: x
218 self.assertEquals(ceph_hooks.get_mon_hosts(), ['10.0.0.1:6789'])223 self.assertEquals(ceph_hooks.get_mon_hosts(), ['10.0.0.1:6789'])
219224
220 def test_get_conf(self):225 def test_get_conf(self):
221226
=== modified file 'unit_tests/test_utils.py'
--- unit_tests/test_utils.py 2015-03-30 17:04:31 +0000
+++ unit_tests/test_utils.py 2015-04-29 13:38:38 +0000
@@ -25,7 +25,7 @@
2525
26 if not config:26 if not config:
27 logging.error('Could not find config.yaml in any parent directory '27 logging.error('Could not find config.yaml in any parent directory '
28 'of %s. ' % file)28 'of %s. ' % f)
29 raise Exception29 raise Exception
3030
31 return yaml.safe_load(open(config).read())['options']31 return yaml.safe_load(open(config).read())['options']

Subscribers

People subscribed via source and target branches