Restart service on config change
This commit is contained in:
parent
78ef1d6bd4
commit
873caf6e12
|
@ -17,6 +17,11 @@ import charms.reactive as reactive
|
||||||
from charmhelpers.core.hookenv import (
|
from charmhelpers.core.hookenv import (
|
||||||
config,
|
config,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from charmhelpers.core.host import (
|
||||||
|
service_restart,
|
||||||
|
)
|
||||||
|
|
||||||
from charms_openstack.charm import (
|
from charms_openstack.charm import (
|
||||||
provide_charm_instance,
|
provide_charm_instance,
|
||||||
use_defaults,
|
use_defaults,
|
||||||
|
@ -56,3 +61,12 @@ def configure_principle(api_principle):
|
||||||
--config-file=/etc/neutron/plugins/ml2/ml2_conf_arista.ini',
|
--config-file=/etc/neutron/plugins/ml2/ml2_conf_arista.ini',
|
||||||
service_plugins=config('service-plugins'),
|
service_plugins=config('service-plugins'),
|
||||||
subordinate_configuration=inject_config)
|
subordinate_configuration=inject_config)
|
||||||
|
|
||||||
|
|
||||||
|
@reactive.when_any('config.changed.eapi-host',
|
||||||
|
'config.changed.eapi-username',
|
||||||
|
'config.changed.eapi-password',
|
||||||
|
'config.changed.api-type',
|
||||||
|
'config.changed.region-name')
|
||||||
|
def restart_service():
|
||||||
|
service_restart('neutron-server')
|
||||||
|
|
Loading…
Reference in New Issue