Merge lp:~hopem/charms/trusty/heat/lp1511326 into lp:~openstack-charmers-archive/charms/trusty/heat/next

Proposed by Edward Hope-Morley
Status: Merged
Merged at revision: 61
Proposed branch: lp:~hopem/charms/trusty/heat/lp1511326
Merge into: lp:~openstack-charmers-archive/charms/trusty/heat/next
Diff against target: 171 lines (+62/-5)
5 files modified
config.yaml (+12/-0)
hooks/heat_relations.py (+18/-3)
hooks/heat_utils.py (+20/-2)
templates/kilo/heat.conf (+2/-0)
unit_tests/test_heat_relations.py (+10/-0)
To merge this branch: bzr merge lp:~hopem/charms/trusty/heat/lp1511326
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
OpenStack Charmers Pending
Review via email: mp+277534@code.launchpad.net

This proposal supersedes a proposal from 2015-10-29.

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

charm_lint_check #12854 heat-next for hopem mp276107
    LINT FAIL: lint-test failed

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

Full lint test output: http://paste.ubuntu.com/12998533/
Build: http://10.245.162.77:8080/job/charm_lint_check/12854/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_unit_test #11933 heat-next for hopem mp276107
    UNIT OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_amulet_test #7646 heat-next for hopem mp276107
    AMULET OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_lint_check #12924 heat-next for hopem mp276107
    LINT OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_unit_test #12000 heat-next for hopem mp276107
    UNIT OK: passed

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

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote : Posted in a previous version of this proposal

charm_amulet_test #7667 heat-next for hopem mp276107
    AMULET FAIL: amulet-test failed

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

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

Revision history for this message
Liam Young (gnuoy) wrote : Posted in a previous version of this proposal

There is a conflict since the loglevel changes landed and a unit test failure:

======================================================================
ERROR: It properly requests access to a shared-db service
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/liam/branches/merges/heat-276243/unit_tests/test_heat_relations.py", line 243, in test_db_joined_with_ipv6
    self.sync_db_with_multi_ipv6_addresses.assert_called_with_once(
  File "/usr/lib/python2.7/dist-packages/mock/mock.py", line 721, in __getattr__
    raise AttributeError(name)
AttributeError: assert_called_with_once

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

charm_unit_test #12922 heat-next for hopem mp277534
    UNIT OK: passed

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

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

charm_lint_check #13861 heat-next for hopem mp277534
    LINT OK: passed

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

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

charm_amulet_test #7898 heat-next for hopem mp277534
    AMULET FAIL: amulet-test failed

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

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

Revision history for this message
Liam Young (gnuoy) wrote :

The previous amulet run worked and the recent fail seems to be down to undercloud issues so will land and hopem will run an ipv6 test

Revision history for this message
Liam Young (gnuoy) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'config.yaml'
2--- config.yaml 2015-10-30 11:03:11 +0000
3+++ config.yaml 2015-11-16 09:18:09 +0000
4@@ -103,3 +103,15 @@
5 wait for you to execute the openstack-upgrade action for this charm on
6 each unit. If False it will revert to existing behavior of upgrading
7 all units on config change.
8+ prefer-ipv6:
9+ type: boolean
10+ default: False
11+ description: |
12+ If True enables IPv6 support. The charm will expect network interfaces
13+ to be configured with an IPv6 address. If set to False (default) IPv4
14+ is expected.
15+ .
16+ NOTE: these charms do not currently support IPv6 privacy extension. In
17+ order for this charm to function correctly, the privacy extension must be
18+ disabled and a non-temporary address must be configured/available on
19+ your network interface.
20
21=== modified file 'hooks/heat_relations.py'
22--- hooks/heat_relations.py 2015-10-08 13:13:09 +0000
23+++ hooks/heat_relations.py 2015-11-16 09:18:09 +0000
24@@ -39,6 +39,7 @@
25 configure_installation_source,
26 openstack_upgrade_available,
27 set_os_workload_status,
28+ sync_db_with_multi_ipv6_addresses,
29 )
30
31 from charmhelpers.contrib.openstack.ip import (
32@@ -56,6 +57,7 @@
33 register_configs,
34 HEAT_CONF,
35 REQUIRED_INTERFACES,
36+ setup_ipv6,
37 )
38
39 from heat_context import (
40@@ -95,6 +97,14 @@
41 if openstack_upgrade_available('heat-common'):
42 status_set('maintenance', 'Running openstack upgrade')
43 do_openstack_upgrade(CONFIGS)
44+
45+ if config('prefer-ipv6'):
46+ status_set('maintenance', 'configuring ipv6')
47+ setup_ipv6()
48+ sync_db_with_multi_ipv6_addresses(config('database'),
49+ config('database-user'),
50+ relation_prefix='heat')
51+
52 CONFIGS.write_all()
53 configure_https()
54
55@@ -116,9 +126,14 @@
56
57 @hooks.hook('shared-db-relation-joined')
58 def db_joined():
59- relation_set(heat_database=config('database'),
60- heat_username=config('database-user'),
61- heat_hostname=unit_get('private-address'))
62+ if config('prefer-ipv6'):
63+ sync_db_with_multi_ipv6_addresses(config('database'),
64+ config('database-user'),
65+ relation_prefix='heat')
66+ else:
67+ relation_set(heat_database=config('database'),
68+ heat_username=config('database-user'),
69+ heat_hostname=unit_get('private-address'))
70
71
72 @hooks.hook('shared-db-relation-changed')
73
74=== modified file 'hooks/heat_utils.py'
75--- hooks/heat_utils.py 2015-10-30 11:03:11 +0000
76+++ hooks/heat_utils.py 2015-11-16 09:18:09 +0000
77@@ -17,6 +17,7 @@
78 os_release)
79
80 from charmhelpers.fetch import (
81+ add_source,
82 apt_install,
83 apt_update,
84 apt_upgrade,
85@@ -24,10 +25,11 @@
86
87 from charmhelpers.core.hookenv import (
88 log,
89- config
90+ config,
91 )
92
93 from charmhelpers.core.host import (
94+ lsb_release,
95 service_start,
96 service_stop,
97 )
98@@ -85,7 +87,8 @@
99 HeatHAProxyContext(),
100 EncryptionContext(),
101 context.SyslogContext(),
102- context.LogLevelContext()]
103+ context.LogLevelContext(),
104+ context.BindHostContext()]
105 }),
106 (HEAT_API_PASTE, {
107 'services': [s for s in BASE_SERVICES if 'api' in s],
108@@ -201,3 +204,18 @@
109 [service_stop(s) for s in services()]
110 check_call(['heat-manage', 'db_sync'])
111 [service_start(s) for s in services()]
112+
113+
114+def setup_ipv6():
115+ ubuntu_rel = lsb_release()['DISTRIB_CODENAME'].lower()
116+ if ubuntu_rel < "trusty":
117+ raise Exception("IPv6 is not supported in the charms for Ubuntu "
118+ "versions less than Trusty 14.04")
119+
120+ # Need haproxy >= 1.5.3 for ipv6 so for Trusty if we are <= Kilo we need to
121+ # use trusty-backports otherwise we can use the UCA.
122+ if ubuntu_rel == 'trusty' and os_release('heat-common') < 'liberty':
123+ add_source('deb http://archive.ubuntu.com/ubuntu trusty-backports '
124+ 'main')
125+ apt_update()
126+ apt_install('haproxy/trusty-backports', fatal=True)
127
128=== modified file 'templates/kilo/heat.conf'
129--- templates/kilo/heat.conf 2015-04-22 16:34:01 +0000
130+++ templates/kilo/heat.conf 2015-11-16 09:18:09 +0000
131@@ -64,6 +64,7 @@
132 api_paste_config=/etc/heat/api-paste.ini
133
134 [heat_api]
135+bind_host = {{ bind_host }}
136 {% if api_listen_port -%}
137 bind_port={{ api_listen_port }}
138 {% else -%}
139@@ -71,6 +72,7 @@
140 {% endif %}
141
142 [heat_api_cfn]
143+bind_host = {{ bind_host }}
144 {% if api_cfn_listen_port -%}
145 bind_port={{ api_cfn_listen_port }}
146 {% else -%}
147
148=== modified file 'unit_tests/test_heat_relations.py'
149--- unit_tests/test_heat_relations.py 2015-11-02 11:18:46 +0000
150+++ unit_tests/test_heat_relations.py 2015-11-16 09:18:09 +0000
151@@ -31,6 +31,7 @@
152 'openstack_upgrade_available',
153 'determine_packages',
154 'charm_dir',
155+ 'sync_db_with_multi_ipv6_addresses',
156 # charmhelpers.contrib.hahelpers.cluster_utils
157 # heat_utils
158 'restart_map',
159@@ -232,3 +233,12 @@
160 relations.identity_changed()
161 self.assertTrue(self.log.called)
162 self.assertFalse(configs.write.called)
163+
164+ def test_db_joined_with_ipv6(self):
165+ 'It properly requests access to a shared-db service'
166+ self.unit_get.return_value = 'heatnode1'
167+ self.sync_db_with_multi_ipv6_addresses.return_value = MagicMock()
168+ self.test_config.set('prefer-ipv6', True)
169+ relations.db_joined()
170+ self.sync_db_with_multi_ipv6_addresses.assert_called_with_once(
171+ 'heat', 'heat')

Subscribers

People subscribed via source and target branches