public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
From: Lon Hohberger <lon@fedoraproject.org>
To: cluster-cvs-relay@redhat.com
Subject: fence-agents: master - fence: Make fence agent metadata valid XML
Date: Thu, 12 Mar 2009 15:14:00 -0000	[thread overview]
Message-ID: <20090312151353.C63D1120198@lists.fedorahosted.org> (raw)

Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=fd6874af755109e22a5886b27d7fd25dcd0c8461
Commit:        fd6874af755109e22a5886b27d7fd25dcd0c8461
Parent:        9b6ae182eb5f1ee7a9e1ec4dc53c6468f6f6cf18
Author:        Lon Hohberger <lhh@redhat.com>
AuthorDate:    Mon Mar 9 12:58:00 2009 -0400
Committer:     Lon Hohberger <lhh@redhat.com>
CommitterDate: Thu Mar 12 11:13:55 2009 -0400

fence: Make fence agent metadata valid XML

This is needed by XSLT programs to transform the metadata
to other formats (i.e. man pages, RelaxNG blobs, etc.)
---
 fence/agents/lib/fencing.py.py |    3 +++
 fence/agents/xvm/options.c     |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index bdf7da2..c6a5a33 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -329,6 +329,8 @@ def metadata(avail_opt):
 	sorted_list = [ (key, all_opt[key]) for key in avail_opt ]
 	sorted_list.sort(lambda x, y: cmp(x[1]["order"], y[1]["order"]))
 
+	print "<?xml version=\"1.0\" ?>"
+	print "<resource-agent name=\"" + os.path.basename(sys.argv[0]) + "\" >"
 	print "<parameters>"
 	for option, value in sorted_list:
 		if all_opt[option].has_key("shortdesc"):
@@ -345,6 +347,7 @@ def metadata(avail_opt):
 			print "\t\t<shortdesc lang=\"en\">" + all_opt[option]["shortdesc"] + "</shortdesc>"
 			print "\t</parameter>"
 	print "</parameters>"
+	print "</resource-agent>"
 
 def process_input(avail_opt):
 	global all_opt
diff --git a/fence/agents/xvm/options.c b/fence/agents/xvm/options.c
index 1d04cb6..5dd6781 100644
--- a/fence/agents/xvm/options.c
+++ b/fence/agents/xvm/options.c
@@ -537,6 +537,8 @@ args_metadata(char *progname, char *optstr)
 	int x;
 	struct arg_info *arg;
 
+	printf("<?xml version=\"1.0\" ?>\n");
+	printf("<resource-agent name=\"%s\" >\n", basename(progname));
 	printf("<parameters>\n");
 
 	for (x = 0; x < strlen(optstr); x++) {
@@ -554,6 +556,7 @@ args_metadata(char *progname, char *optstr)
 	}
 
 	printf("</parameters>\n");
+	printf("</resource-agent>\n");
 }
 
 


                 reply	other threads:[~2009-03-12 15:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20090312151353.C63D1120198@lists.fedorahosted.org \
    --to=lon@fedoraproject.org \
    --cc=cluster-cvs-relay@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 read-only IMAP folder(s) and NNTP newsgroup(s).