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

[Cluster-devel] [PATCH 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 | 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


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