diff --git a/actions.yaml b/actions.yaml index 4887910..9b10028 100644 --- a/actions.yaml +++ b/actions.yaml @@ -1,11 +1,15 @@ -"pause": - "description": | +pause: + description: | Pause services. If the deployment is clustered using the hacluster charm, the corresponding hacluster unit on the node must first be paused as well. Not doing so may lead to an interruption of service. -"resume": - "description": | +resume: + description: | Resume services. If the deployment is clustered using the hacluster charm, the corresponding hacluster unit on the node must be resumed as well. +restart-services: + description: | + Restart services. + Restart the services the charm manages. diff --git a/actions/os_actions.py b/actions/os_actions.py index eebab2b..b5a8bcf 100755 --- a/actions/os_actions.py +++ b/actions/os_actions.py @@ -47,11 +47,18 @@ def resume_action(*args): 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 # can map to a python function. ACTIONS = { "pause": pause_action, "resume": resume_action, + "restart-services": restart_services, } diff --git a/actions/restart-services b/actions/restart-services new file mode 120000 index 0000000..93db417 --- /dev/null +++ b/actions/restart-services @@ -0,0 +1 @@ +os_actions.py \ No newline at end of file