Merge lp:~hopem/charms/trusty/nova-cloud-controller/novnc-ssl into lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 151
Proposed branch: lp:~hopem/charms/trusty/nova-cloud-controller/novnc-ssl
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/next
Diff against target: 116 lines (+41/-0)
6 files modified
hooks/nova_cc_context.py (+20/-0)
templates/icehouse/nova.conf (+2/-0)
templates/juno/nova.conf (+2/-0)
templates/kilo/nova.conf (+2/-0)
templates/parts/novnc (+9/-0)
unit_tests/test_nova_cc_contexts.py (+6/-0)
To merge this branch: bzr merge lp:~hopem/charms/trusty/nova-cloud-controller/novnc-ssl
Reviewer Review Type Date Requested Status
Billy Olsen Approve
Review via email: mp+255444@code.launchpad.net
To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #3111 nova-cloud-controller-next for hopem mp255444
    LINT OK: passed

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

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

charm_unit_test #2899 nova-cloud-controller-next for hopem mp255444
    UNIT OK: passed

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

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

charm_amulet_test #2944 nova-cloud-controller-next for hopem mp255444
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/10767721/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2944/

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

Changes look good to me, approve.

review: Approve
151. By Edward Hope-Morley

[hopem,r=]

Fixes novnc SSL (ha and single unit)

Closes-Bug: 1441143

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

charm_lint_check #3155 nova-cloud-controller-next for hopem mp255444
    LINT OK: passed

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

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

charm_unit_test #2943 nova-cloud-controller-next for hopem mp255444
    UNIT OK: passed

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

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

charm_amulet_test #2947 nova-cloud-controller-next for hopem mp255444
    AMULET FAIL: amulet-test failed

AMULET Results (max last 2 lines):
make: *** [test] Error 1
ERROR:root:Make target returned non-zero.

Full amulet test output: http://paste.ubuntu.com/10772684/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2947/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/nova_cc_context.py'
2--- hooks/nova_cc_context.py 2015-01-22 16:00:02 +0000
3+++ hooks/nova_cc_context.py 2015-04-08 12:10:41 +0000
4@@ -1,3 +1,5 @@
5+import os
6+
7 from charmhelpers.core.hookenv import (
8 config,
9 relation_ids,
10@@ -329,4 +331,22 @@
11 servers = []
12
13 ctxt['memcached_servers'] = ','.join(servers)
14+
15+ # Configure nova-novncproxy https if nova-api is using https.
16+ if https():
17+ cn = resolve_address(endpoint_type=INTERNAL)
18+ if cn:
19+ cert_filename = 'cert_{}'.format(cn)
20+ key_filename = 'key_{}'.format(cn)
21+ else:
22+ cert_filename = 'cert'
23+ key_filename = 'key'
24+
25+ ssl_dir = '/etc/apache2/ssl/nova'
26+ cert = os.path.join(ssl_dir, cert_filename)
27+ key = os.path.join(ssl_dir, key_filename)
28+ if os.path.exists(cert) and os.path.exists(key):
29+ ctxt['ssl_cert'] = cert
30+ ctxt['ssl_key'] = key
31+
32 return ctxt
33
34=== modified file 'templates/icehouse/nova.conf'
35--- templates/icehouse/nova.conf 2015-03-31 14:56:11 +0000
36+++ templates/icehouse/nova.conf 2015-04-08 12:10:41 +0000
37@@ -42,6 +42,8 @@
38 memcached_servers = {{ memcached_servers }}
39 {% endif %}
40
41+{% include "parts/novnc" %}
42+
43 {% if keystone_ec2_url -%}
44 keystone_ec2_url = {{ keystone_ec2_url }}
45 {% endif -%}
46
47=== modified file 'templates/juno/nova.conf'
48--- templates/juno/nova.conf 2015-03-30 17:00:34 +0000
49+++ templates/juno/nova.conf 2015-04-08 12:10:41 +0000
50@@ -42,6 +42,8 @@
51 memcached_servers = {{ memcached_servers }}
52 {% endif %}
53
54+{% include "parts/novnc" %}
55+
56 {% if keystone_ec2_url -%}
57 keystone_ec2_url = {{ keystone_ec2_url }}
58 {% endif -%}
59
60=== modified file 'templates/kilo/nova.conf'
61--- templates/kilo/nova.conf 2015-03-31 14:56:11 +0000
62+++ templates/kilo/nova.conf 2015-04-08 12:10:41 +0000
63@@ -41,6 +41,8 @@
64 memcached_servers = {{ memcached_servers }}
65 {% endif %}
66
67+{% include "parts/novnc" %}
68+
69 {% if keystone_ec2_url -%}
70 keystone_ec2_url = {{ keystone_ec2_url }}
71 {% endif -%}
72
73=== added file 'templates/parts/novnc'
74--- templates/parts/novnc 1970-01-01 00:00:00 +0000
75+++ templates/parts/novnc 2015-04-08 12:10:41 +0000
76@@ -0,0 +1,9 @@
77+{%- if ssl_only -%}
78+ssl_only=true
79+{% endif -%}
80+{% if ssl_cert -%}
81+cert={{ ssl_cert }}
82+{% endif -%}
83+{% if ssl_key -%}
84+key={{ ssl_key }}
85+{% endif %}
86
87=== modified file 'unit_tests/test_nova_cc_contexts.py'
88--- unit_tests/test_nova_cc_contexts.py 2015-01-20 09:32:55 +0000
89+++ unit_tests/test_nova_cc_contexts.py 2015-04-08 12:10:41 +0000
90@@ -47,6 +47,8 @@
91 self.config.side_effect = self.test_config.get
92 self.log.side_effect = fake_log
93
94+ @mock.patch.object(context, 'resolve_address',
95+ lambda *args, **kwargs: None)
96 @mock.patch.object(utils, 'os_release')
97 @mock.patch('charmhelpers.contrib.network.ip.log')
98 def test_instance_console_context_without_memcache(self, os_release, log_):
99@@ -57,6 +59,8 @@
100 self.assertEqual({'memcached_servers': ''},
101 instance_console())
102
103+ @mock.patch.object(context, 'resolve_address',
104+ lambda *args, **kwargs: None)
105 @mock.patch.object(utils, 'os_release')
106 @mock.patch('charmhelpers.contrib.network.ip.log')
107 def test_instance_console_context_with_memcache(self, os_release, log_):
108@@ -64,6 +68,8 @@
109 '127.0.1.1',
110 '127.0.1.1')
111
112+ @mock.patch.object(context, 'resolve_address',
113+ lambda *args, **kwargs: None)
114 @mock.patch.object(utils, 'os_release')
115 @mock.patch('charmhelpers.contrib.network.ip.log')
116 def test_instance_console_context_with_memcache_ipv6(self, os_release,

Subscribers

People subscribed via source and target branches