fencing-agents: Add metadata output for fence agents in perl
PATCH 1/1 fencing-agents: Add metadata output for fence agents in perl
Fencing agents written in PERL usually did not have option to print XML metadata about its feature. Adding this feature also allow us to generate manual pages directly from XML, so both GUI tools and manual pages can see same feature.
Resolves: rhbz#714841 (partial)
--- fence/agents/baytech/Makefile.am | 3 +- fence/agents/baytech/fence_baytech.8 | 84 -------------------------- fence/agents/baytech/fence_baytech.pl | 64 ++++++++++++++++++++- fence/agents/brocade/Makefile.am | 3 +- fence/agents/brocade/fence_brocade.8 | 84 -------------------------- fence/agents/brocade/fence_brocade.pl | 64 ++++++++++++++++++++- fence/agents/bullpap/Makefile.am | 3 +- fence/agents/bullpap/fence_bullpap.8 | 73 ----------------------- fence/agents/bullpap/fence_bullpap.pl | 68 ++++++++++++++++++++- fence/agents/cpint/Makefile.am | 3 +- fence/agents/cpint/fence_cpint.8 | 54 ----------------- fence/agents/cpint/fence_cpint.pl | 37 +++++++++++- fence/agents/drac/Makefile.am | 3 +- fence/agents/drac/fence_drac.8 | 105 --------------------------------- fence/agents/drac/fence_drac.pl | 87 +++++++++++++++++++++++++++- fence/agents/egenera/Makefile.am | 3 +- fence/agents/egenera/fence_egenera.8 | 84 -------------------------- fence/agents/egenera/fence_egenera.pl | 61 +++++++++++++++++++ fence/agents/lib/fence2man.xsl | 4 +- fence/agents/mcdata/Makefile.am | 3 +- fence/agents/mcdata/fence_mcdata.8 | 84 -------------------------- fence/agents/mcdata/fence_mcdata.pl | 65 ++++++++++++++++++++- fence/agents/vixel/Makefile.am | 3 +- fence/agents/vixel/fence_vixel.8 | 72 ---------------------- fence/agents/vixel/fence_vixel.pl | 57 +++++++++++++++++- fence/agents/xcat/Makefile.am | 3 +- fence/agents/xcat/fence_xcat.8 | 63 -------------------- fence/agents/xcat/fence_xcat.pl | 56 ++++++++++++++++- fence/agents/zvm/Makefile.am | 3 +- fence/agents/zvm/fence_zvm.8 | 64 -------------------- fence/agents/zvm/fence_zvm.pl | 50 +++++++++++++++- make/fencemanperl.mk | 7 ++ 32 files changed, 625 insertions(+), 792 deletions(-) delete mode 100644 fence/agents/baytech/fence_baytech.8 delete mode 100644 fence/agents/brocade/fence_brocade.8 delete mode 100644 fence/agents/bullpap/fence_bullpap.8 delete mode 100644 fence/agents/cpint/fence_cpint.8 delete mode 100644 fence/agents/drac/fence_drac.8 delete mode 100644 fence/agents/egenera/fence_egenera.8 delete mode 100644 fence/agents/mcdata/fence_mcdata.8 delete mode 100644 fence/agents/vixel/fence_vixel.8 delete mode 100644 fence/agents/xcat/fence_xcat.8 delete mode 100644 fence/agents/zvm/fence_zvm.8 create mode 100644 make/fencemanperl.mk
fence/agents/baytech/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/baytech/fence_baytech.8 deleted +0 -84
84 lines not on this page · raw message
fence/agents/baytech/fence_baytech.pl +63 -1
82 lines not on this page · raw message
fence/agents/brocade/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/brocade/fence_brocade.8 deleted +0 -84
84 lines not on this page · raw message
fence/agents/brocade/fence_brocade.pl +63 -1
82 lines not on this page · raw message
fence/agents/bullpap/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/bullpap/fence_bullpap.8 deleted +0 -73
73 lines not on this page · raw message
fence/agents/bullpap/fence_bullpap.pl +65 -3
98 lines not on this page · raw message
fence/agents/cpint/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/cpint/fence_cpint.8 deleted +0 -54
54 lines not on this page · raw message
fence/agents/cpint/fence_cpint.pl +36 -1
@@ -36,6 +36,7 @@ sub usage print "\n"; print "Options:\n"; print " -h usage\n"; + print " -o metadata print XML metadata for fence agent\n"; print " -u <string> userid of the virtual machine to fence\n"; print " -q quiet mode\n"; print " -V Version\n";
@@ -66,6 +67,35 @@ sub version exit 0; } +sub print_metadata +{ +print '<?xml version="1.0" ?> +<resource-agent name="fence_cpint" shortdesc="I/O Fencing agent for GFS on s390 and zSeries VM clusters" > +<longdesc> +fence_cpint is an I/O Fencing agent used on a virtual machine running GFS in a s390 or zSeries VM cluster. It uses the cpint package to send a CP LOGOFF command to the specified virtual machine. For fence_cpint to execute correctly, you must have the cpint module installed, and hcp in your PATH. + +NOTE: for fence_cpint to send a command to another virtual machine, the machine executing it must either be a privilege class C user or it must be the secondary user of the virtual machine to be fenced. This means that unless all of you GULM server nodes are privilege class C, fence_cpint can only be used with SLM. +</longdesc> +<vendor-url>http://www.ibm.com</vendor-url> +<parameters> + <parameter name="userid" unique="1" required="1"> + <getopt mixed="-u <userid>" /> + <content type="string" /> + <shortdesc lang="en">Userid of the virtual machine to fence</shortdesc> + </parameter> + <parameter name="help" unique="1" required="0"> + <getopt mixed="-h" /> + <content type="string" /> + <shortdesc lang="en">Display help and exit</shortdesc> + </parameter> +</parameters> +<actions> + <action name="metadata" /> +</actions> +</resource-agent> +'; +} + sub get_options_stdin { my $opt;
@@ -121,12 +151,17 @@ sub get_options_stdin } if (@ARGV > 0){ - getopts("hqu:V") || fail_usage; + getopts("hqu:Vo:") || fail_usage; usage if defined $opt_h; version if defined $opt_V; fail_usage "Unkown parameter." if (@ARGV > 0); + if ((defined $opt_o) && ($opt_o =~ /metadata/i)) { + print_metadata(); + exit 0; + } + fail_usage "No '-u' flag specified." unless defined $opt_u; } else { get_options_stdin();
fence/agents/drac/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/drac/fence_drac.8 deleted +0 -105
105 lines not on this page · raw message
fence/agents/drac/fence_drac.pl +86 -1
105 lines not on this page · raw message
fence/agents/egenera/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/egenera/fence_egenera.8 deleted +0 -84
84 lines not on this page · raw message
fence/agents/egenera/fence_egenera.pl +61 -0
73 lines not on this page · raw message
fence/agents/lib/fence2man.xsl +3 -1
@@ -17,9 +17,11 @@ <xsl:choose> <xsl:when test="@name = 'on'">Power on machine.</xsl:when> <xsl:when test="@name = 'off'">Power off machine.</xsl:when> +<xsl:when test="@name = 'enable'">Enable fabric access.</xsl:when> +<xsl:when test="@name = 'disable'">Disable fabric access.</xsl:when> <xsl:when test="@name = 'reboot'">Reboot machine.</xsl:when> <xsl:when test="@name = 'monitor'">Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more).</xsl:when> -<xsl:when test="@name = 'meta-data'">Display the XML metadata describing this resource.</xsl:when> +<xsl:when test="@name = 'metadata'">Display the XML metadata describing this resource.</xsl:when> <xsl:when test="@name = 'list'">List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise.</xsl:when> <xsl:when test="@name = 'status'">This returns the status of the plug/virtual machine.</xsl:when> <!-- Ehhh -->
fence/agents/mcdata/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/mcdata/fence_mcdata.8 deleted +0 -84
84 lines not on this page · raw message
fence/agents/mcdata/fence_mcdata.pl +64 -1
83 lines not on this page · raw message
fence/agents/vixel/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/vixel/fence_vixel.8 deleted +0 -72
72 lines not on this page · raw message
fence/agents/vixel/fence_vixel.pl +56 -1
76 lines not on this page · raw message
fence/agents/xcat/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/xcat/fence_xcat.8 deleted +0 -63
63 lines not on this page · raw message
fence/agents/xcat/fence_xcat.pl +52 -4
89 lines not on this page · raw message
fence/agents/zvm/Makefile.am +2 -1
@@ -11,6 +11,7 @@ sbin_SCRIPTS = $(TARGET) dist_man_MANS = $(TARGET).8 include $(top_srcdir)/make/fencebuild.mk +include $(top_srcdir)/make/fencemanperl.mk -clean-local: +clean-local: clean-man rm -f $(TARGET)
fence/agents/zvm/fence_zvm.8 deleted +0 -64
64 lines not on this page · raw message
fence/agents/zvm/fence_zvm.pl +49 -1
73 lines not on this page · raw message
make/fencemanperl.mk new file +7 -0
@@ -0,0 +1,7 @@ +%.8: $(TARGET) $(top_srcdir)/fence/agents/lib/fence2man.xsl + set -e && \ + perl $(TARGET) -o metadata > [email protected] && \ + xsltproc $(top_srcdir)/fence/agents/lib/fence2man.xsl [email protected] > $@ + +clean-man: + rm -f *.8 .*.8.tmp
Signature · 1 line
1.7.4.4