Merge lp:~hopem/charms/trusty/keystone/lp1476325 into lp:~openstack-charmers-archive/charms/trusty/keystone/next

Proposed by Edward Hope-Morley
Status: Superseded
Proposed branch: lp:~hopem/charms/trusty/keystone/lp1476325
Merge into: lp:~openstack-charmers-archive/charms/trusty/keystone/next
Diff against target: 60 lines (+31/-1)
2 files modified
hooks/keystone_hooks.py (+7/-1)
unit_tests/test_keystone_hooks.py (+24/-0)
To merge this branch: bzr merge lp:~hopem/charms/trusty/keystone/lp1476325
Reviewer Review Type Date Requested Status
Billy Olsen Needs Fixing
OpenStack Charmers Pending
Review via email: mp+265292@code.launchpad.net

This proposal has been superseded by a proposal from 2015-09-16.

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

charm_lint_check #6511 keystone-next for hopem mp265292
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/6511/

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

charm_unit_test #6143 keystone-next for hopem mp265292
    UNIT OK: passed

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

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

charm_amulet_test #5233 keystone-next for hopem mp265292
    AMULET OK: passed

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

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

Tested fine and looks good to me. Only request is for a unit test, otherwise I'm +1.

review: Needs Fixing
165. By Edward Hope-Morley

synced /next

166. By Edward Hope-Morley

added unit test, fixed logic

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/keystone_hooks.py'
2--- hooks/keystone_hooks.py 2015-07-22 10:39:31 +0000
3+++ hooks/keystone_hooks.py 2015-09-16 01:22:43 +0000
4@@ -499,6 +499,13 @@
5
6 if iface is not None:
7 vip_key = 'res_ks_{}_vip'.format(iface)
8+ if vip_key in vip_group:
9+ log("Resource '%s' (vip='%s') already exists in "
10+ "vip group - skipping" % (vip_key, vip),
11+ WARNING)
12+ continue
13+
14+ vip_group.append(vip_key)
15 resources[vip_key] = res_ks_vip
16 resource_params[vip_key] = (
17 'params {ip}="{vip}" cidr_netmask="{netmask}"'
18@@ -507,7 +514,6 @@
19 iface=iface,
20 netmask=netmask)
21 )
22- vip_group.append(vip_key)
23
24 if len(vip_group) >= 1:
25 relation_set(relation_id=relation_id,
26
27=== modified file 'unit_tests/test_keystone_hooks.py'
28--- unit_tests/test_keystone_hooks.py 2015-08-14 16:10:45 +0000
29+++ unit_tests/test_keystone_hooks.py 2015-09-16 01:22:43 +0000
30@@ -657,6 +657,30 @@
31 }
32 self.relation_set.assert_called_with(**args)
33
34+ def test_ha_joined_duplicate_vip_key(self):
35+ self.get_hacluster_config.return_value = {
36+ 'vip': '10.10.10.10 10.10.10.11',
37+ 'ha-bindiface': 'em0',
38+ 'ha-mcastport': '8080'
39+ }
40+ self.get_iface_for_address.return_value = 'em1'
41+ self.get_netmask_for_address.return_value = '255.255.255.0'
42+ hooks.ha_joined()
43+ args = {
44+ 'relation_id': None,
45+ 'corosync_bindiface': 'em0',
46+ 'corosync_mcastport': '8080',
47+ 'init_services': {'res_ks_haproxy': 'haproxy'},
48+ 'resources': {'res_ks_em1_vip': 'ocf:heartbeat:IPaddr2',
49+ 'res_ks_haproxy': 'lsb:haproxy'},
50+ 'resource_params': {
51+ 'res_ks_em1_vip': 'params ip="10.10.10.10"'
52+ ' cidr_netmask="255.255.255.0" nic="em1"',
53+ 'res_ks_haproxy': 'op monitor interval="5s"'},
54+ 'clones': {'cl_ks_haproxy': 'res_ks_haproxy'}
55+ }
56+ self.relation_set.assert_called_with(**args)
57+
58 def test_ha_joined_no_bound_ip(self):
59 self.get_hacluster_config.return_value = {
60 'vip': '10.10.10.10',

Subscribers

People subscribed via source and target branches