cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Marek 'marx' Grac <mgrac@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] fence_na: Add support for XML metadata output
Date: Thu, 18 Oct 2012 11:38:55 +0200	[thread overview]
Message-ID: <1350553135-2248-1-git-send-email-mgrac@redhat.com> (raw)

Adding a skelet for XML metadata output so fence_na can be used with corosync.

Resolves: rhbz#864028
---
 fence/agents/node_assassin/fence_na.lib.in |   57 ++++++++++++++++++++++++++++
 fence/agents/node_assassin/fence_na.pl     |    6 +++
 2 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/fence/agents/node_assassin/fence_na.lib.in b/fence/agents/node_assassin/fence_na.lib.in
index 67d5367..dec734a 100644
--- a/fence/agents/node_assassin/fence_na.lib.in
+++ b/fence/agents/node_assassin/fence_na.lib.in
@@ -918,4 +918,61 @@ sub _make_hash_reference
 	_add_hash_reference($href, $_href);
 }
 
+sub show_metadata
+{
+	print <<METADATA;
+<?xml version="1.0" ?>
+<resource-agent name="fence_na.py" shortdesc="Fence agent for Node Assassin over telnet" >
+<longdesc>fence_na is an I/O Fencing agent which can be used with the Node Assassin network power switch. It logs into device via telnet and reboots a specified outlet. Lengthy telnet/ssh connections should be avoided while a GFS cluster  is  running  because  the  connection will block any necessary fencing actions.</longdesc>
+<vendor-url>http://www.altavee.ca/w/Node_Assassin_v1.1.4</vendor-url>
+<parameters>
+	<parameter name="action" unique="0" required="1">
+		<getopt mixed="-o &lt;action&gt;" />
+		<content type="string" default="reboot" />
+		<shortdesc lang="en">Fencing Action</shortdesc>
+	</parameter>
+	<parameter name="ipaddr" unique="0" required="1">
+		<getopt mixed="-a &lt;ip&gt;" />
+		<content type="string" />
+		<shortdesc lang="en">IP Address or Hostname</shortdesc>
+	</parameter>
+	<parameter name="login" unique="0" required="1">
+		<getopt mixed="-l &lt;name&gt;" />
+		<content type="string" />
+		<shortdesc lang="en">Login Name</shortdesc>
+	</parameter>
+	<parameter name="passwd" unique="0" required="0">
+		<getopt mixed="-p &lt;password&gt;" />
+		<content type="string" />
+		<shortdesc lang="en">Login password or passphrase</shortdesc>
+	</parameter>
+	<parameter name="port" unique="0" required="1">
+		<getopt mixed="-n;" />
+		<content type="string" />
+		<shortdesc lang="en">Physical plug number</shortdesc>
+	</parameter>
+	<parameter name="version" unique="0" required="0">
+		<getopt mixed="-V" />
+		<content type="boolean" />
+		<shortdesc lang="en">Display version information and exit</shortdesc>
+	</parameter>
+	<parameter name="help" unique="0" required="0">
+		<getopt mixed="-h" />
+		<content type="boolean" />
+		<shortdesc lang="en">Display help and exit</shortdesc>
+	</parameter>	
+</parameters>
+<actions>
+	<action name="on" />
+	<action name="off" />
+	<action name="reboot" />
+	<action name="status" />
+	<action name="list" />
+	<action name="monitor" />
+	<action name="metadata" />
+</actions>
+</resource-agent>
+METADATA
+}
+
 1;
diff --git a/fence/agents/node_assassin/fence_na.pl b/fence/agents/node_assassin/fence_na.pl
index bc7fb00..bdcaf69 100644
--- a/fence/agents/node_assassin/fence_na.pl
+++ b/fence/agents/node_assassin/fence_na.pl
@@ -106,6 +106,12 @@ foreach my $i (1..$conf->{'system'}{na_num})
 }
 
 die "Exiting on errors.\n" if $bad;
+
+if ($conf->{na}{action} eq "metadata") {
+	show_metadata();
+	do_exit($conf, $log, 0);
+}
+
 my @ny=("no", "yes");
 record($conf, $log, "Node Assassin: . [$conf->{na}{ipaddr}].\n");
 record($conf, $log, "TCP Port: ...... [$conf->{na}{tcp_port}].\n");
-- 
1.7.7.6



                 reply	other threads:[~2012-10-18  9:38 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=1350553135-2248-1-git-send-email-mgrac@redhat.com \
    --to=mgrac@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).