Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=87266bcbf... Commit: 87266bcbf3f1b71664e65d82fb6de9f8814cb19e Parent: dff6b12ab73c8c38fc579ec312f398d6711cfeb8 Author: Marek 'marx' Grac mgrac@redhat.com AuthorDate: Thu Jul 26 14:27:14 2012 +0200 Committer: Marek 'marx' Grac mgrac@redhat.com CommitterDate: Thu Jul 26 14:27:14 2012 +0200
Add fence agents specific for HP iLO2, iLO3, IMM and iDrac
These fence agents runs 'standard' fence agent (fence_ilo, fence_ipmilan) with correct timeout options, encryption, snmp_version, ... Originally they were supposed to be symbolic links but this approach is not recommended so they regular files.
Resolves: rhbz#800650 --- fence/agents/ilo/Makefile.am | 10 ++++++++-- fence/agents/ilo/fence_ilo.py | 1 + fence/agents/ipmilan/Makefile.am | 11 +++++++++-- fence/agents/ipmilan/ipmilan.c | 10 ++++++++++ fence/agents/lib/fence2man.xsl | 4 ++++ fence/agents/lib/fencing.py.py | 3 +++ 6 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/fence/agents/ilo/Makefile.am b/fence/agents/ilo/Makefile.am index 7b44f59..120727a 100644 --- a/fence/agents/ilo/Makefile.am +++ b/fence/agents/ilo/Makefile.am @@ -2,13 +2,19 @@ MAINTAINERCLEANFILES = Makefile.in
TARGET = fence_ilo
+SYMTARGET = fence_ilo2 + SRC = $(TARGET).py
EXTRA_DIST = $(SRC)
-sbin_SCRIPTS = $(TARGET) +sbin_SCRIPTS = $(TARGET) $(SYMTARGET) + +man_MANS = $(TARGET).8 $(SYMTARGET).8 + +$(SYMTARGET): $(TARGET) + cp $^ $@
-man_MANS = $(TARGET).8
include $(top_srcdir)/make/fencebuild.mk include $(top_srcdir)/make/fenceman.mk diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py index f70dc9c..d4e34df 100644 --- a/fence/agents/ilo/fence_ilo.py +++ b/fence/agents/ilo/fence_ilo.py @@ -82,6 +82,7 @@ The agent opens an SSL connection to the iLO card. Once the SSL \ connection is established, the agent is able to communicate with \ the iLO card through an XML stream." docs["vendorurl"] = "http://www.hp.com" + docs["symlink"] = [("fence_ilo2", "Fence agent for HP iLO2")] show_docs(options, docs)
## diff --git a/fence/agents/ipmilan/Makefile.am b/fence/agents/ipmilan/Makefile.am index 17ac8f2..c4fc636 100644 --- a/fence/agents/ipmilan/Makefile.am +++ b/fence/agents/ipmilan/Makefile.am @@ -2,15 +2,22 @@ MAINTAINERCLEANFILES = Makefile.in
TARGET = fence_ipmilan
+SYMTARGET = fence_ilo3 fence_imm fence_idrac + sbin_PROGRAMS = $(TARGET)
+sbin_SCRIPTS = $(SYMTARGET) + noinst_HEADERS = expect.h
fence_ipmilan_SOURCES = expect.c ipmilan.c
-man_MANS = $(TARGET).8 +man_MANS = $(TARGET).8 $(SYMTARGET:%=%.8) + +$(SYMTARGET): $(TARGET) + cp $^ $@
include $(top_srcdir)/make/fencemanc.mk
clean-local: clean-man - rm -f $(TARGET) + rm -f $(TARGET) $(SYMTARGET) diff --git a/fence/agents/ipmilan/ipmilan.c b/fence/agents/ipmilan/ipmilan.c index ef2b582..d1a0530 100644 --- a/fence/agents/ipmilan/ipmilan.c +++ b/fence/agents/ipmilan/ipmilan.c @@ -903,6 +903,9 @@ static void print_xml_metadata(char *pname) {
printf("%s\n","<?xml version=\"1.0\" ?>"); printf("%s%s%s\n","<resource-agent name="",pname,"" shortdesc="Fence agent for IPMI over LAN">"); + printf("<symlink name="fence_ilo3" shortdesc="Fence agent for HP iLO2"/>\n"); + printf("<symlink name="fence_idrac" shortdesc="Fence agent for Dell iDRAC"/>\n"); + printf("<symlink name="fence_imm" shortdesc="Fence agent for IBM Integrated Management Module"/>\n"); printf("<longdesc>\n"); printf("fence_ipmilan is an I/O Fencing agent which can be used with " "machines controlled by IPMI. This agent calls support software " @@ -967,6 +970,7 @@ main(int argc, char **argv) int cipher=-1; int print_final_status=1; int translated_ret = -1; + char *filename;
memset(ip, 0, sizeof(ip)); memset(authtype, 0, sizeof(authtype)); @@ -977,6 +981,12 @@ main(int argc, char **argv) memset(method, 0, sizeof(method)); memset(delay, 0, sizeof(delay));
+ if (!strcmp(pname, "fence_ilo3")) { + lanplus = 1; + down_sleep = 4; + strncpy(method, "cycle\0", 6); + } + if (argc > 1) { /* Parse command line options if any were specified diff --git a/fence/agents/lib/fence2man.xsl b/fence/agents/lib/fence2man.xsl index 0fd71be..89baf7f 100644 --- a/fence/agents/lib/fence2man.xsl +++ b/fence/agents/lib/fence2man.xsl @@ -33,6 +33,10 @@ .TH FENCE_AGENT 8 2009-10-20 "<xsl:value-of select="@name"/> (Fence Agent)" .SH NAME <xsl:value-of select="@name" /> - <xsl:value-of select="@shortdesc" /> +<xsl:for-each select="symlink"> +.P +<xsl:value-of select="@name" /> - <xsl:value-of select="@shortdesc" /> (symlink) +</xsl:for-each> .SH DESCRIPTION .P <xsl:value-of select="longdesc"/> diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index a9c287a..cb8ec26 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -471,6 +471,9 @@ def metadata(avail_opt, options, docs):
print "<?xml version=\"1.0\" ?>" print "<resource-agent name="" + os.path.basename(sys.argv[0]) + "" shortdesc="" + docs["shortdesc"] + "" >" + if "symlink" in docs: + for (symlink,desc) in docs["symlink"]: + print "<symlink name="" + symlink + "" shortdesc="" + desc + ""/>" print "<longdesc>" + docs["longdesc"] + "</longdesc>" if docs.has_key("vendorurl"): print "<vendor-url>" + docs["vendorurl"] + "</vendor-url>"
cluster-commits@lists.stg.fedorahosted.org