From f289429ed66138f1786bb89d02cf6a4aec476241 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 11 Oct 2016 10:59:19 +0000 Subject: [PATCH] Stop/Start ceilometer-api if Apache has changed If the charm enables https then apache is used to terminate ssl. As part of this Apache listens on the port that the ceilometer API port was listening on and the API service shuffles down to a lower port. If the services are restarted one at a time and Apache goes first then Apache will try and bind to the port the API service is listening on because the API service has not yet been restarted to pick up its new port. Change-Id: Ied3224660948a9775c8000369cba0c287944cde5 Closes-Bug: 1632287 --- lib/ceilometer_utils.py | 7 +++++-- unit_tests/test_ceilometer_utils.py | 8 ++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/ceilometer_utils.py b/lib/ceilometer_utils.py index fdb6037..3d1796e 100644 --- a/lib/ceilometer_utils.py +++ b/lib/ceilometer_utils.py @@ -125,11 +125,14 @@ CONFIG_FILES = OrderedDict([ }), (HTTPS_APACHE_CONF, { 'hook_contexts': [ApacheSSLContext()], - 'services': ['apache2'], + # Include ceilometer-api to fix Bug #1632287 This is a temporary + # tactival fix as the charm will be rewritten to use mod_wsgi next + # cycle + 'services': ['ceilometer-api', 'apache2'], }), (HTTPS_APACHE_24_CONF, { 'hook_contexts': [ApacheSSLContext()], - 'services': ['apache2'], + 'services': ['ceilometer-api', 'apache2'], }) ]) diff --git a/unit_tests/test_ceilometer_utils.py b/unit_tests/test_ceilometer_utils.py index e7374e9..03079b6 100644 --- a/unit_tests/test_ceilometer_utils.py +++ b/unit_tests/test_ceilometer_utils.py @@ -110,9 +110,9 @@ class CeilometerUtilsTest(CharmTestCase): 'ceilometer-api'], '/etc/haproxy/haproxy.cfg': ['haproxy'], "/etc/apache2/sites-available/openstack_https_frontend": [ - 'apache2'], + 'ceilometer-api', 'apache2'], "/etc/apache2/sites-available/openstack_https_frontend.conf": [ - 'apache2'] + 'ceilometer-api', 'apache2'] } ) @@ -131,9 +131,9 @@ class CeilometerUtilsTest(CharmTestCase): 'ceilometer-api'], '/etc/haproxy/haproxy.cfg': ['haproxy'], "/etc/apache2/sites-available/openstack_https_frontend": [ - 'apache2'], + 'ceilometer-api', 'apache2'], "/etc/apache2/sites-available/openstack_https_frontend.conf": [ - 'apache2'] + 'ceilometer-api', 'apache2'] } )