use service_reload()

This commit is contained in:
Edward Hope-Morley
2015-03-30 18:26:30 +01:00
parent cfead311f3
commit a7855d8fe1
2 changed files with 3 additions and 6 deletions

View File

@@ -4,9 +4,7 @@ import sys
import uuid import uuid
from subprocess import ( from subprocess import (
call,
check_call, check_call,
CalledProcessError,
) )
from charmhelpers.core.hookenv import ( from charmhelpers.core.hookenv import (
@@ -25,6 +23,7 @@ from charmhelpers.core.hookenv import (
from charmhelpers.core.host import ( from charmhelpers.core.host import (
restart_on_change, restart_on_change,
service_reload,
) )
from charmhelpers.fetch import ( from charmhelpers.fetch import (
@@ -99,10 +98,7 @@ def configure_https():
# TODO: improve this by checking if local CN certs are available # TODO: improve this by checking if local CN certs are available
# first then checking reload status (see LP #1433114). # first then checking reload status (see LP #1433114).
try: service_reload('apache2', restart_on_failure=True)
check_call(['service', 'apache2', 'reload'])
except CalledProcessError:
call(['service', 'apache2', 'restart'])
for rid in relation_ids('identity-service'): for rid in relation_ids('identity-service'):
identity_joined(rid=rid) identity_joined(rid=rid)

View File

@@ -48,6 +48,7 @@ TO_PATCH = [
'get_netmask_for_address', 'get_netmask_for_address',
'get_address_in_network', 'get_address_in_network',
'update_nrpe_config', 'update_nrpe_config',
'service_reload',
] ]
NEUTRON_CONF_DIR = "/etc/neutron" NEUTRON_CONF_DIR = "/etc/neutron"