Skip to contentSkip to conversation

rgmanager: ra2rng.xsl: IP+FS params datatyping

PATCH Superseded Jan Pokorný 1 participant 19 messages Dec 5, 2013 – Dec 9, 2013

lore
Share & tools
lore
#0 lore raw

cover rgmanager: ra2rng.xsl: IP+FS params datatyping

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(-)
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/6 rgmanager: ra2rng.xsl: adjust pretty-print to capture full node

...and also adjust when to put element on the new line accordingly.

---
 rgmanager/src/resources/ra2rng.xsl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
rgmanager/src/resources/ra2rng.xsl +6 -3
index 699052c..243b142 100644
@@ -157,8 +157,11 @@
                 </xsl:call-template>
             </xsl:when>
             <xsl:when test="self::*">
-                <xsl:if test="count($fill-with/*) &lt; 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) -->
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH v2 1/6 rgmanager: ra2rng.xsl: adjust pretty-print to capture full node

...and also adjust when to put element on the new line accordingly.

---
 rgmanager/src/resources/ra2rng.xsl | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
rgmanager/src/resources/ra2rng.xsl +6 -3
index c939582..26218e6 100644
@@ -155,8 +155,11 @@
                 </xsl:call-template>
             </xsl:when>
             <xsl:when test="self::*">
-                <xsl:if test="count($fill-with/*) &lt; 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) -->
Signature · 1 line
1.8.1.4
#3 lore raw

PATCH 2/6 rgmanager: ra2rng.xsl: common params: finish datatyping/constraints

In reply to Jan Pokorný
---
 rgmanager/src/resources/ra2rng.xsl | 63 +++++++++++++++++++++++++++++++++-----
 1 file changed, 55 insertions(+), 8 deletions(-)
rgmanager/src/resources/ra2rng.xsl +55 -8
index 243b142..78fbe35 100644
@@ -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
Signature · 1 line
1.8.1.4
#4 lore raw

PATCH v2 2/6 rgmanager: ra2rng.xsl: common params: finish datatyping/constraints

---
 rgmanager/src/resources/ra2rng.xsl | 61 +++++++++++++++++++++++++++++++++-----
 1 file changed, 53 insertions(+), 8 deletions(-)
rgmanager/src/resources/ra2rng.xsl +53 -8
index 26218e6..8d22c60 100644
@@ -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
Signature · 1 line
1.8.1.4
#5 lore raw

PATCH 3/6 rgmanager: ra2rng.xsl: common params: just refer to named pattern

In reply to Jan Pokorný

...in resources.rng.tail where it has been moved out

---
 rgmanager/src/resources/ra2rng.xsl         | 117 +++--------------------------
 rgmanager/src/resources/resources.rng.tail |  93 +++++++++++++++++++++++
 2 files changed, 102 insertions(+), 108 deletions(-)
rgmanager/src/resources/ra2rng.xsl +9 -108
index 78fbe35..d781dbe 100644
@@ -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">
rgmanager/src/resources/resources.rng.tail +93 -0

99 lines not on this page · raw message

Signature · 1 line
1.8.1.4
#6 lore raw

PATCH v2 3/6 rgmanager: ra2rng.xsl: common params: just refer to named pattern

...in resources.rng.tail where it has been moved out

---
 rgmanager/src/resources/ra2rng.xsl         | 113 +++--------------------------
 rgmanager/src/resources/resources.rng.tail |  93 ++++++++++++++++++++++++
 2 files changed, 102 insertions(+), 104 deletions(-)
rgmanager/src/resources/ra2rng.xsl +9 -104
index 8d22c60..d781dbe 100644
@@ -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">
rgmanager/src/resources/resources.rng.tail +89 -0

95 lines not on this page · raw message

Signature · 1 line
1.8.1.4
#7 lore raw

PATCH 4/6 rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params

In reply to Jan Pokorný
---
 rgmanager/src/resources/ra2rng.xsl | 65 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
rgmanager/src/resources/ra2rng.xsl +65 -0
index d781dbe..da84ae3 100644
@@ -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">
Signature · 1 line
1.8.1.4
#8 lore raw

PATCH v2 4/6 rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params

---
 rgmanager/src/resources/ra2rng.xsl | 65 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
rgmanager/src/resources/ra2rng.xsl +65 -0
index d781dbe..da84ae3 100644
@@ -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">
Signature · 1 line
1.8.1.4
#9 lore raw

PATCH v3 4/6 rgmanager: ra2rng.xsl: ip-*: datatype/restrict the params

NB: https://bugzilla.redhat.com/1039119#ip-sh--monitor_link--add-on-off-as-a-valid-value

---
 rgmanager/src/resources/ra2rng.xsl | 67 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
rgmanager/src/resources/ra2rng.xsl +67 -0
index d781dbe..1745460 100644
@@ -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">
Signature · 1 line
1.8.1.4
#10 lore raw

PATCH 5/6 rgmanager: ra2rng.xsl: fs-*: datatype/restrict the params

In reply to Jan Pokorný
---
 rgmanager/src/resources/ra2rng.xsl | 111 +++++++++++++++++++++++++++++++++++++
 1 file changed, 111 insertions(+)
rgmanager/src/resources/ra2rng.xsl +111 -0
index da84ae3..e025e37 100644
@@ -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">
Signature · 1 line
1.8.1.4
#11 lore raw

PATCH v2 5/6 rgmanager: ra2rng.xsl: fs-*: datatype/restrict the params

---
 rgmanager/src/resources/ra2rng.xsl | 113 +++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
rgmanager/src/resources/ra2rng.xsl +113 -0
index 98d91f2..61329d3 100644
@@ -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">
Signature · 1 line
1.8.1.4
#12 lore raw

PATCH v3 5/6 rgmanager: ra2rng.xsl: fs-*: datatype/restrict the params

---
 rgmanager/src/resources/ra2rng.xsl | 113 +++++++++++++++++++++++++++++++++++++
 1 file changed, 113 insertions(+)
rgmanager/src/resources/ra2rng.xsl +113 -0
index 1745460..0de30ef 100644
@@ -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">
Signature · 1 line
1.8.1.4
#13 lore raw

PATCH 6/6 rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block

In reply to Jan Pokorný

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).

---
 rgmanager/src/resources/ra2rng.xsl | 51 ++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 24 deletions(-)
rgmanager/src/resources/ra2rng.xsl +27 -24
index e025e37..3c10e48 100644
@@ -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"/>
 
Signature · 1 line
1.8.1.4
#14 lore raw

PATCH v2 6/6 rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block

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).

---
 rgmanager/src/resources/ra2rng.xsl | 51 ++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 24 deletions(-)
rgmanager/src/resources/ra2rng.xsl +27 -24
index e025e37..3c10e48 100644
@@ -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"/>
 
Signature · 1 line
1.8.1.4
#15 lore raw

PATCH v3 6/6 rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block

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).

---
 rgmanager/src/resources/ra2rng.xsl | 51 ++++++++++++++++++++------------------
 1 file changed, 27 insertions(+), 24 deletions(-)
rgmanager/src/resources/ra2rng.xsl +27 -24
index e025e37..3c10e48 100644
@@ -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"/>
 
Signature · 1 line
1.8.1.4
#16 lore raw

PATCH v4 6/6 rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block

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).

---
 rgmanager/src/resources/ra2rng.xsl | 53 +++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 24 deletions(-)
rgmanager/src/resources/ra2rng.xsl +29 -24
index 7bd7b65..20d6578 100644
@@ -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"/>
 
Signature · 1 line
1.8.1.4
#17 lore raw

PATCH v5 6/6 rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block

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).

---
 rgmanager/src/resources/ra2rng.xsl | 53 +++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 24 deletions(-)
rgmanager/src/resources/ra2rng.xsl +29 -24
index 61329d3..7bb43ce 100644
@@ -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"/>
 
Signature · 1 line
1.8.1.4
#18 lore raw

PATCH v6 6/6 rgmanager: ra2rng.xsl: {ip, fs}-nfslock: use common wildcard block

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).

---
 rgmanager/src/resources/ra2rng.xsl | 53 +++++++++++++++++++++-----------------
 1 file changed, 29 insertions(+), 24 deletions(-)
rgmanager/src/resources/ra2rng.xsl +29 -24
index 0de30ef..9ee83d0 100644
@@ -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"/>
 
Signature · 1 line
1.8.1.4