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

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 143
Proposed branch: lp:~hopem/charms/trusty/nova-cloud-controller/novnc-ssl-stable
Merge into: lp:~openstack-charmers-archive/charms/trusty/nova-cloud-controller/trunk
Diff against target: 103 lines (+39/-0)
5 files modified
hooks/nova_cc_context.py (+20/-0)
templates/icehouse/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-stable
Reviewer Review Type Date Requested Status
Billy Olsen Approve
Review via email: mp+255445@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 #3112 nova-cloud-controller for hopem mp255445
    LINT OK: passed

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

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

charm_unit_test #2900 nova-cloud-controller for hopem mp255445
    UNIT OK: passed

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

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

charm_amulet_test #2945 nova-cloud-controller for hopem mp255445
    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/10767989/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2945/

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

LGTM, Approve

review: Approve
143. By Edward Hope-Morley

[hopem,r=]

Fixes novnc SSL (ha and single unit)

Backport from /next

Closes-Bug: 1441143

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

charm_lint_check #3156 nova-cloud-controller for hopem mp255445
    LINT OK: passed

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

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

charm_unit_test #2944 nova-cloud-controller for hopem mp255445
    UNIT OK: passed

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

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

charm_amulet_test #2948 nova-cloud-controller for hopem mp255445
    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/10772685/
Build: http://10.245.162.77:8080/job/charm_amulet_test/2948/

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:13:57 +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-01-07 12:05:04 +0000
36+++ templates/icehouse/nova.conf 2015-04-08 12:13:57 +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/kilo/nova.conf'
48--- templates/kilo/nova.conf 2015-01-21 09:24:29 +0000
49+++ templates/kilo/nova.conf 2015-04-08 12:13:57 +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=== added file 'templates/parts/novnc'
61--- templates/parts/novnc 1970-01-01 00:00:00 +0000
62+++ templates/parts/novnc 2015-04-08 12:13:57 +0000
63@@ -0,0 +1,9 @@
64+{%- if ssl_only -%}
65+ssl_only=true
66+{% endif -%}
67+{% if ssl_cert -%}
68+cert={{ ssl_cert }}
69+{% endif -%}
70+{% if ssl_key -%}
71+key={{ ssl_key }}
72+{% endif %}
73
74=== modified file 'unit_tests/test_nova_cc_contexts.py'
75--- unit_tests/test_nova_cc_contexts.py 2015-01-20 09:32:55 +0000
76+++ unit_tests/test_nova_cc_contexts.py 2015-04-08 12:13:57 +0000
77@@ -47,6 +47,8 @@
78 self.config.side_effect = self.test_config.get
79 self.log.side_effect = fake_log
80
81+ @mock.patch.object(context, 'resolve_address',
82+ lambda *args, **kwargs: None)
83 @mock.patch.object(utils, 'os_release')
84 @mock.patch('charmhelpers.contrib.network.ip.log')
85 def test_instance_console_context_without_memcache(self, os_release, log_):
86@@ -57,6 +59,8 @@
87 self.assertEqual({'memcached_servers': ''},
88 instance_console())
89
90+ @mock.patch.object(context, 'resolve_address',
91+ lambda *args, **kwargs: None)
92 @mock.patch.object(utils, 'os_release')
93 @mock.patch('charmhelpers.contrib.network.ip.log')
94 def test_instance_console_context_with_memcache(self, os_release, log_):
95@@ -64,6 +68,8 @@
96 '127.0.1.1',
97 '127.0.1.1')
98
99+ @mock.patch.object(context, 'resolve_address',
100+ lambda *args, **kwargs: None)
101 @mock.patch.object(utils, 'os_release')
102 @mock.patch('charmhelpers.contrib.network.ip.log')
103 def test_instance_console_context_with_memcache_ipv6(self, os_release,

Subscribers

People subscribed via source and target branches