cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Jan Pokorný <jpokorny@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [cluster][PATCH] rng: {for, back}ward-compat support for more strict RA validation
Date: Mon, 16 Dec 2013 18:18:01 +0100	[thread overview]
Message-ID: <1387214281-21839-1-git-send-email-jpokorny@redhat.com> (raw)

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..d959735 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 ra2rng.xsl - 2>/dev/null
+		  done
+		  echo '</rha:wrap>'; } \
+		| xsltproc 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



             reply	other threads:[~2013-12-16 17:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 17:18 Jan Pokorný [this message]
2013-12-17 14:39 ` [Cluster-devel] [PATCH v2] rng: {for, back}ward-compat support for more strict RA validation Jan Pokorný
2013-12-17 16:16 ` [Cluster-devel] [cluster][PATCH] " Jan Pokorný

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1387214281-21839-1-git-send-email-jpokorny@redhat.com \
    --to=jpokorny@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).