[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCHv5 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).

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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]