diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2015-06-18 19:08:18 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2015-06-19 17:34:00 +0200 |
commit | 4168a38cb7a84cfa5a1e43ec3c12835e1e386998 (patch) | |
tree | 465e74fd165a3661e43153e5de0112d110978cb8 | |
parent | 03b1f361ded0bb939db3ec1cb77b9196e373920b (diff) | |
download | clufter-4168a38cb7a84cfa5a1e43ec3c12835e1e386998.tar.gz clufter-4168a38cb7a84cfa5a1e43ec3c12835e1e386998.tar.xz clufter-4168a38cb7a84cfa5a1e43ec3c12835e1e386998.zip |
commands/ccs-disable-rg: substitute for pcmk's disable_rgmanager
Combine ccs-disable-rg and ccs-version-bump filters.
That was the other reason for factoring those filters out.
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r-- | commands/ccs_disable_rg.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/commands/ccs_disable_rg.py b/commands/ccs_disable_rg.py new file mode 100644 index 0000000..7493ae2 --- /dev/null +++ b/commands/ccs_disable_rg.py @@ -0,0 +1,34 @@ +# -*- coding: UTF-8 -*- +# Copyright 2015 Red Hat, Inc. +# Part of clufter project +# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt) +"""ccs-disable-rg command""" +__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>" + +from ..command import Command +from ..protocol import protocols + + +@Command.deco(('ccs-disable-rg', + ('ccs-version-bump'))) +def ccs_disable_rg(cmd_ctxt, + input="/etc/cluster/cluster.conf", + output="cluster-disabledrg-{ccs-disable-rg.in.hash}.conf", + noversionbump=False): + """Make config. prevent RGManager from (accidentally) starting + + Options: + input input CMAN-based cluster configuration file + output output file with RGManager being declaratively disabled + noversionbump prevent incrementing in-document configuration version + """ + if noversionbump: + cmd_ctxt['filter_noop'].append('ccs-version-bump') + + file_proto = protocols.plugins['file'].ensure_proto + return ( + file_proto(input), + ( + file_proto(output), + ), + ) |