summaryrefslogtreecommitdiffstats
path: root/filters/corosync/quorum/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'filters/corosync/quorum/__init__.py')
-rw-r--r--filters/corosync/quorum/__init__.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/filters/corosync/quorum/__init__.py b/filters/corosync/quorum/__init__.py
new file mode 100644
index 0000000..4233a12
--- /dev/null
+++ b/filters/corosync/quorum/__init__.py
@@ -0,0 +1,30 @@
+# -*- 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)
+
+###
+
+from ....utils_xslt import xslt_is_member
+
+# 1:1 mapping of supported params to pcs arguments
+needlexml2pcscmd_supported = (
+ # binary 0|1 values
+ 'auto_tie_breaker',
+ 'last_man_standing',
+ 'wait_for_all',
+ # standard values
+ 'last_man_standing_window',
+)
+
+needlexml2pcscmd = '''\
+ <xsl:for-each select="@*[
+''' + (
+ xslt_is_member('name()', needlexml2pcscmd_supported)
+) + ''']">
+ <xsl:if test=".">
+ <!-- but see https://bugzilla.redhat.com/1235452 -->
+ <xsl:value-of select="concat(' --', name(), '=', .)"/>
+ </xsl:if>
+ </xsl:for-each>
+'''