Merge lp:~corey.bryant/charms/trusty/ceilometer/aodh into lp:~openstack-charmers-archive/charms/trusty/ceilometer/next

Proposed by Corey Bryant on 2016-01-06
Status: Merged
Merged at revision: 110
Proposed branch: lp:~corey.bryant/charms/trusty/ceilometer/aodh
Merge into: lp:~openstack-charmers-archive/charms/trusty/ceilometer/next
Diff against target: 245 lines (+71/-29)
5 files modified
actions/actions.py (+7/-3)
lib/ceilometer_utils.py (+47/-16)
unit_tests/test_actions_openstack_upgrade.py (+2/-1)
unit_tests/test_ceilometer_hooks.py (+5/-4)
unit_tests/test_ceilometer_utils.py (+10/-5)
To merge this branch: bzr merge lp:~corey.bryant/charms/trusty/ceilometer/aodh
Reviewer Review Type Date Requested Status
Liam Young 2016-01-06 Approve on 2016-01-08
Review via email: mp+281779@code.launchpad.net
To post a comment you must log in.

charm_lint_check #16667 ceilometer-next for corey.bryant mp281779
    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/14423180/
Build: http://10.245.162.77:8080/job/charm_lint_check/16667/

charm_unit_test #15564 ceilometer-next for corey.bryant mp281779
    UNIT OK: passed

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

charm_amulet_test #8542 ceilometer-next for corey.bryant mp281779
    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/14423249/
Build: http://10.245.162.77:8080/job/charm_amulet_test/8542/

111. By Corey Bryant on 2016-01-06

Lint fixes for aodh-notifier and aodh-evaluator updates

charm_lint_check #16669 ceilometer-next for corey.bryant mp281779
    LINT OK: passed

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

charm_unit_test #15566 ceilometer-next for corey.bryant mp281779
    UNIT OK: passed

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

charm_amulet_test #8543 ceilometer-next for corey.bryant mp281779
    AMULET OK: passed

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

charm_amulet_test #8545 ceilometer-next for corey.bryant mp281779
    AMULET OK: passed

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

Liam Young (gnuoy) wrote :

approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'actions/actions.py'
2--- actions/actions.py 2015-10-16 13:01:34 +0000
3+++ actions/actions.py 2016-01-06 21:38:36 +0000
4@@ -6,7 +6,9 @@
5 from charmhelpers.core.host import service_pause, service_resume
6 from charmhelpers.core.hookenv import action_fail, status_set
7 from charmhelpers.core.unitdata import kv
8-from ceilometer_utils import CEILOMETER_SERVICES, assess_status
9+from ceilometer_utils import (
10+ CEILOMETER_BASE_SERVICES, assess_status, ceilometer_release_services,
11+)
12 from ceilometer_hooks import CONFIGS
13
14
15@@ -15,7 +17,8 @@
16
17 @raises Exception should the service fail to stop.
18 """
19- for service in CEILOMETER_SERVICES:
20+ services = CEILOMETER_BASE_SERVICES + ceilometer_release_services()
21+ for service in services:
22 if not service_pause(service):
23 raise Exception("Failed to %s." % service)
24
25@@ -32,7 +35,8 @@
26 """Resume the Ceilometer services.
27
28 @raises Exception should the service fail to start."""
29- for service in CEILOMETER_SERVICES:
30+ services = CEILOMETER_BASE_SERVICES + ceilometer_release_services()
31+ for service in services:
32 if not service_resume(service):
33 raise Exception("Failed to resume %s." % service)
34
35
36=== modified file 'lib/ceilometer_utils.py'
37--- lib/ceilometer_utils.py 2015-10-16 12:29:41 +0000
38+++ lib/ceilometer_utils.py 2016-01-06 21:38:36 +0000
39@@ -33,19 +33,29 @@
40 "openstack_https_frontend.conf"
41 CLUSTER_RES = 'grp_ceilometer_vips'
42
43-CEILOMETER_SERVICES = [
44+CEILOMETER_BASE_SERVICES = [
45 'ceilometer-agent-central',
46 'ceilometer-collector',
47 'ceilometer-api',
48- 'ceilometer-alarm-evaluator',
49- 'ceilometer-alarm-notifier',
50 'ceilometer-agent-notification',
51 ]
52
53+ICEHOUSE_SERVICES = [
54+ 'ceilometer-alarm-notifier',
55+ 'ceilometer-alarm-evaluator',
56+ 'ceilometer-agent-notification'
57+]
58+
59+MITAKA_SERVICES = [
60+ 'aodh-notifier',
61+ 'aodh-evaluator',
62+ 'ceilometer-agent-notification'
63+]
64+
65 CEILOMETER_DB = "ceilometer"
66 CEILOMETER_SERVICE = "ceilometer"
67
68-CEILOMETER_PACKAGES = [
69+CEILOMETER_BASE_PACKAGES = [
70 'haproxy',
71 'apache2',
72 'ceilometer-agent-central',
73@@ -60,9 +70,9 @@
74 'ceilometer-agent-notification'
75 ]
76
77-ICEHOUSE_SERVICES = [
78- 'ceilometer-alarm-notifier',
79- 'ceilometer-alarm-evaluator',
80+MITAKA_PACKAGES = [
81+ 'aodh-notifier',
82+ 'aodh-evaluator',
83 'ceilometer-agent-notification'
84 ]
85
86@@ -85,7 +95,7 @@
87 CeilometerContext(),
88 context.SyslogContext(),
89 HAProxyContext()],
90- 'services': CEILOMETER_SERVICES
91+ 'services': CEILOMETER_BASE_SERVICES
92 }),
93 (HAPROXY_CONF, {
94 'hook_contexts': [context.HAProxyContext(singlenode_mode=True),
95@@ -121,10 +131,9 @@
96 configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
97 openstack_release=release)
98
99- if (get_os_codename_install_source(
100- config('openstack-origin')) >= 'icehouse'):
101- CONFIG_FILES[CEILOMETER_CONF]['services'] = \
102- CONFIG_FILES[CEILOMETER_CONF]['services'] + ICEHOUSE_SERVICES
103+ CONFIG_FILES[CEILOMETER_CONF]['services'] = (
104+ CONFIG_FILES[CEILOMETER_CONF]['services'] +
105+ ceilometer_release_services())
106
107 for conf in CONFIG_FILES:
108 configs.register(conf, CONFIG_FILES[conf]['hook_contexts'])
109@@ -151,8 +160,12 @@
110 svcs = []
111 for svc in ctxt['services']:
112 svcs.append(svc)
113+ if f == CEILOMETER_CONF:
114+ for svc in ceilometer_release_services():
115+ svcs.append(svc)
116 if svcs:
117 _map[f] = svcs
118+
119 return _map
120
121
122@@ -200,11 +213,29 @@
123 configs.set_release(openstack_release=new_os_rel)
124
125
126+def ceilometer_release_services():
127+ codename = get_os_codename_install_source(config('openstack-origin'))
128+ if codename >= 'mitaka':
129+ return MITAKA_SERVICES
130+ elif codename >= 'icehouse':
131+ return ICEHOUSE_SERVICES
132+ else:
133+ return []
134+
135+
136+def ceilometer_release_packages():
137+ codename = get_os_codename_install_source(config('openstack-origin'))
138+ if codename >= 'mitaka':
139+ return MITAKA_PACKAGES
140+ elif codename >= 'icehouse':
141+ return ICEHOUSE_PACKAGES
142+ else:
143+ return []
144+
145+
146 def get_packages():
147- packages = deepcopy(CEILOMETER_PACKAGES)
148- if (get_os_codename_install_source(
149- config('openstack-origin')) >= 'icehouse'):
150- packages = packages + ICEHOUSE_PACKAGES
151+ packages = (deepcopy(CEILOMETER_BASE_PACKAGES) +
152+ ceilometer_release_packages())
153 return packages
154
155
156
157=== modified file 'unit_tests/test_actions_openstack_upgrade.py'
158--- unit_tests/test_actions_openstack_upgrade.py 2015-10-16 11:59:37 +0000
159+++ unit_tests/test_actions_openstack_upgrade.py 2016-01-06 21:38:36 +0000
160@@ -4,7 +4,8 @@
161 os.environ['JUJU_UNIT_NAME'] = 'ceilometer'
162
163 with patch('ceilometer_utils.register_configs') as register_configs:
164- import openstack_upgrade
165+ with patch('ceilometer_utils.ceilometer_release_services') as rel_services:
166+ import openstack_upgrade
167
168 from test_utils import (
169 CharmTestCase
170
171=== modified file 'unit_tests/test_ceilometer_hooks.py'
172--- unit_tests/test_ceilometer_hooks.py 2015-10-10 22:53:35 +0000
173+++ unit_tests/test_ceilometer_hooks.py 2016-01-06 21:38:36 +0000
174@@ -44,9 +44,10 @@
175 def setUp(self):
176 super(CeilometerHooksTest, self).setUp(hooks, TO_PATCH)
177 self.config.side_effect = self.test_config.get
178- self.get_packages.return_value = ceilometer_utils.CEILOMETER_PACKAGES
179+ self.get_packages.return_value = \
180+ ceilometer_utils.CEILOMETER_BASE_PACKAGES
181 self.filter_installed_packages.return_value = \
182- ceilometer_utils.CEILOMETER_PACKAGES
183+ ceilometer_utils.CEILOMETER_BASE_PACKAGES
184 self.lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}
185
186 @patch('charmhelpers.payload.execd.default_execd_dir',
187@@ -68,7 +69,7 @@
188 self.open_port.assert_called_with(hooks.CEILOMETER_PORT)
189 self.apt_update.assert_called_with(fatal=True)
190 self.apt_install.assert_called_with(
191- ceilometer_utils.CEILOMETER_PACKAGES,
192+ ceilometer_utils.CEILOMETER_BASE_PACKAGES,
193 fatal=True
194 )
195
196@@ -83,7 +84,7 @@
197 self.open_port.assert_called_with(hooks.CEILOMETER_PORT)
198 self.apt_update.assert_called_with(fatal=True)
199 self.apt_install.assert_called_with(
200- ceilometer_utils.CEILOMETER_PACKAGES,
201+ ceilometer_utils.CEILOMETER_BASE_PACKAGES,
202 fatal=True
203 )
204
205
206=== modified file 'unit_tests/test_ceilometer_utils.py'
207--- unit_tests/test_ceilometer_utils.py 2015-10-10 22:37:50 +0000
208+++ unit_tests/test_ceilometer_utils.py 2016-01-06 21:38:36 +0000
209@@ -45,8 +45,6 @@
210 'ceilometer-agent-central',
211 'ceilometer-collector',
212 'ceilometer-api',
213- 'ceilometer-alarm-evaluator',
214- 'ceilometer-alarm-notifier',
215 'ceilometer-agent-notification'],
216 '/etc/haproxy/haproxy.cfg': ['haproxy'],
217 "/etc/apache2/sites-available/openstack_https_frontend": [
218@@ -82,7 +80,7 @@
219 '--option', 'Dpkg::Options::=--force-confdef',
220 ]
221 self.apt_install.assert_called_with(
222- packages=utils.CEILOMETER_PACKAGES,
223+ packages=utils.CEILOMETER_BASE_PACKAGES,
224 options=dpkg_opts, fatal=True
225 )
226 self.configure_installation_source.assert_called_with(
227@@ -92,9 +90,16 @@
228 def test_get_packages(self):
229 self.get_os_codename_install_source.return_value = 'havana'
230 self.assertEqual(utils.get_packages(),
231- utils.CEILOMETER_PACKAGES)
232+ utils.CEILOMETER_BASE_PACKAGES)
233
234 def test_get_packages_icehouse(self):
235 self.get_os_codename_install_source.return_value = 'icehouse'
236 self.assertEqual(utils.get_packages(),
237- utils.CEILOMETER_PACKAGES + utils.ICEHOUSE_PACKAGES)
238+ utils.CEILOMETER_BASE_PACKAGES +
239+ utils.ICEHOUSE_PACKAGES)
240+
241+ def test_get_packages_mitaka(self):
242+ self.get_os_codename_install_source.return_value = 'mitaka'
243+ self.assertEqual(utils.get_packages(),
244+ utils.CEILOMETER_BASE_PACKAGES +
245+ utils.MITAKA_PACKAGES)

Subscribers

People subscribed via source and target branches