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

[Cluster-devel] [PATCH 1/2] Node Assassin: add support for metadata



To be honest, untested.

Signed-off-by: Jan Pokorný <jpokorny redhat com>
---
 fence/agents/node_assassin/fence_na.lib.in | 50 ++++++++++++++++++++++++++++++
 fence/agents/node_assassin/fence_na.pl     |  9 +++++-
 2 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/fence/agents/node_assassin/fence_na.lib.in b/fence/agents/node_assassin/fence_na.lib.in
index 67d5367..84d3bf2 100644
--- a/fence/agents/node_assassin/fence_na.lib.in
+++ b/fence/agents/node_assassin/fence_na.lib.in
@@ -918,4 +918,54 @@ sub _make_hash_reference
 	_add_hash_reference($href, $_href);
 }
 
+
+sub print_metadata
+{
+print '<?xml version="1.0" ?>
+<resource-agent name="fence_na" shortdesc="I/O Fencing agent for Node Assassin." >
+<longdesc>
+fence_na is an I/O Fencing agent for Node Assassin, open hardware, open source cluster fence device.
+</longdesc>
+<vendor-url>http://nodeassassin.org</vendor-url>
+<parameters>
+        <parameter name="action" unique="1" required="1">
+                <content type="string" />
+		<shortdesc lang="en">Operation to perform. Valid operations: on, off, reboot, status, list, metadata, release, boot or shutdown</shortdesc>
+        </parameter>
+        <parameter name="ipaddr" unique="1" required="1">
+                <content type="string" />
+                <shortdesc lang="en">Node Assassin IP or name to talk to</shortdesc>
+        </parameter>
+        <parameter name="login" unique="1" required="1">
+                <content type="string" />
+                <shortdesc lang="en">Login name used to log into the Node Assassin(s)</shortdesc>
+        </parameter>
+        <parameter name="passwd" unique="1" required="0">
+                <content type="string" />
+                <shortdesc lang="en">Password needed to access the Node Assassin(s)</shortdesc>
+        </parameter>
+        <parameter name="passwd_script" unique="1" required="0">
+                <content type="string" />
+                <shortdesc lang="en">Script to retrieve password (not implemented)</shortdesc>
+        </parameter>
+        <parameter name="quiet" unique="0" required="0">
+                <content type="boolean" />
+                <shortdesc lang="en">Suppress output</shortdesc>
+        </parameter>
+</parameters>
+<actions>
+        <action name="on" />
+        <action name="off" />
+	<action name="reboot" />
+        <action name="status" />
+        <action name="metadata" />
+        <action name="list" />
+        <action name="release" />
+        <action name="boot" />
+        <action name="shutdown" />
+</actions>
+</resource-agent>
+';
+}
+
 1;
diff --git a/fence/agents/node_assassin/fence_na.pl b/fence/agents/node_assassin/fence_na.pl
index bc7fb00..249bc55 100644
--- a/fence/agents/node_assassin/fence_na.pl
+++ b/fence/agents/node_assassin/fence_na.pl
@@ -140,9 +140,16 @@ if (($conf->{na}{login} ne $conf->{'system'}{username}) or ($conf->{na}{passwd}
 # What do?                                                                    #
 ###############################################################################
 
+record($conf, $log, "Action: ........ [$conf->{na}{action}].\n") if $conf->{'system'}{debug};
+
+if ($conf->{na}{action} eq "metadata")
+{
+	print_metadata();
+	do_exit($conf, $log, 0);
+}
+
 # When asked to 'monitor' or 'list'. being multi-port, this will return a CSV
 # of nodes and their aliases where found in the config file.
-record($conf, $log, "Action: ........ [$conf->{na}{action}].\n") if $conf->{'system'}{debug};
 if (($conf->{na}{action} eq "monitor") or ($conf->{na}{action} eq "list"))
 {
 	record($conf, $log, "Calling the 'show_list' function.\n") if $conf->{'system'}{debug};
-- 
1.7.11.7


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