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
=== modified file 'actions/actions.py'
--- actions/actions.py 2015-10-16 13:01:34 +0000
+++ actions/actions.py 2016-01-06 21:38:36 +0000
@@ -6,7 +6,9 @@
6from charmhelpers.core.host import service_pause, service_resume6from charmhelpers.core.host import service_pause, service_resume
7from charmhelpers.core.hookenv import action_fail, status_set7from charmhelpers.core.hookenv import action_fail, status_set
8from charmhelpers.core.unitdata import kv8from charmhelpers.core.unitdata import kv
9from ceilometer_utils import CEILOMETER_SERVICES, assess_status9from ceilometer_utils import (
10 CEILOMETER_BASE_SERVICES, assess_status, ceilometer_release_services,
11)
10from ceilometer_hooks import CONFIGS12from ceilometer_hooks import CONFIGS
1113
1214
@@ -15,7 +17,8 @@
1517
16 @raises Exception should the service fail to stop.18 @raises Exception should the service fail to stop.
17 """19 """
18 for service in CEILOMETER_SERVICES:20 services = CEILOMETER_BASE_SERVICES + ceilometer_release_services()
21 for service in services:
19 if not service_pause(service):22 if not service_pause(service):
20 raise Exception("Failed to %s." % service)23 raise Exception("Failed to %s." % service)
2124
@@ -32,7 +35,8 @@
32 """Resume the Ceilometer services.35 """Resume the Ceilometer services.
3336
34 @raises Exception should the service fail to start."""37 @raises Exception should the service fail to start."""
35 for service in CEILOMETER_SERVICES:38 services = CEILOMETER_BASE_SERVICES + ceilometer_release_services()
39 for service in services:
36 if not service_resume(service):40 if not service_resume(service):
37 raise Exception("Failed to resume %s." % service)41 raise Exception("Failed to resume %s." % service)
3842
3943
=== modified file 'lib/ceilometer_utils.py'
--- lib/ceilometer_utils.py 2015-10-16 12:29:41 +0000
+++ lib/ceilometer_utils.py 2016-01-06 21:38:36 +0000
@@ -33,19 +33,29 @@
33 "openstack_https_frontend.conf"33 "openstack_https_frontend.conf"
34CLUSTER_RES = 'grp_ceilometer_vips'34CLUSTER_RES = 'grp_ceilometer_vips'
3535
36CEILOMETER_SERVICES = [36CEILOMETER_BASE_SERVICES = [
37 'ceilometer-agent-central',37 'ceilometer-agent-central',
38 'ceilometer-collector',38 'ceilometer-collector',
39 'ceilometer-api',39 'ceilometer-api',
40 'ceilometer-alarm-evaluator',
41 'ceilometer-alarm-notifier',
42 'ceilometer-agent-notification',40 'ceilometer-agent-notification',
43]41]
4442
43ICEHOUSE_SERVICES = [
44 'ceilometer-alarm-notifier',
45 'ceilometer-alarm-evaluator',
46 'ceilometer-agent-notification'
47]
48
49MITAKA_SERVICES = [
50 'aodh-notifier',
51 'aodh-evaluator',
52 'ceilometer-agent-notification'
53]
54
45CEILOMETER_DB = "ceilometer"55CEILOMETER_DB = "ceilometer"
46CEILOMETER_SERVICE = "ceilometer"56CEILOMETER_SERVICE = "ceilometer"
4757
48CEILOMETER_PACKAGES = [58CEILOMETER_BASE_PACKAGES = [
49 'haproxy',59 'haproxy',
50 'apache2',60 'apache2',
51 'ceilometer-agent-central',61 'ceilometer-agent-central',
@@ -60,9 +70,9 @@
60 'ceilometer-agent-notification'70 'ceilometer-agent-notification'
61]71]
6272
63ICEHOUSE_SERVICES = [73MITAKA_PACKAGES = [
64 'ceilometer-alarm-notifier',74 'aodh-notifier',
65 'ceilometer-alarm-evaluator',75 'aodh-evaluator',
66 'ceilometer-agent-notification'76 'ceilometer-agent-notification'
67]77]
6878
@@ -85,7 +95,7 @@
85 CeilometerContext(),95 CeilometerContext(),
86 context.SyslogContext(),96 context.SyslogContext(),
87 HAProxyContext()],97 HAProxyContext()],
88 'services': CEILOMETER_SERVICES98 'services': CEILOMETER_BASE_SERVICES
89 }),99 }),
90 (HAPROXY_CONF, {100 (HAPROXY_CONF, {
91 'hook_contexts': [context.HAProxyContext(singlenode_mode=True),101 'hook_contexts': [context.HAProxyContext(singlenode_mode=True),
@@ -121,10 +131,9 @@
121 configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,131 configs = templating.OSConfigRenderer(templates_dir=TEMPLATES,
122 openstack_release=release)132 openstack_release=release)
123133
124 if (get_os_codename_install_source(134 CONFIG_FILES[CEILOMETER_CONF]['services'] = (
125 config('openstack-origin')) >= 'icehouse'):135 CONFIG_FILES[CEILOMETER_CONF]['services'] +
126 CONFIG_FILES[CEILOMETER_CONF]['services'] = \136 ceilometer_release_services())
127 CONFIG_FILES[CEILOMETER_CONF]['services'] + ICEHOUSE_SERVICES
128137
129 for conf in CONFIG_FILES:138 for conf in CONFIG_FILES:
130 configs.register(conf, CONFIG_FILES[conf]['hook_contexts'])139 configs.register(conf, CONFIG_FILES[conf]['hook_contexts'])
@@ -151,8 +160,12 @@
151 svcs = []160 svcs = []
152 for svc in ctxt['services']:161 for svc in ctxt['services']:
153 svcs.append(svc)162 svcs.append(svc)
163 if f == CEILOMETER_CONF:
164 for svc in ceilometer_release_services():
165 svcs.append(svc)
154 if svcs:166 if svcs:
155 _map[f] = svcs167 _map[f] = svcs
168
156 return _map169 return _map
157170
158171
@@ -200,11 +213,29 @@
200 configs.set_release(openstack_release=new_os_rel)213 configs.set_release(openstack_release=new_os_rel)
201214
202215
216def ceilometer_release_services():
217 codename = get_os_codename_install_source(config('openstack-origin'))
218 if codename >= 'mitaka':
219 return MITAKA_SERVICES
220 elif codename >= 'icehouse':
221 return ICEHOUSE_SERVICES
222 else:
223 return []
224
225
226def ceilometer_release_packages():
227 codename = get_os_codename_install_source(config('openstack-origin'))
228 if codename >= 'mitaka':
229 return MITAKA_PACKAGES
230 elif codename >= 'icehouse':
231 return ICEHOUSE_PACKAGES
232 else:
233 return []
234
235
203def get_packages():236def get_packages():
204 packages = deepcopy(CEILOMETER_PACKAGES)237 packages = (deepcopy(CEILOMETER_BASE_PACKAGES) +
205 if (get_os_codename_install_source(238 ceilometer_release_packages())
206 config('openstack-origin')) >= 'icehouse'):
207 packages = packages + ICEHOUSE_PACKAGES
208 return packages239 return packages
209240
210241
211242
=== modified file 'unit_tests/test_actions_openstack_upgrade.py'
--- unit_tests/test_actions_openstack_upgrade.py 2015-10-16 11:59:37 +0000
+++ unit_tests/test_actions_openstack_upgrade.py 2016-01-06 21:38:36 +0000
@@ -4,7 +4,8 @@
4os.environ['JUJU_UNIT_NAME'] = 'ceilometer'4os.environ['JUJU_UNIT_NAME'] = 'ceilometer'
55
6with patch('ceilometer_utils.register_configs') as register_configs:6with patch('ceilometer_utils.register_configs') as register_configs:
7 import openstack_upgrade7 with patch('ceilometer_utils.ceilometer_release_services') as rel_services:
8 import openstack_upgrade
89
9from test_utils import (10from test_utils import (
10 CharmTestCase11 CharmTestCase
1112
=== modified file 'unit_tests/test_ceilometer_hooks.py'
--- unit_tests/test_ceilometer_hooks.py 2015-10-10 22:53:35 +0000
+++ unit_tests/test_ceilometer_hooks.py 2016-01-06 21:38:36 +0000
@@ -44,9 +44,10 @@
44 def setUp(self):44 def setUp(self):
45 super(CeilometerHooksTest, self).setUp(hooks, TO_PATCH)45 super(CeilometerHooksTest, self).setUp(hooks, TO_PATCH)
46 self.config.side_effect = self.test_config.get46 self.config.side_effect = self.test_config.get
47 self.get_packages.return_value = ceilometer_utils.CEILOMETER_PACKAGES47 self.get_packages.return_value = \
48 ceilometer_utils.CEILOMETER_BASE_PACKAGES
48 self.filter_installed_packages.return_value = \49 self.filter_installed_packages.return_value = \
49 ceilometer_utils.CEILOMETER_PACKAGES50 ceilometer_utils.CEILOMETER_BASE_PACKAGES
50 self.lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}51 self.lsb_release.return_value = {'DISTRIB_CODENAME': 'precise'}
5152
52 @patch('charmhelpers.payload.execd.default_execd_dir',53 @patch('charmhelpers.payload.execd.default_execd_dir',
@@ -68,7 +69,7 @@
68 self.open_port.assert_called_with(hooks.CEILOMETER_PORT)69 self.open_port.assert_called_with(hooks.CEILOMETER_PORT)
69 self.apt_update.assert_called_with(fatal=True)70 self.apt_update.assert_called_with(fatal=True)
70 self.apt_install.assert_called_with(71 self.apt_install.assert_called_with(
71 ceilometer_utils.CEILOMETER_PACKAGES,72 ceilometer_utils.CEILOMETER_BASE_PACKAGES,
72 fatal=True73 fatal=True
73 )74 )
7475
@@ -83,7 +84,7 @@
83 self.open_port.assert_called_with(hooks.CEILOMETER_PORT)84 self.open_port.assert_called_with(hooks.CEILOMETER_PORT)
84 self.apt_update.assert_called_with(fatal=True)85 self.apt_update.assert_called_with(fatal=True)
85 self.apt_install.assert_called_with(86 self.apt_install.assert_called_with(
86 ceilometer_utils.CEILOMETER_PACKAGES,87 ceilometer_utils.CEILOMETER_BASE_PACKAGES,
87 fatal=True88 fatal=True
88 )89 )
8990
9091
=== modified file 'unit_tests/test_ceilometer_utils.py'
--- unit_tests/test_ceilometer_utils.py 2015-10-10 22:37:50 +0000
+++ unit_tests/test_ceilometer_utils.py 2016-01-06 21:38:36 +0000
@@ -45,8 +45,6 @@
45 'ceilometer-agent-central',45 'ceilometer-agent-central',
46 'ceilometer-collector',46 'ceilometer-collector',
47 'ceilometer-api',47 'ceilometer-api',
48 'ceilometer-alarm-evaluator',
49 'ceilometer-alarm-notifier',
50 'ceilometer-agent-notification'],48 'ceilometer-agent-notification'],
51 '/etc/haproxy/haproxy.cfg': ['haproxy'],49 '/etc/haproxy/haproxy.cfg': ['haproxy'],
52 "/etc/apache2/sites-available/openstack_https_frontend": [50 "/etc/apache2/sites-available/openstack_https_frontend": [
@@ -82,7 +80,7 @@
82 '--option', 'Dpkg::Options::=--force-confdef',80 '--option', 'Dpkg::Options::=--force-confdef',
83 ]81 ]
84 self.apt_install.assert_called_with(82 self.apt_install.assert_called_with(
85 packages=utils.CEILOMETER_PACKAGES,83 packages=utils.CEILOMETER_BASE_PACKAGES,
86 options=dpkg_opts, fatal=True84 options=dpkg_opts, fatal=True
87 )85 )
88 self.configure_installation_source.assert_called_with(86 self.configure_installation_source.assert_called_with(
@@ -92,9 +90,16 @@
92 def test_get_packages(self):90 def test_get_packages(self):
93 self.get_os_codename_install_source.return_value = 'havana'91 self.get_os_codename_install_source.return_value = 'havana'
94 self.assertEqual(utils.get_packages(),92 self.assertEqual(utils.get_packages(),
95 utils.CEILOMETER_PACKAGES)93 utils.CEILOMETER_BASE_PACKAGES)
9694
97 def test_get_packages_icehouse(self):95 def test_get_packages_icehouse(self):
98 self.get_os_codename_install_source.return_value = 'icehouse'96 self.get_os_codename_install_source.return_value = 'icehouse'
99 self.assertEqual(utils.get_packages(),97 self.assertEqual(utils.get_packages(),
100 utils.CEILOMETER_PACKAGES + utils.ICEHOUSE_PACKAGES)98 utils.CEILOMETER_BASE_PACKAGES +
99 utils.ICEHOUSE_PACKAGES)
100
101 def test_get_packages_mitaka(self):
102 self.get_os_codename_install_source.return_value = 'mitaka'
103 self.assertEqual(utils.get_packages(),
104 utils.CEILOMETER_BASE_PACKAGES +
105 utils.MITAKA_PACKAGES)

Subscribers

People subscribed via source and target branches