Merge lp:~gnuoy/charms/trusty/nova-cloud-controller/next-multi-console-fix into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Liam Young
Status: Work in progress
Proposed branch: lp:~gnuoy/charms/trusty/nova-cloud-controller/next-multi-console-fix
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 47 lines (+14/-1)
3 files modified
hooks/nova_cc_hooks.py (+3/-0)
hooks/nova_cc_utils.py (+1/-1)
unit_tests/test_nova_cc_utils.py (+10/-0)
To merge this branch: bzr merge lp:~gnuoy/charms/trusty/nova-cloud-controller/next-multi-console-fix
Reviewer Review Type Date Requested Status
James Page Needs Information
Yaguang Tang (community) Approve
Chris Glass Pending
Review via email: mp+233612@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Yaguang Tang (heut2008) :
review: Approve
Revision history for this message
Yaguang Tang (heut2008) wrote :

I think in the future, may be it's better to have memcached service cache tokens, and so it's more scaleable.

Revision history for this message
James Page (james-page) wrote :

I'm not sure this is quite the right fix; I think the nova-consoleauth service should either be run in the cluster as a singleton, or we should use memcached across the cluster.

review: Needs Information

Unmerged revisions

98. By Liam Young

Only run one console proxy as each proxy will reject the others tokens

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova_cc_hooks.py'
2--- hooks/nova_cc_hooks.py 2014-09-04 09:20:50 +0000
3+++ hooks/nova_cc_hooks.py 2014-09-06 07:11:11 +0000
4@@ -581,6 +581,9 @@
5 CONFIGS.write(NEUTRON_CONF)
6
7 if not is_leader(CLUSTER_RES):
8+ if console_attributes('protocol'):
9+ for service in console_attributes('services'):
10+ service_stop(service)
11 log('ha_changed: hacluster complete but we are not leader.')
12 return
13 log('Cluster configured, notifying other services and updating '
14
15=== modified file 'hooks/nova_cc_utils.py'
16--- hooks/nova_cc_utils.py 2014-07-29 14:42:08 +0000
17+++ hooks/nova_cc_utils.py 2014-09-06 07:11:11 +0000
18@@ -256,7 +256,7 @@
19 if os_release('nova-common') not in ['essex', 'folsom']:
20 resource_map['/etc/nova/nova.conf']['services'] += ['nova-conductor']
21
22- if console_attributes('services'):
23+ if console_attributes('services') and eligible_leader(CLUSTER_RES):
24 resource_map['/etc/nova/nova.conf']['services'] += \
25 console_attributes('services')
26
27
28=== modified file 'unit_tests/test_nova_cc_utils.py'
29--- unit_tests/test_nova_cc_utils.py 2014-07-29 14:42:08 +0000
30+++ unit_tests/test_nova_cc_utils.py 2014-09-06 07:11:11 +0000
31@@ -256,6 +256,16 @@
32 for service in console_services:
33 self.assertIn(service, _map['/etc/nova/nova.conf']['services'])
34
35+ @patch('charmhelpers.contrib.openstack.context.SubordinateConfigContext')
36+ def test_resource_map_console_notleader(self, subcontext):
37+ self.test_config.set('console-access-protocol', 'spice')
38+ self.eligible_leader.return_value = False
39+ self.relation_ids.return_value = []
40+ _map = utils.resource_map()
41+ console_services = ['nova-spiceproxy', 'nova-consoleauth']
42+ for service in console_services:
43+ self.assertNotIn(service, _map['/etc/nova/nova.conf']['services'])
44+
45 @patch('os.path.exists')
46 @patch('charmhelpers.contrib.openstack.context.SubordinateConfigContext')
47 def test_restart_map_api_before_frontends(self, subcontext, _exists):

Subscribers

People subscribed via source and target branches