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

[Cluster-devel] [PATCH v2] rng: {for, back}ward-compat support for more strict RA validation



This is to complement resource-agents changeset [1].

[1] http://www.redhat.com/archives/cluster-devel/2013-December/msg00125.html

Signed-off-by: Jan Pokorný <jpokorny redhat com>
---
 config/tools/xml/ccs_update_schema.in | 43 ++++++++++++++++++++++++-----------
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/config/tools/xml/ccs_update_schema.in b/config/tools/xml/ccs_update_schema.in
index 98ed885..0ffaeac 100644
--- a/config/tools/xml/ccs_update_schema.in
+++ b/config/tools/xml/ccs_update_schema.in
@@ -211,19 +211,36 @@ generate_ras() {
 
 	cat $rngdir/resources.rng.head > "$outputdir/resources.rng.cache"
 	lecho " ras: generating rng data"
-	for i in $raslist; do
-		lecho " ras: processing $(basename $i)"
-		$i meta-data 2>/dev/null | xsltproc $rngdir/ra2rng.xsl - >> \
-			"$outputdir/resources.rng.cache" 2>/dev/null
-	done
-	cat $rngdir/resources.rng.mid >> "$outputdir/resources.rng.cache"
-	lecho " ras: generating ref data"
-	for i in $raslist; do
-		lecho " ras: processing $(basename $i)"
-		$i meta-data 2>/dev/null | xsltproc $rngdir/ra2ref.xsl - >> \
-			"$outputdir/resources.rng.cache" 2>/dev/null
-	done
-	cat $rngdir/resources.rng.tail >> "$outputdir/resources.rng.cache"
+	if [ -r $rngdir/ra2rng-postprocess.xsl ]; then
+		# use new logic for dynamic content + tail
+		{ echo '<rha:wrap xmlns:rha="http://redhat.com/~pkennedy/annotation_namespace/cluster_conf_annot_namespace";>';
+		  for i in $raslist; do
+		    lecho " ras: processing $(basename $i)" >&2
+		    $i meta-data 2>/dev/null | xsltproc $rngdir/ra2rng.xsl - 2>/dev/null
+		  done
+		  echo '</rha:wrap>'; } \
+		| xsltproc $rngdir/ra2rng-postprocess.xsl - \
+		| sed -e '/\s*<[\/]\?rha:wrap[^>]*>\s*/d' >> \
+			"$outputdir/resources.rng.cache"
+		sed -ne '/<\/rha:ignore>/bI;d;:I;n;p;bI' \
+			$rngdir/resources.rng.tail >> \
+			"$outputdir/resources.rng.cache"
+	else
+		# stick with old logic for dynamic content + tail
+		for i in $raslist; do
+			lecho " ras: processing $(basename $i)"
+			$i meta-data 2>/dev/null | xsltproc $rngdir/ra2rng.xsl - >> \
+				"$outputdir/resources.rng.cache" 2>/dev/null
+		done
+		cat $rngdir/resources.rng.mid >> "$outputdir/resources.rng.cache"
+		lecho " ras: generating ref data"
+		for i in $raslist; do
+			lecho " ras: processing $(basename $i)"
+			$i meta-data 2>/dev/null | xsltproc $rngdir/ra2ref.xsl - >> \
+				"$outputdir/resources.rng.cache" 2>/dev/null
+		done
+		cat $rngdir/resources.rng.tail >> "$outputdir/resources.rng.cache"
+	fi
 }
 
 create_fas_stubs() {
-- 
1.8.1.4


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