diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-11-06 22:33:04 +0100 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-11-14 22:10:46 +0100 |
commit | 65b73d02064c00093635655e0642e16220a8f5af (patch) | |
tree | 42fffdb09357093903e8c44910b1af9401b81481 | |
parent | acaabfde0fb772c60ee348779b638ff160f524f6 (diff) | |
download | clufter-65b73d02064c00093635655e0642e16220a8f5af.tar.gz clufter-65b73d02064c00093635655e0642e16220a8f5af.tar.xz clufter-65b73d02064c00093635655e0642e16220a8f5af.zip |
commands/ccs2pcs: use cluster_pcs_1_2 to produce a warning
... if suitable
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rw-r--r-- | commands/ccs2pcs.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/commands/ccs2pcs.py b/commands/ccs2pcs.py index 9c436d8..11628f8 100644 --- a/commands/ccs2pcs.py +++ b/commands/ccs2pcs.py @@ -8,7 +8,18 @@ __author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>" from ..command import Command, CommandAlias from ..filter import XMLFilter from ..protocol import protocols -from ..utils_cluster import cluster_pcs_flatiron +from ..utils_cluster import cluster_pcs_1_2, cluster_pcs_flatiron + + +def _check_pacemaker_1_2(cmd_ctxt): + system = cmd_ctxt.get('system', 'UNKNOWN-SYSTEM') + system_extra = cmd_ctxt.get('system_extra', 'UNKNOWN-DISTRO') + if not cluster_pcs_1_2(system, system_extra): + from sys import stderr + print >>stderr, ("Resulting configuration will likely not be applicable" + " to ``{0}'' system as it seems so outdated as far as" + " Pacemaker not supporting validation schema v1.2" + ).format(': '.join((system, system_extra))) @Command.deco(('ccs2ccsflat', @@ -35,6 +46,8 @@ def ccs2pcs_flatiron(cmd_ctxt, ccs_pcmk output Pacemaker pass-through CMAN configuration cib output Pacemaker-based cluster configuration file """ + _check_pacemaker_1_2(cmd_ctxt) + file_proto = protocols.plugins['file'].ensure_proto return ( file_proto(input), @@ -77,6 +90,8 @@ def ccs2pcs_needle(cmd_ctxt, cib output Pacemaker-based cluster configuration file coro output Corosync v2 configuration file """ + _check_pacemaker_1_2(cmd_ctxt) + file_proto = protocols.plugins['file'].ensure_proto return ( file_proto(input), |