Add action to restart services
Adds an action to charms to trigger a service restart. Depends-On: Ic3521c08cdaa207e1391a32e03e53b276c51b309 Change-Id: I1d509d0bc2c3fb77348edef6810fcdc30cdc9ab8
This commit is contained in:
parent
c3cc2414ce
commit
701cf8d2c4
12
actions.yaml
12
actions.yaml
@ -1,11 +1,15 @@
|
|||||||
"pause":
|
pause:
|
||||||
"description": |
|
description: |
|
||||||
Pause services.
|
Pause services.
|
||||||
If the deployment is clustered using the hacluster charm, the
|
If the deployment is clustered using the hacluster charm, the
|
||||||
corresponding hacluster unit on the node must first be paused as well.
|
corresponding hacluster unit on the node must first be paused as well.
|
||||||
Not doing so may lead to an interruption of service.
|
Not doing so may lead to an interruption of service.
|
||||||
"resume":
|
resume:
|
||||||
"description": |
|
description: |
|
||||||
Resume services.
|
Resume services.
|
||||||
If the deployment is clustered using the hacluster charm, the
|
If the deployment is clustered using the hacluster charm, the
|
||||||
corresponding hacluster unit on the node must be resumed as well.
|
corresponding hacluster unit on the node must be resumed as well.
|
||||||
|
restart-services:
|
||||||
|
description: |
|
||||||
|
Restart services.
|
||||||
|
Restart the services the charm manages.
|
||||||
|
@ -47,11 +47,18 @@ def resume_action(*args):
|
|||||||
charm_instance._assess_status()
|
charm_instance._assess_status()
|
||||||
|
|
||||||
|
|
||||||
|
def restart_services(*args):
|
||||||
|
"""Run the resume action."""
|
||||||
|
with charms_openstack.charm.provide_charm_instance() as charm_instance:
|
||||||
|
charm_instance.restart_services()
|
||||||
|
|
||||||
|
|
||||||
# Actions to function mapping, to allow for illegal python action names that
|
# Actions to function mapping, to allow for illegal python action names that
|
||||||
# can map to a python function.
|
# can map to a python function.
|
||||||
ACTIONS = {
|
ACTIONS = {
|
||||||
"pause": pause_action,
|
"pause": pause_action,
|
||||||
"resume": resume_action,
|
"resume": resume_action,
|
||||||
|
"restart-services": restart_services,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
1
actions/restart-services
Symbolic link
1
actions/restart-services
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
os_actions.py
|
Loading…
x
Reference in New Issue
Block a user