Exemple #1
0
def run_deferred_hooks(args):
    """Run deferred hooks.

    :param args: Unused
    :type args: List[str]
    """
    _run_deferred_hooks()
    os_utils.restart_services_action(deferred_only=True)
    assess_status(ConfigRenderer(CONFIG_FILES()))
Exemple #2
0
def complete_cluster_series_upgrade(args):
    """ Complete the series upgrade process

    After all nodes have been upgraded, this action is run to inform the whole
    cluster the upgrade is done. Config files will be re-rendered with each
    peer in the wsrep_cluster_address config.
    """
    if is_leader():
        # Unset cluster_series_upgrading
        leader_set(cluster_series_upgrading="")
    assess_status(ConfigRenderer(CONFIG_FILES))
Exemple #3
0
def restart(args):
    """Restart services.

    :param args: Unused
    :type args: List[str]
    """
    deferred_only = action_get("deferred-only")
    svcs = action_get("services").split()
    # Check input
    if deferred_only and svcs:
        action_fail("Cannot set deferred-only and services")
        return
    if not (deferred_only or svcs):
        action_fail("Please specify deferred-only or services")
        return
    if action_get('run-hooks'):
        _run_deferred_hooks()
    if deferred_only:
        os_utils.restart_services_action(deferred_only=True)
    else:
        os_utils.restart_services_action(services=svcs)
    assess_status(ConfigRenderer(CONFIG_FILES()))
Exemple #4
0
def resume(args):
    """Resume the RabbitMQ services.
    @raises Exception should the service fail to start."""
    resume_unit_helper(ConfigRenderer(CONFIG_FILES))
Exemple #5
0
def pause(args):
    """Pause the RabbitMQ services.
    @raises Exception should the service fail to stop.
    """
    pause_unit_helper(ConfigRenderer(CONFIG_FILES))