* [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping
@ 2013-12-05 17:24 Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node Jan Pokorný
` (5 more replies)
0 siblings, 6 replies; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
This is a follow up of the previous changeset
rgmanager: ra2rng.xsl: build up param datatyping infra
where the infrastructure is now used to restrict parameters of
ip and fs RAs.
Jan Pokorn? (6):
rgmanager: ra2rng.xsl: adjust pretty-print to capture full node
rgmanager: ra2rng.xsl: common params: finish datatyping/constraints
rgmanager: ra2rng.xsl: common params: just refer to named pattern
rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params
rgmanager: ra2rng.xsl: fs-*: datatype/restrict the params
rgmanager: ra2rng.xsl: {ip,fs}-nfslock: use common wildcard block
rgmanager/src/resources/ra2rng.xsl | 268 +++++++++++++++++++++--------
rgmanager/src/resources/resources.rng.tail | 93 ++++++++++
2 files changed, 292 insertions(+), 69 deletions(-)
--
1.8.1.4
^ permalink raw reply [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCH 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node
2013-12-05 17:24 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping Jan Pokorný
@ 2013-12-05 17:24 ` Jan Pokorný
2013-12-09 20:41 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 2/6] rgmanager: ra2rng.xsl: common params: finish datatyping/constraints Jan Pokorný
` (4 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
...and also adjust when to put element on the new line accordingly.
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 699052c..243b142 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -157,8 +157,11 @@
</xsl:call-template>
</xsl:when>
<xsl:when test="self::*">
- <xsl:if test="count($fill-with/*) < 2
- or count(preceding-sibling::*) = 0">
+ <xsl:if test="count(preceding-sibling::*) = 0
+ or
+ (preceding-sibling::node()[comment() or *])[last()]
+ !=
+ preceding-sibling::*[last()]">
<xsl:value-of select="$NL"/>
</xsl:if>
<xsl:call-template name="tag">
@@ -429,7 +432,7 @@
<xsl:call-template name="pretty-print">
<xsl:with-param name="indented" select="$global-init-indent"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:common-optional-parameters/*"/>
+ select="document('')/*/int:common-optional-parameters/node()"/>
</xsl:call-template>
<!-- optional (start) -->
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCH 2/6] rgmanager: ra2rng.xsl: common params: finish datatyping/constraints
2013-12-05 17:24 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node Jan Pokorný
@ 2013-12-05 17:24 ` Jan Pokorný
2013-12-09 20:42 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 3/6] rgmanager: ra2rng.xsl: common params: just refer to named pattern Jan Pokorný
` (3 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 63 +++++++++++++++++++++++++++++++++-----
1 file changed, 55 insertions(+), 8 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 243b142..78fbe35 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,17 +15,64 @@
<int:common-optional-parameters>
<optional>
- <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/>
- </optional>
- <optional>
- <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/>
- </optional>
- <optional>
- <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/>
+ <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree.">
+ <data type="string">
+ <param name="pattern">\s+[12]\s+|[Yy][Ee][Ss]|[Nn][Oo][Nn][-][Cc][Rr][Ii][Tt][Ii][Cc][Aa][Ll]</param>
+ </data>
+ </attribute>
</optional>
<optional>
- <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
+ <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal.">
+ <data type="string">
+ <param name="pattern">\s+[1-9][0-9]*\s+|[Yy][Ee][Ss]</param>
+ </data>
+ </attribute>
</optional>
+
+ <!-- failures -->
+ <choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <!--
+ __max_failures and __failure_expire_time only make sense
+ when defined altogether and contain valid non-zero value
+ -->
+ <group>
+ <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check.">
+ <data type="int">
+ <param name="minExclusive">0</param>
+ </data>
+ </attribute>
+ <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten.">
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </attribute>
+ </group>
+ <group>
+ <optional>
+ <attribute name="__max_failures">
+ <data type="int">
+ <!-- while negative value is not a strict error as
+ it is silently turned to zero, don't promote
+ such a liberty -->
+ <param name="enumeration">0</param>
+ </data>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__failure_expire_time">
+ <data type="string">
+ <except>
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </except>
+ </data>
+ </attribute>
+ </optional>
+ </group>
+ </choice>
+
+ <!-- restarts -->
<choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!--
__max_restarts and __restart_expire_time only make sense
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCH 3/6] rgmanager: ra2rng.xsl: common params: just refer to named pattern
2013-12-05 17:24 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 2/6] rgmanager: ra2rng.xsl: common params: finish datatyping/constraints Jan Pokorný
@ 2013-12-05 17:24 ` Jan Pokorný
2013-12-09 20:43 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 4/6] rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params Jan Pokorný
` (2 subsequent siblings)
5 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
...in resources.rng.tail where it has been moved out
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 117 +++--------------------------
rgmanager/src/resources/resources.rng.tail | 93 +++++++++++++++++++++++
2 files changed, 102 insertions(+), 108 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 78fbe35..d781dbe 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -13,109 +13,6 @@
helper definitions
-->
-<int:common-optional-parameters>
- <optional>
- <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree.">
- <data type="string">
- <param name="pattern">\s+[12]\s+|[Yy][Ee][Ss]|[Nn][Oo][Nn][-][Cc][Rr][Ii][Tt][Ii][Cc][Aa][Ll]</param>
- </data>
- </attribute>
- </optional>
- <optional>
- <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal.">
- <data type="string">
- <param name="pattern">\s+[1-9][0-9]*\s+|[Yy][Ee][Ss]</param>
- </data>
- </attribute>
- </optional>
-
- <!-- failures -->
- <choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
- <!--
- __max_failures and __failure_expire_time only make sense
- when defined altogether and contain valid non-zero value
- -->
- <group>
- <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check.">
- <data type="int">
- <param name="minExclusive">0</param>
- </data>
- </attribute>
- <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten.">
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </attribute>
- </group>
- <group>
- <optional>
- <attribute name="__max_failures">
- <data type="int">
- <!-- while negative value is not a strict error as
- it is silently turned to zero, don't promote
- such a liberty -->
- <param name="enumeration">0</param>
- </data>
- </attribute>
- </optional>
- <optional>
- <attribute name="__failure_expire_time">
- <data type="string">
- <except>
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </except>
- </data>
- </attribute>
- </optional>
- </group>
- </choice>
-
- <!-- restarts -->
- <choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
- <!--
- __max_restarts and __restart_expire_time only make sense
- when defined altogether and contain valid non-zero value
- -->
- <group>
- <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up.">
- <data type="int">
- <param name="minExclusive">0</param>
- </data>
- </attribute>
- <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree.">
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </attribute>
- </group>
- <group>
- <optional>
- <attribute name="__max_restarts">
- <data type="int">
- <!-- while negative value is not a strict error as
- it is silently turned to zero, don't promote
- such a liberty -->
- <param name="enumeration">0</param>
- </data>
- </attribute>
- </optional>
- <optional>
- <attribute name="__restart_expire_time">
- <data type="string">
- <except>
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </except>
- </data>
- </attribute>
- </optional>
- </group>
- </choice>
-</int:common-optional-parameters>
-
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
<!-- SCRIPT -->
@@ -474,13 +371,17 @@
select="concat($global-init-indent,
$global-indent)"/>
</xsl:call-template>
+ <xsl:value-of select="$NL"/>
- <!-- "paste" int:common-optional-parameters from above here -->
- <xsl:call-template name="pretty-print">
- <xsl:with-param name="indented" select="$global-init-indent"/>
- <xsl:with-param name="fill-with"
- select="document('')/*/int:common-optional-parameters/node()"/>
+ <xsl:call-template name="tag">
+ <xsl:with-param name="name" select="'ref'"/>
+ <xsl:with-param name="attrs" select="concat(
+ 'name=', $Q, 'RESOURCECOMMONPARAMS', $Q)"/>
+ <xsl:with-param name="indented"
+ select="concat($global-init-indent,
+ $global-indent)"/>
</xsl:call-template>
+ <xsl:value-of select="$NL"/>
<!-- optional (start) -->
<xsl:call-template name="tag-start">
diff --git a/rgmanager/src/resources/resources.rng.tail b/rgmanager/src/resources/resources.rng.tail
index 4434631..d2c1fcb 100644
--- a/rgmanager/src/resources/resources.rng.tail
+++ b/rgmanager/src/resources/resources.rng.tail
@@ -4,6 +4,99 @@
</zeroOrMore>
</define>
+ <define name="RESOURCECOMMONPARAMS" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <optional>
+ <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree.">
+ <data type="string">
+ <param name="pattern">\s+[12]\s+|[Yy][Ee][Ss]|[Nn][Oo][Nn][-][Cc][Rr][Ii][Tt][Ii][Cc][Aa][Ll]</param>
+ </data>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal.">
+ <data type="string">
+ <param name="pattern">\s+[1-9][0-9]*\s+|[Yy][Ee][Ss]</param>
+ </data>
+ </attribute>
+ </optional>
+
+ <!-- failures -->
+ <choice>
+ <!-- __max_failures and __failure_expire_time only make sense when defined altogether and contain valid non-zero value -->
+ <group>
+ <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check.">
+ <data type="int">
+ <param name="minExclusive">0</param>
+ </data>
+ </attribute>
+ <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten.">
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </attribute>
+ </group>
+ <group>
+ <optional>
+ <attribute name="__max_failures">
+ <data type="int">
+ <!-- while negative value is not a strict error as it is silently turned to zero, don't promote such a liberty -->
+ <param name="enumeration">0</param>
+ </data>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__failure_expire_time">
+ <data type="string">
+ <except>
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </except>
+ </data>
+ </attribute>
+ </optional>
+ </group>
+ </choice>
+
+ <!-- restarts -->
+ <choice>
+ <!-- __max_restarts and __restart_expire_time only make sense when defined altogether and contain valid non-zero value -->
+ <group>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up.">
+ <data type="int">
+ <param name="minExclusive">0</param>
+ </data>
+ </attribute>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree.">
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </attribute>
+ </group>
+ <group>
+ <optional>
+ <attribute name="__max_restarts">
+ <data type="int">
+ <!-- while negative value is not a strict error as it is silently turned to zero, don't promote such a liberty -->
+ <param name="enumeration">0</param>
+ </data>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time">
+ <data type="string">
+ <except>
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </except>
+ </data>
+ </attribute>
+ </optional>
+ </group>
+ </choice>
+ </define>
+
<define name="RESOURCEACTION">
<zeroOrMore>
<element name="action" rha:description="Overrides resource action timings for a resource instance.">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCH 4/6] rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params
2013-12-05 17:24 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping Jan Pokorný
` (2 preceding siblings ...)
2013-12-05 17:24 ` [Cluster-devel] [PATCH 3/6] rgmanager: ra2rng.xsl: common params: just refer to named pattern Jan Pokorný
@ 2013-12-05 17:24 ` Jan Pokorný
2013-12-05 20:02 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 5/6] rgmanager: ra2rng.xsl: fs-*: " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block Jan Pokorný
5 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 65 ++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index d781dbe..da84ae3 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,71 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- IP -->
+ <int:agent name="ip">
+ <int:parameter name="address">
+ <data type="token">
+ <!-- only approximate regexp -->
+ <param name="pattern">[0-9A-Fa-f.:]+([/][0-9]+)?</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="family">
+ <data type="token">
+ <!-- note: "auto" is more like original expectation, but
+ enforce it to prevent arbitrary non-senses in this
+ context like uppercased INET6 -->
+ <param name="enumeration">auto</param>
+ <param name="enumeration">inet</param>
+ <param name="enumeration">inet6</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="monitor_link">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="sleeptime">
+ <data type="int">
+ <param name="minExclusive">0</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="disable_rdisc">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="prefer_interface">
+ <data type="string">
+ <!-- note: can be up to max(IFNAMSIZ,IFALIASZ) - 1 characters
+ where from include/linux/if.h IFNAMSIZ = 16, IFALIASZ = 256
+ and the terminating null character is subtracted:
+ http://www.gnu.org/software/libc/manual/html_node/Interface-Naming.html
+ resulting in 255 characters (at least one has to be given,
+ @least it would be a bit insane to have an interface
+ called "") -->
+ <param name="minLength">1</param>
+ <param name="maxLength">255</param>
+ <param name="pattern">[^\s#x0100-#x10FFFF]+</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- SCRIPT -->
<int:agent name="script">
<int:parameter name="file">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCH 5/6] rgmanager: ra2rng.xsl: fs-*: datatype/restrict the params
2013-12-05 17:24 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping Jan Pokorný
` (3 preceding siblings ...)
2013-12-05 17:24 ` [Cluster-devel] [PATCH 4/6] rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params Jan Pokorný
@ 2013-12-05 17:24 ` Jan Pokorný
2013-12-06 14:02 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block Jan Pokorný
5 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 111 +++++++++++++++++++++++++++++++++++++
1 file changed, 111 insertions(+)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index da84ae3..e025e37 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,117 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- FS -->
+ <int:agent name="fs">
+ <!-- int:parameter name="name"/ -->
+ <int:parameter name="mountpoint">
+ <data type="string">
+ <!-- only enforce starting with slash and@the very least
+ one non-zero length component (otherwise not sane);
+ maximum path length is as per PATH_MAX - 1 (4095)
+ from /usr/include/linux/limits.h -->
+ <param name="pattern">/[^\s#x0100-#x10FFFF]+</param>
+ <param name="maxLength">4095</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="device">
+ <data type="string">
+ <!-- like mountpoint + can be specified by UUID=XYZ
+ or LABEL=XYZ -->
+ <param name="pattern">/[^\s#x0100-#x10FFFF]+|(UUID|LABEL)=[^#x0100-#x10FFFF]+</param>
+ <param name="maxLength">4095</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="fstype">
+ <data type="token">
+ <!-- fs.sh only checks for cifs, nfs and nfs4;
+ length of 31 is a reasonable overapproximation -->
+ <param name="pattern">/[^\s#x0100-#x10FFFF]+</param>
+ <param name="maxLength">31</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="force_unmount">
+ <data type="token">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ <param name="enumeration">false</param>
+ <param name="enumeration">true</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="quick_status">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="self_fence">
+ <data type="token">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ <param name="enumeration">false</param>
+ <param name="enumeration">true</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="nfsrestart">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="fsid">
+ <data type="string">
+ <!-- prevent from whitespace breaking fragile handling -->
+ <param name="pattern">\S+</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="force_fsck">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="options">
+ <data type="string">
+ <!-- prevent from whitespace breaking fragile handling -->
+ <param name="pattern">\S+</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="use_findmnt">
+ <data type="token">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ <param name="enumeration">false</param>
+ <param name="enumeration">true</param>
+ <param name="enumeration">off</param>
+ <param name="enumeration">on</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- IP -->
<int:agent name="ip">
<int:parameter name="address">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCH 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block
2013-12-05 17:24 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping Jan Pokorný
` (4 preceding siblings ...)
2013-12-05 17:24 ` [Cluster-devel] [PATCH 5/6] rgmanager: ra2rng.xsl: fs-*: " Jan Pokorný
@ 2013-12-05 17:24 ` Jan Pokorný
2013-12-05 17:31 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
5 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:24 UTC (permalink / raw)
To: cluster-devel.redhat.com
Note that the silent rule before the arrangement like this is that
the wildcard block under int:agent-parameter-specialization will
always be the first one there, as element sets union will preserve
the document ordering (hence [last()] will point to the last item
in document order rather than the item of the last union operand).
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 51 ++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 24 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index e025e37..3c10e48 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,18 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- WILDCARD (any agent containg such parameter) -->
+ <int:agent name="*">
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- FS -->
<int:agent name="fs">
<!-- int:parameter name="name"/ -->
@@ -73,15 +85,6 @@
<param name="enumeration">true</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
<int:parameter name="nfsrestart">
<data type="string">
<!-- note: a bit stricter than what the code enforces -->
@@ -153,15 +156,6 @@
<param name="enumeration">yes</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
<int:parameter name="sleeptime">
<data type="int">
<param name="minExclusive">0</param>
@@ -502,12 +496,21 @@
'rha:description=', $Q, normalize-space(shortdesc), $Q)"/>
<xsl:with-param name="indented" select="$use-indented"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:agent-parameter-specialization
- /int:agent[
- @name = current()/../../@name
- ]/int:parameter[
- @name = current()/@name
- ]/*"/>
+ select="(
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = '*'
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ |
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = current()/../../@name
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ )[last()]/*"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv2 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block
2013-12-05 17:24 ` [Cluster-devel] [PATCH 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block Jan Pokorný
@ 2013-12-05 17:31 ` Jan Pokorný
2013-12-05 20:03 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
0 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 17:31 UTC (permalink / raw)
To: cluster-devel.redhat.com
Note that the silent rule before the arrangement like this is that
the wildcard block under int:agent-parameter-specialization will
always be the first one there, as element sets union will preserve
the document ordering (hence [last()] will point to the last item
in document order rather than the item of the last union operand).
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 51 ++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 24 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index e025e37..3c10e48 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,18 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- WILDCARD (any agent containing such parameter) -->
+ <int:agent name="*">
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- FS -->
<int:agent name="fs">
<!-- int:parameter name="name"/ -->
@@ -73,15 +85,6 @@
<param name="enumeration">true</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
<int:parameter name="nfsrestart">
<data type="string">
<!-- note: a bit stricter than what the code enforces -->
@@ -153,15 +156,6 @@
<param name="enumeration">yes</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
<int:parameter name="sleeptime">
<data type="int">
<param name="minExclusive">0</param>
@@ -502,12 +496,21 @@
'rha:description=', $Q, normalize-space(shortdesc), $Q)"/>
<xsl:with-param name="indented" select="$use-indented"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:agent-parameter-specialization
- /int:agent[
- @name = current()/../../@name
- ]/int:parameter[
- @name = current()/@name
- ]/*"/>
+ select="(
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = '*'
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ |
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = current()/../../@name
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ )[last()]/*"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv2 4/6] rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params
2013-12-05 17:24 ` [Cluster-devel] [PATCH 4/6] rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params Jan Pokorný
@ 2013-12-05 20:02 ` Jan Pokorný
2013-12-09 20:44 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
0 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 20:02 UTC (permalink / raw)
To: cluster-devel.redhat.com
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 65 ++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index d781dbe..da84ae3 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,71 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- IP -->
+ <int:agent name="ip">
+ <int:parameter name="address">
+ <data type="token">
+ <!-- only approximate regexp -->
+ <param name="pattern">[0-9A-Fa-f.:]+([/][0-9]+)?</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="family">
+ <data type="token">
+ <!-- note: "auto" is more like original expectation, but
+ enforce it to prevent arbitrary non-senses in this
+ context like uppercased INET6 -->
+ <param name="enumeration">auto</param>
+ <param name="enumeration">inet</param>
+ <param name="enumeration">inet6</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="monitor_link">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="sleeptime">
+ <data type="int">
+ <param name="minInclusive">0</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="disable_rdisc">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="prefer_interface">
+ <data type="string">
+ <!-- note: can be up to max(IFNAMSIZ,IFALIASZ) - 1 characters
+ where from include/linux/if.h IFNAMSIZ = 16, IFALIASZ = 256
+ and the terminating null character is subtracted:
+ http://www.gnu.org/software/libc/manual/html_node/Interface-Naming.html
+ resulting in 255 characters (at least one has to be given,
+ @least it would be a bit insane to have an interface
+ called "") -->
+ <param name="minLength">1</param>
+ <param name="maxLength">255</param>
+ <param name="pattern">[^\s#x0100-#x10FFFF]+</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- SCRIPT -->
<int:agent name="script">
<int:parameter name="file">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv3 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block
2013-12-05 17:31 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
@ 2013-12-05 20:03 ` Jan Pokorný
2013-12-05 21:07 ` [Cluster-devel] [PATCHv4 " Jan Pokorný
0 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 20:03 UTC (permalink / raw)
To: cluster-devel.redhat.com
Note that the silent rule before the arrangement like this is that
the wildcard block under int:agent-parameter-specialization will
always be the first one there, as element sets union will preserve
the document ordering (hence [last()] will point to the last item
in document order rather than the item of the last union operand).
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 51 ++++++++++++++++++++------------------
1 file changed, 27 insertions(+), 24 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index e025e37..3c10e48 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,18 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- WILDCARD (any agent containing such parameter) -->
+ <int:agent name="*">
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- FS -->
<int:agent name="fs">
<!-- int:parameter name="name"/ -->
@@ -73,15 +85,6 @@
<param name="enumeration">true</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
<int:parameter name="nfsrestart">
<data type="string">
<!-- note: a bit stricter than what the code enforces -->
@@ -153,15 +156,6 @@
<param name="enumeration">yes</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
<int:parameter name="sleeptime">
<data type="int">
<param name="minInclusive">0</param>
@@ -502,12 +496,21 @@
'rha:description=', $Q, normalize-space(shortdesc), $Q)"/>
<xsl:with-param name="indented" select="$use-indented"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:agent-parameter-specialization
- /int:agent[
- @name = current()/../../@name
- ]/int:parameter[
- @name = current()/@name
- ]/*"/>
+ select="(
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = '*'
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ |
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = current()/../../@name
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ )[last()]/*"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv4 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block
2013-12-05 20:03 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
@ 2013-12-05 21:07 ` Jan Pokorný
2013-12-06 14:13 ` [Cluster-devel] [PATCHv5 " Jan Pokorný
0 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-05 21:07 UTC (permalink / raw)
To: cluster-devel.redhat.com
Note that the silent rule before the arrangement like this is that
the wildcard block under int:agent-parameter-specialization will
always be the first one there, as element sets union will preserve
the document ordering (hence [last()] will point to the last item
in document order rather than the item of the last union operand).
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 53 +++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 24 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 7bd7b65..20d6578 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,18 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- WILDCARD (any agent containing such parameter) -->
+ <int:agent name="*">
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- FS -->
<int:agent name="fs">
<!-- int:parameter name="name"/ -->
@@ -73,15 +85,7 @@
<param name="enumeration">true</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
+ <!-- nfslock: see WILDCARD -->
<int:parameter name="nfsrestart">
<data type="string">
<!-- note: a bit stricter than what the code enforces -->
@@ -153,15 +157,7 @@
<param name="enumeration">yes</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
+ <!-- nfslock: see WILDCARD -->
<int:parameter name="sleeptime">
<data type="int">
<param name="minInclusive">0</param>
@@ -502,12 +498,21 @@
'rha:description=', $Q, normalize-space(shortdesc), $Q)"/>
<xsl:with-param name="indented" select="$use-indented"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:agent-parameter-specialization
- /int:agent[
- @name = current()/../../@name
- ]/int:parameter[
- @name = current()/@name
- ]/*"/>
+ select="(
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = '*'
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ |
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = current()/../../@name
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ )[last()]/*"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv2 5/6] rgmanager: ra2rng.xsl: fs-*: datatype/restrict the params
2013-12-05 17:24 ` [Cluster-devel] [PATCH 5/6] rgmanager: ra2rng.xsl: fs-*: " Jan Pokorný
@ 2013-12-06 14:02 ` Jan Pokorný
2013-12-09 20:45 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
0 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-06 14:02 UTC (permalink / raw)
To: cluster-devel.redhat.com
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 113 +++++++++++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 98d91f2..61329d3 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,119 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- FS -->
+ <int:agent name="fs">
+ <!-- int:parameter name="name"/ -->
+ <int:parameter name="mountpoint">
+ <data type="string">
+ <!-- only enforce starting with slash and@the very least
+ one non-zero length component (otherwise not sane);
+ maximum path length is as per PATH_MAX - 1 (4095)
+ from /usr/include/linux/limits.h -->
+ <param name="pattern">/[^\s#x0100-#x10FFFF]+</param>
+ <param name="maxLength">4095</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="device">
+ <data type="string">
+ <!-- like mountpoint + can be specified by UUID=XYZ
+ or LABEL=XYZ -->
+ <param name="pattern">/[^\s#x0100-#x10FFFF]+|(UUID|LABEL)=[^#x0100-#x10FFFF]+</param>
+ <param name="maxLength">4095</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="fstype">
+ <data type="token">
+ <!-- fs.sh only checks for cifs, nfs and nfs4;
+ length of 31 is a reasonable overapproximation -->
+ <param name="pattern">/[^\s#x0100-#x10FFFF]+</param>
+ <param name="maxLength">31</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="force_unmount">
+ <data type="token">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ <param name="enumeration">false</param>
+ <param name="enumeration">true</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="quick_status">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="self_fence">
+ <data type="token">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ <param name="enumeration">false</param>
+ <param name="enumeration">true</param>
+ <param name="enumeration">off</param>
+ <param name="enumeration">on</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="nfsrestart">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="fsid">
+ <data type="string">
+ <!-- prevent from whitespace breaking fragile handling -->
+ <param name="pattern">\S+</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="force_fsck">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="options">
+ <data type="string">
+ <!-- prevent from whitespace breaking fragile handling -->
+ <param name="pattern">\S+</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="use_findmnt">
+ <data type="token">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ <param name="enumeration">false</param>
+ <param name="enumeration">true</param>
+ <param name="enumeration">off</param>
+ <param name="enumeration">on</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- IP -->
<int:agent name="ip">
<int:parameter name="address">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv5 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block
2013-12-05 21:07 ` [Cluster-devel] [PATCHv4 " Jan Pokorný
@ 2013-12-06 14:13 ` Jan Pokorný
2013-12-09 20:45 ` [Cluster-devel] [PATCHv6 " Jan Pokorný
0 siblings, 1 reply; 19+ messages in thread
From: Jan Pokorný @ 2013-12-06 14:13 UTC (permalink / raw)
To: cluster-devel.redhat.com
Note that the silent rule before the arrangement like this is that
the wildcard block under int:agent-parameter-specialization will
always be the first one there, as element sets union will preserve
the document ordering (hence [last()] will point to the last item
in document order rather than the item of the last union operand).
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 53 +++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 24 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 61329d3..7bb43ce 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,18 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- WILDCARD (any agent containing such parameter) -->
+ <int:agent name="*">
+ <int:parameter name="nfslock">
+ <data type="string">
+ <!-- note: a bit stricter than what the code enforces -->
+ <param name="enumeration">0</param>
+ <param name="enumeration">1</param>
+ <param name="enumeration">no</param>
+ <param name="enumeration">yes</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- FS -->
<int:agent name="fs">
<!-- int:parameter name="name"/ -->
@@ -75,15 +87,7 @@
<param name="enumeration">on</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
+ <!-- nfslock: see WILDCARD -->
<int:parameter name="nfsrestart">
<data type="string">
<!-- note: a bit stricter than what the code enforces -->
@@ -155,15 +159,7 @@
<param name="enumeration">yes</param>
</data>
</int:parameter>
- <int:parameter name="nfslock">
- <data type="string">
- <!-- note: a bit stricter than what the code enforces -->
- <param name="enumeration">0</param>
- <param name="enumeration">1</param>
- <param name="enumeration">no</param>
- <param name="enumeration">yes</param>
- </data>
- </int:parameter>
+ <!-- nfslock: see WILDCARD -->
<int:parameter name="sleeptime">
<data type="int">
<param name="minInclusive">0</param>
@@ -504,12 +500,21 @@
'rha:description=', $Q, normalize-space(shortdesc), $Q)"/>
<xsl:with-param name="indented" select="$use-indented"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:agent-parameter-specialization
- /int:agent[
- @name = current()/../../@name
- ]/int:parameter[
- @name = current()/@name
- ]/*"/>
+ select="(
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = '*'
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ |
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = current()/../../@name
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ )[last()]/*"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv2 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node
2013-12-05 17:24 ` [Cluster-devel] [PATCH 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node Jan Pokorný
@ 2013-12-09 20:41 ` Jan Pokorný
0 siblings, 0 replies; 19+ messages in thread
From: Jan Pokorný @ 2013-12-09 20:41 UTC (permalink / raw)
To: cluster-devel.redhat.com
...and also adjust when to put element on the new line accordingly.
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index c939582..26218e6 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -155,8 +155,11 @@
</xsl:call-template>
</xsl:when>
<xsl:when test="self::*">
- <xsl:if test="count($fill-with/*) < 2
- or count(preceding-sibling::*) = 0">
+ <xsl:if test="count(preceding-sibling::*) = 0
+ or
+ (preceding-sibling::node()[comment() or *])[last()]
+ !=
+ preceding-sibling::*[last()]">
<xsl:value-of select="$NL"/>
</xsl:if>
<xsl:call-template name="tag">
@@ -427,7 +430,7 @@
<xsl:call-template name="pretty-print">
<xsl:with-param name="indented" select="$global-init-indent"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:common-optional-parameters/*"/>
+ select="document('')/*/int:common-optional-parameters/node()"/>
</xsl:call-template>
<!-- optional (start) -->
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv2 2/6] rgmanager: ra2rng.xsl: common params: finish datatyping/constraints
2013-12-05 17:24 ` [Cluster-devel] [PATCH 2/6] rgmanager: ra2rng.xsl: common params: finish datatyping/constraints Jan Pokorný
@ 2013-12-09 20:42 ` Jan Pokorný
0 siblings, 0 replies; 19+ messages in thread
From: Jan Pokorný @ 2013-12-09 20:42 UTC (permalink / raw)
To: cluster-devel.redhat.com
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 61 +++++++++++++++++++++++++++++++++-----
1 file changed, 53 insertions(+), 8 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 26218e6..8d22c60 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,17 +15,62 @@
<int:common-optional-parameters>
<optional>
- <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree."/>
- </optional>
- <optional>
- <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal."/>
- </optional>
- <optional>
- <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check."/>
+ <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree.">
+ <data type="string">
+ <param name="pattern">\s*[12]\s*|[Yy][Ee][Ss]|[Nn][Oo][Nn]-[Cc][Rr][Ii][Tt][Ii][Cc][Aa][Ll]</param>
+ </data>
+ </attribute>
</optional>
<optional>
- <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten."/>
+ <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal.">
+ <data type="string">
+ <param name="pattern">\s*[1-9][0-9]*\s*|[Yy][Ee][Ss]</param>
+ </data>
+ </attribute>
</optional>
+
+ <!-- failures -->
+ <choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <!--
+ __max_failures and __failure_expire_time only make sense
+ when defined altogether and contain valid non-zero value
+ -->
+ <group>
+ <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check.">
+ <data type="int">
+ <param name="minExclusive">0</param>
+ </data>
+ </attribute>
+ <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten.">
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </attribute>
+ </group>
+ <group>
+ <optional>
+ <attribute name="__max_failures">
+ <!-- while negative value is not a strict error as it is
+ silently turned to zero, don't promote such a liberty
+ -->
+ <value type="int">0</value>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__failure_expire_time">
+ <data type="string">
+ <except>
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </except>
+ </data>
+ </attribute>
+ </optional>
+ </group>
+ </choice>
+
+ <!-- restarts -->
<choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<!--
__max_restarts and __restart_expire_time only make sense
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv2 3/6] rgmanager: ra2rng.xsl: common params: just refer to named pattern
2013-12-05 17:24 ` [Cluster-devel] [PATCH 3/6] rgmanager: ra2rng.xsl: common params: just refer to named pattern Jan Pokorný
@ 2013-12-09 20:43 ` Jan Pokorný
0 siblings, 0 replies; 19+ messages in thread
From: Jan Pokorný @ 2013-12-09 20:43 UTC (permalink / raw)
To: cluster-devel.redhat.com
...in resources.rng.tail where it has been moved out
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 113 +++--------------------------
rgmanager/src/resources/resources.rng.tail | 93 ++++++++++++++++++++++++
2 files changed, 102 insertions(+), 104 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 8d22c60..d781dbe 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -13,105 +13,6 @@
helper definitions
-->
-<int:common-optional-parameters>
- <optional>
- <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree.">
- <data type="string">
- <param name="pattern">\s*[12]\s*|[Yy][Ee][Ss]|[Nn][Oo][Nn]-[Cc][Rr][Ii][Tt][Ii][Cc][Aa][Ll]</param>
- </data>
- </attribute>
- </optional>
- <optional>
- <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal.">
- <data type="string">
- <param name="pattern">\s*[1-9][0-9]*\s*|[Yy][Ee][Ss]</param>
- </data>
- </attribute>
- </optional>
-
- <!-- failures -->
- <choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
- <!--
- __max_failures and __failure_expire_time only make sense
- when defined altogether and contain valid non-zero value
- -->
- <group>
- <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check.">
- <data type="int">
- <param name="minExclusive">0</param>
- </data>
- </attribute>
- <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten.">
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </attribute>
- </group>
- <group>
- <optional>
- <attribute name="__max_failures">
- <!-- while negative value is not a strict error as it is
- silently turned to zero, don't promote such a liberty
- -->
- <value type="int">0</value>
- </attribute>
- </optional>
- <optional>
- <attribute name="__failure_expire_time">
- <data type="string">
- <except>
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </except>
- </data>
- </attribute>
- </optional>
- </group>
- </choice>
-
- <!-- restarts -->
- <choice datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
- <!--
- __max_restarts and __restart_expire_time only make sense
- when defined altogether and contain valid non-zero value
- -->
- <group>
- <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up.">
- <data type="int">
- <param name="minExclusive">0</param>
- </data>
- </attribute>
- <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree.">
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </attribute>
- </group>
- <group>
- <optional>
- <attribute name="__max_restarts">
- <!-- while negative value is not a strict error as it is
- silently turned to zero, don't promote such a liberty
- -->
- <value type="int">0</value>
- </attribute>
- </optional>
- <optional>
- <attribute name="__restart_expire_time">
- <data type="string">
- <except>
- <data type="string">
- <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
- </data>
- </except>
- </data>
- </attribute>
- </optional>
- </group>
- </choice>
-</int:common-optional-parameters>
-
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
<!-- SCRIPT -->
@@ -470,13 +371,17 @@
select="concat($global-init-indent,
$global-indent)"/>
</xsl:call-template>
+ <xsl:value-of select="$NL"/>
- <!-- "paste" int:common-optional-parameters from above here -->
- <xsl:call-template name="pretty-print">
- <xsl:with-param name="indented" select="$global-init-indent"/>
- <xsl:with-param name="fill-with"
- select="document('')/*/int:common-optional-parameters/node()"/>
+ <xsl:call-template name="tag">
+ <xsl:with-param name="name" select="'ref'"/>
+ <xsl:with-param name="attrs" select="concat(
+ 'name=', $Q, 'RESOURCECOMMONPARAMS', $Q)"/>
+ <xsl:with-param name="indented"
+ select="concat($global-init-indent,
+ $global-indent)"/>
</xsl:call-template>
+ <xsl:value-of select="$NL"/>
<!-- optional (start) -->
<xsl:call-template name="tag-start">
diff --git a/rgmanager/src/resources/resources.rng.tail b/rgmanager/src/resources/resources.rng.tail
index 4434631..752b7af 100644
--- a/rgmanager/src/resources/resources.rng.tail
+++ b/rgmanager/src/resources/resources.rng.tail
@@ -4,6 +4,95 @@
</zeroOrMore>
</define>
+ <define name="RESOURCECOMMONPARAMS" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <optional>
+ <attribute name="__independent_subtree" rha:description="Treat this and all children as an independent subtree.">
+ <data type="string">
+ <param name="pattern">\s*[12]\s*|[Yy][Ee][Ss]|[Nn][Oo][Nn]-[Cc][Rr][Ii][Tt][Ii][Cc][Aa][Ll]</param>
+ </data>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__enforce_timeouts" rha:description="Consider a timeout for operations as fatal.">
+ <data type="string">
+ <param name="pattern">\s*[1-9][0-9]*\s*|[Yy][Ee][Ss]</param>
+ </data>
+ </attribute>
+ </optional>
+
+ <!-- failures -->
+ <choice>
+ <!-- __max_failures and __failure_expire_time only make sense when defined altogether and contain valid non-zero value -->
+ <group>
+ <attribute name="__max_failures" rha:description="Maximum number of failures before returning a failure to a status check.">
+ <data type="int">
+ <param name="minExclusive">0</param>
+ </data>
+ </attribute>
+ <attribute name="__failure_expire_time" rha:description="Amount of time before a failure is forgotten.">
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </attribute>
+ </group>
+ <group>
+ <optional>
+ <attribute name="__max_failures">
+ <!-- while negative value is not a strict error as it is silently turned to zero, don't promote such a liberty -->
+ <value type="int">0</value>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__failure_expire_time">
+ <data type="string">
+ <except>
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </except>
+ </data>
+ </attribute>
+ </optional>
+ </group>
+ </choice>
+
+ <!-- restarts -->
+ <choice>
+ <!-- __max_restarts and __restart_expire_time only make sense when defined altogether and contain valid non-zero value -->
+ <group>
+ <attribute name="__max_restarts" rha:description="Maximum number restarts for an independent subtree before giving up.">
+ <data type="int">
+ <param name="minExclusive">0</param>
+ </data>
+ </attribute>
+ <attribute name="__restart_expire_time" rha:description="Amount of time before a failure is forgotten for an independent subtree.">
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </attribute>
+ </group>
+ <group>
+ <optional>
+ <attribute name="__max_restarts">
+ <!-- while negative value is not a strict error as it is silently turned to zero, don't promote such a liberty -->
+ <value type="int">0</value>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="__restart_expire_time">
+ <data type="string">
+ <except>
+ <data type="string">
+ <param name="pattern">.*[1-9][0-9]*([SsMmHhDdWwYy].*|)</param>
+ </data>
+ </except>
+ </data>
+ </attribute>
+ </optional>
+ </group>
+ </choice>
+ </define>
+
<define name="RESOURCEACTION">
<zeroOrMore>
<element name="action" rha:description="Overrides resource action timings for a resource instance.">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv3 4/6] rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params
2013-12-05 20:02 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
@ 2013-12-09 20:44 ` Jan Pokorný
0 siblings, 0 replies; 19+ messages in thread
From: Jan Pokorný @ 2013-12-09 20:44 UTC (permalink / raw)
To: cluster-devel.redhat.com
NB: https://bugzilla.redhat.com/1039119#ip-sh--monitor_link--add-on-off-as-a-valid-value
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 67 ++++++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index d781dbe..1745460 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,73 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- IP -->
+ <int:agent name="ip">
+ <int:parameter name="address">
+ <data type="token">
+ <!-- only approximate regexp -->
+ <param name="pattern">[0-9A-Fa-f.:]+([/][0-9]+)?</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="family">
+ <choice>
+ <!-- note: "auto" is more like original expectation, but
+ enforce it to prevent arbitrary non-senses in this
+ context like uppercased INET6 -->
+ <value type="token">auto</value>
+ <value type="token">inet</value>
+ <value type="token">inet6</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="monitor_link">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ <value type="string">no</value>
+ <value type="string">yes</value>
+ <value type="string">off</value>
+ <value type="string">on</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="nfslock">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ <value type="string">no</value>
+ <value type="string">yes</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="sleeptime">
+ <data type="int">
+ <param name="minInclusive">0</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="disable_rdisc">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ <value type="string">no</value>
+ <value type="string">yes</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="prefer_interface">
+ <data type="string">
+ <!-- note: can be up to max(IFNAMSIZ,IFALIASZ) - 1 characters
+ where from include/linux/if.h IFNAMSIZ = 16, IFALIASZ = 256
+ and the terminating null character is subtracted:
+ http://www.gnu.org/software/libc/manual/html_node/Interface-Naming.html
+ resulting in 255 characters (at least one has to be given,
+ @least it would be a bit insane to have an interface
+ called "") -->
+ <param name="minLength">1</param>
+ <param name="maxLength">255</param>
+ <param name="pattern">[\p{IsBasicLatin}\p{IsLatin-1Supplement}-[\s]]+</param>
+ </data>
+ </int:parameter>
+ </int:agent>
<!-- SCRIPT -->
<int:agent name="script">
<int:parameter name="file">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv3 5/6] rgmanager: ra2rng.xsl: fs-*: datatype/restrict the params
2013-12-06 14:02 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
@ 2013-12-09 20:45 ` Jan Pokorný
0 siblings, 0 replies; 19+ messages in thread
From: Jan Pokorný @ 2013-12-09 20:45 UTC (permalink / raw)
To: cluster-devel.redhat.com
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 113 +++++++++++++++++++++++++++++++++++++
1 file changed, 113 insertions(+)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 1745460..0de30ef 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,119 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- FS -->
+ <int:agent name="fs">
+ <!-- int:parameter name="name"/ -->
+ <int:parameter name="mountpoint">
+ <data type="string">
+ <!-- only enforce starting with slash and@the very least
+ one non-zero length component (otherwise not sane);
+ maximum path length is as per PATH_MAX - 1 (4095)
+ from /usr/include/linux/limits.h -->
+ <param name="pattern">/[\p{IsBasicLatin}\p{IsLatin-1Supplement}-[\s]]+</param>
+ <param name="maxLength">4095</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="device">
+ <data type="string">
+ <!-- like mountpoint + can be specified by UUID=XYZ
+ or LABEL=XYZ -->
+ <param name="pattern">/[\p{IsBasicLatin}\p{IsLatin-1Supplement}-[\s]]+|(UUID|LABEL)=[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+</param>
+ <param name="maxLength">4095</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="fstype">
+ <data type="token">
+ <!-- fs.sh only checks for cifs, nfs and nfs4;
+ length of 31 is a reasonable overapproximation -->
+ <param name="pattern">[\p{IsBasicLatin}\p{IsLatin-1Supplement}-[\s]]+</param>
+ <param name="maxLength">31</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="force_unmount">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="token">0</value>
+ <value type="token">1</value>
+ <value type="token">no</value>
+ <value type="token">yes</value>
+ <value type="token">false</value>
+ <value type="token">true</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="quick_status">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="self_fence">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="token">0</value>
+ <value type="token">1</value>
+ <value type="token">no</value>
+ <value type="token">yes</value>
+ <value type="token">false</value>
+ <value type="token">true</value>
+ <value type="token">off</value>
+ <value type="token">on</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="nfslock">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ <value type="string">no</value>
+ <value type="string">yes</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="nfsrestart">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ <value type="string">no</value>
+ <value type="string">yes</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="fsid">
+ <data type="string">
+ <!-- prevent from whitespace breaking fragile handling -->
+ <param name="pattern">\S+</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="force_fsck">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ <value type="string">no</value>
+ <value type="string">yes</value>
+ </choice>
+ </int:parameter>
+ <int:parameter name="options">
+ <data type="string">
+ <!-- prevent from whitespace breaking fragile handling -->
+ <param name="pattern">\S*</param>
+ </data>
+ </int:parameter>
+ <int:parameter name="use_findmnt">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="token">0</value>
+ <value type="token">1</value>
+ <value type="token">no</value>
+ <value type="token">yes</value>
+ <value type="token">false</value>
+ <value type="token">true</value>
+ <value type="token">off</value>
+ <value type="token">on</value>
+ </choice>
+ </int:parameter>
+ </int:agent>
<!-- IP -->
<int:agent name="ip">
<int:parameter name="address">
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
* [Cluster-devel] [PATCHv6 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block
2013-12-06 14:13 ` [Cluster-devel] [PATCHv5 " Jan Pokorný
@ 2013-12-09 20:45 ` Jan Pokorný
0 siblings, 0 replies; 19+ messages in thread
From: Jan Pokorný @ 2013-12-09 20:45 UTC (permalink / raw)
To: cluster-devel.redhat.com
Note that the silent rule before the arrangement like this is that
the wildcard block under int:agent-parameter-specialization will
always be the first one there, as element sets union will preserve
the document ordering (hence [last()] will point to the last item
in document order rather than the item of the last union operand).
Signed-off-by: Jan Pokorn? <jpokorny@redhat.com>
---
rgmanager/src/resources/ra2rng.xsl | 53 +++++++++++++++++++++-----------------
1 file changed, 29 insertions(+), 24 deletions(-)
diff --git a/rgmanager/src/resources/ra2rng.xsl b/rgmanager/src/resources/ra2rng.xsl
index 0de30ef..9ee83d0 100644
--- a/rgmanager/src/resources/ra2rng.xsl
+++ b/rgmanager/src/resources/ra2rng.xsl
@@ -15,6 +15,18 @@
<int:agent-parameter-specialization>
<!-- int:agent @name="..." > int:parameter @name="..." > PATTERN -->
+ <!-- WILDCARD (any agent containing such parameter) -->
+ <int:agent name="*">
+ <int:parameter name="nfslock">
+ <choice>
+ <!-- note: a bit stricter than what the code enforces -->
+ <value type="string">0</value>
+ <value type="string">1</value>
+ <value type="string">no</value>
+ <value type="string">yes</value>
+ </choice>
+ </int:parameter>
+ </int:agent>
<!-- FS -->
<int:agent name="fs">
<!-- int:parameter name="name"/ -->
@@ -75,15 +87,7 @@
<value type="token">on</value>
</choice>
</int:parameter>
- <int:parameter name="nfslock">
- <choice>
- <!-- note: a bit stricter than what the code enforces -->
- <value type="string">0</value>
- <value type="string">1</value>
- <value type="string">no</value>
- <value type="string">yes</value>
- </choice>
- </int:parameter>
+ <!-- nfslock: see WILDCARD -->
<int:parameter name="nfsrestart">
<choice>
<!-- note: a bit stricter than what the code enforces -->
@@ -157,15 +161,7 @@
<value type="string">on</value>
</choice>
</int:parameter>
- <int:parameter name="nfslock">
- <choice>
- <!-- note: a bit stricter than what the code enforces -->
- <value type="string">0</value>
- <value type="string">1</value>
- <value type="string">no</value>
- <value type="string">yes</value>
- </choice>
- </int:parameter>
+ <!-- nfslock: see WILDCARD -->
<int:parameter name="sleeptime">
<data type="int">
<param name="minInclusive">0</param>
@@ -506,12 +502,21 @@
'rha:description=', $Q, normalize-space(shortdesc), $Q)"/>
<xsl:with-param name="indented" select="$use-indented"/>
<xsl:with-param name="fill-with"
- select="document('')/*/int:agent-parameter-specialization
- /int:agent[
- @name = current()/../../@name
- ]/int:parameter[
- @name = current()/@name
- ]/*"/>
+ select="(
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = '*'
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ |
+ document('')/*/int:agent-parameter-specialization
+ /int:agent[
+ @name = current()/../../@name
+ ]/int:parameter[
+ @name = current()/@name
+ ]
+ )[last()]/*"/>
</xsl:call-template>
<xsl:value-of select="$NL"/>
--
1.8.1.4
^ permalink raw reply related [flat|nested] 19+ messages in thread
end of thread, other threads:[~2013-12-09 20:45 UTC | newest]
Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-05 17:24 [Cluster-devel] [resource-agents][PATCH 0/6] rgmanager: ra2rng.xsl: IP+FS params datatyping Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 1/6] rgmanager: ra2rng.xsl: adjust pretty-print to capture full node Jan Pokorný
2013-12-09 20:41 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 2/6] rgmanager: ra2rng.xsl: common params: finish datatyping/constraints Jan Pokorný
2013-12-09 20:42 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 3/6] rgmanager: ra2rng.xsl: common params: just refer to named pattern Jan Pokorný
2013-12-09 20:43 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 4/6] rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params Jan Pokorný
2013-12-05 20:02 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-09 20:44 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 5/6] rgmanager: ra2rng.xsl: fs-*: " Jan Pokorný
2013-12-06 14:02 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-09 20:45 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
2013-12-05 17:24 ` [Cluster-devel] [PATCH 6/6] rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block Jan Pokorný
2013-12-05 17:31 ` [Cluster-devel] [PATCHv2 " Jan Pokorný
2013-12-05 20:03 ` [Cluster-devel] [PATCHv3 " Jan Pokorný
2013-12-05 21:07 ` [Cluster-devel] [PATCHv4 " Jan Pokorný
2013-12-06 14:13 ` [Cluster-devel] [PATCHv5 " Jan Pokorný
2013-12-09 20:45 ` [Cluster-devel] [PATCHv6 " Jan Pokorný
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).