fence-agents: master - fencing: Available actions in --help where not always up-to-date
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=e59a87...
Commit: e59a87f1f518dffb09469a30a8c62596d10fdfa4
Parent: c5ed2256e572bd06e8bf4ca00d6c891424ae4b00
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 23 17:25:39 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 23 17:25:39 2014 +0200
fencing: Available actions in --help where not always up-to-date
Previously, we have different help text for action only for fabric fencing (no-reboot). But
we have fence agents that do not have 'status' action e.g. fence_ovh. With this update,
the help text is always accurate.
---
fence/agents/lib/fencing.py.py | 10 ++++++++--
fence/agents/ovh/fence_ovh.py | 1 -
fence/agents/scsi/fence_scsi.py | 2 --
3 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 640f81a..33bb306 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -648,7 +648,6 @@ def process_input(avail_opt):
## password script to set a correct password
######
def check_input(device_opt, opt):
-
device_opt.extend(add_dependency_options(device_opt))
options = dict(opt)
@@ -663,7 +662,14 @@ def check_input(device_opt, opt):
if device_opt.count("fabric_fencing"):
all_opt["action"]["default"] = "off"
- all_opt["action"]["help"] = "-o, --action=[action] Action: status, off (default) or on"
+ if device_opt.count("no_status"):
+ all_opt["action"]["help"] = "-o, --action=[action] Action: off (default) or on"
+ else:
+ all_opt["action"]["help"] = "-o, --action=[action] Action: status, off (default) or on"
+ else:
+ if device_opt.count("no_status"):
+ all_opt["action"]["help"] = "-o, --action=[action] Action: reboot (default), off or on"
+
if device_opt.count("ipport"):
if options.has_key("--ipport"):
diff --git a/fence/agents/ovh/fence_ovh.py b/fence/agents/ovh/fence_ovh.py
index 170df11..fa23969 100644
--- a/fence/agents/ovh/fence_ovh.py
+++ b/fence/agents/ovh/fence_ovh.py
@@ -82,7 +82,6 @@ def main():
atexit.register(atexit_handler)
define_new_opts()
- all_opt["action"]["help"] = "-o, --action=[action] Action: reboot (default), off or on"
options = check_input(device_opt, process_input(device_opt))
docs = {}
diff --git a/fence/agents/scsi/fence_scsi.py b/fence/agents/scsi/fence_scsi.py
index d22bb86..ae960cc 100644
--- a/fence/agents/scsi/fence_scsi.py
+++ b/fence/agents/scsi/fence_scsi.py
@@ -382,8 +382,6 @@ def main():
define_new_opts()
- all_opt["action"]["help"] = "-o, --action=[action] Action: status, off (default) or on"
- all_opt["action"]["default"] = "off"
all_opt["delay"]["getopt"] = "H:"
#fence_scsi_check
9 years, 6 months
fence-agents: master - fence_zvm: Add support for 'monitor'
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=c5ed22...
Commit: c5ed2256e572bd06e8bf4ca00d6c891424ae4b00
Parent: 5a87866c70e3dc77798d3e6fd77e2607757d26b5
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 23 16:33:26 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 23 16:33:26 2014 +0200
fence_zvm: Add support for 'monitor'
Author: Neale Ferguson
---
fence/agents/zvm/fence_zvm.c | 85 ++++++++++++++++++++++++-----------
fence/agents/zvm/fence_zvmip.c | 84 +++++++++++++++++++++++-----------
tests/data/metadata/fence_zvmip.xml | 5 ++-
3 files changed, 119 insertions(+), 55 deletions(-)
diff --git a/fence/agents/zvm/fence_zvm.c b/fence/agents/zvm/fence_zvm.c
index 524e21e..2f82e25 100644
--- a/fence/agents/zvm/fence_zvm.c
+++ b/fence/agents/zvm/fence_zvm.c
@@ -51,6 +51,15 @@
#define DEFAULT_TIMEOUT 300
#define DEFAULT_DELAY 0
+#define ACT_OFFON 0
+#define ACT_OFF 1
+#define ACT_ON 2
+#define ACT_METADATA 3
+#define ACT_STATUS 4
+#define ACT_MONITOR 5
+#define ACT_LIST 6
+#define ACT_HELP 7
+
static int zvm_smapi_reportError(void *, void *);
static struct option longopts[] = {
@@ -64,7 +73,7 @@ static struct option longopts[] = {
{NULL, 0, NULL, 0}
};
-static char *optString = "a:ho:n:T:";
+static const char *optString = "a:ho:n:T:";
static int zvm_metadata(void);
static int usage(void);
@@ -323,8 +332,7 @@ zvm_smapi_imageActivate(zvm_driver_t *zvm)
rc = 0;
} else {
if ((outPlist->hdr.rc == RCERR_IMAGEOP) &
- ((outPlist->hdr.reason == RS_NOT_ACTIVE) |
- (outPlist->hdr.reason == RS_BEING_DEACT))) {
+ (outPlist->hdr.reason == RS_ALREADY_ACTIVE)) {
syslog(LOG_INFO, "Activation of %s successful",
zvm->target);
rc = 0;
@@ -649,8 +657,11 @@ zvm_metadata()
fprintf (stdout, "<actions>\n");
fprintf (stdout, "\t<action name=\"off\" />\n");
- fprintf (stdout, "\t<action name=\"on\" />\n");
+ fprintf (stdout, "\t<action name=\"on\" automatic=\"0\" />\n");
+ fprintf (stdout, "\t<action name=\"list\" />\n");
fprintf (stdout, "\t<action name=\"metadata\" />\n");
+ fprintf (stdout, "\t<action name=\"monitor\" />\n");
+ fprintf (stdout, "\t<action name=\"reboot\" />\n");
fprintf (stdout, "\t<action name=\"status\" />\n");
fprintf (stdout, "</actions>\n");
@@ -675,7 +686,7 @@ get_options_stdin (zvm_driver_t *zvm)
int32_t lSrvName,
lSrvNode,
lTarget;
- int fence = 0;
+ int fence = ACT_OFFON;
while (fgets (buf, sizeof (buf), stdin) != 0) {
if (trim(buf) == 0) {
@@ -698,16 +709,22 @@ get_options_stdin (zvm_driver_t *zvm)
continue;
if (!strcasecmp (opt, "action")) {
- if (strcasecmp(arg, "off") == 0) {
- fence = 1;
+ if (strcasecmp(arg, "reboot") == 0) {
+ fence = ACT_OFFON;
+ } else if (strcasecmp(arg, "off") == 0) {
+ fence = ACT_OFF;
} else if (strcasecmp(arg, "on") == 0) {
- fence = 2;
+ fence = ACT_ON;
} else if (strcasecmp(arg, "metadata") == 0) {
- fence = 3;
+ fence = ACT_METADATA;
} else if (strcasecmp(arg, "status") == 0) {
- fence = 4;
+ fence = ACT_STATUS;
+ } else if (strcasecmp(arg, "monitor") == 0) {
+ fence = ACT_MONITOR;
+ } else if (strcasecmp(arg, "list") == 0) {
+ fence = ACT_LIST;
} else {
- fence = 5;
+ fence = ACT_HELP;
}
} else if (!strcasecmp (opt, "ipaddr")) {
lSrvName = MIN(strlen(arg), sizeof(zvm->smapiSrv));
@@ -738,7 +755,7 @@ get_options_stdin (zvm_driver_t *zvm)
zvm->delay = DEFAULT_DELAY;
}
} else if (!strcasecmp (opt, "help")) {
- fence = 5;
+ fence = ACT_HELP;
}
}
return(fence);
@@ -755,7 +772,7 @@ static int
get_options(int argc, char **argv, zvm_driver_t *zvm)
{
int c,
- fence = 0;
+ fence = ACT_OFFON;
int32_t lSrvName,
lSrvNode,
lTarget;
@@ -768,16 +785,22 @@ get_options(int argc, char **argv, zvm_driver_t *zvm)
memcpy(zvm->target, optarg, lTarget);
break;
case 'o' :
- if (strcasecmp(optarg, "off") == 0) {
- fence = 1;
+ if (strcasecmp(optarg, "reboot") == 0) {
+ fence = ACT_OFFON;
+ } else if (strcasecmp(optarg, "off") == 0) {
+ fence = ACT_OFF;
} else if (strcasecmp(optarg, "on") == 0) {
- fence = 2;
+ fence = ACT_ON;
} else if (strcasecmp(optarg, "metadata") == 0) {
- fence = 3;
+ fence = ACT_METADATA;
} else if (strcasecmp(optarg, "status") == 0) {
- fence = 4;
+ fence = ACT_STATUS;
+ } else if (strcasecmp(optarg, "monitor") == 0) {
+ fence = ACT_MONITOR;
+ } else if (strcasecmp(optarg, "list") == 0) {
+ fence = ACT_LIST;
} else {
- fence = 5;
+ fence = ACT_HELP;
}
break;
case 'a' :
@@ -807,7 +830,7 @@ get_options(int argc, char **argv, zvm_driver_t *zvm)
memcpy(zvm->node, optarg, lSrvNode);
break;
default :
- fence = 5;
+ fence = ACT_HELP;
}
}
return(fence);
@@ -822,7 +845,8 @@ usage()
{
fprintf(stderr,"Usage: fence_zvm [options]\n\n"
"\tWhere [options] =\n"
- "\t-o --action [action] - \"off\", \"on\", \"metadata\", \"status\"\n"
+ "\t-o --action [action] - \"off\", \"on\", \"list\", \"metadata\", "
+ "\"monitor\", \"reboot\", \"status\"\n"
"\t--delay [seconds] - Time to delay fencing action in seconds\n"
"\t-n --plug [target] - Name of virtual machine to fence\n"
"\t-a --ip [server] - Name of SMAPI IUCV Request server\n"
@@ -874,26 +898,33 @@ main(int argc, char **argv)
fence = get_options_stdin(&zvm);
switch(fence) {
- case 0 : // OFFON
+ case ACT_OFFON : // OFFON
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageRecycle(&zvm);
break;
- case 1 : // OFF
+ case ACT_OFF : // OFF
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageDeactivate(&zvm);
break;
- case 2 : // ON
+ case ACT_ON : // ON
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageActivate(&zvm);
break;
- case 3 : // METADATA
+ case ACT_METADATA : // METADATA
rc = zvm_metadata();
break;
- case 4 : // STATUS
+ case ACT_STATUS : // STATUS
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageQuery(&zvm);
break;
- case 5 :
+ case ACT_MONITOR : // MONITOR
+ rc = 0;
+ break;
+ case ACT_LIST : // LIST
+ printf("N/A");
+ rc = 0;
+ break;
+ case ACT_HELP :
rc = usage();
}
closelog();
diff --git a/fence/agents/zvm/fence_zvmip.c b/fence/agents/zvm/fence_zvmip.c
index bd7c536..b16de48 100644
--- a/fence/agents/zvm/fence_zvmip.c
+++ b/fence/agents/zvm/fence_zvmip.c
@@ -50,6 +50,15 @@
#define DEFAULT_TIMEOUT 300
#define DEFAULT_DELAY 0
+#define ACT_OFFON 0
+#define ACT_OFF 1
+#define ACT_ON 2
+#define ACT_METADATA 3
+#define ACT_STATUS 4
+#define ACT_MONITOR 5
+#define ACT_LIST 6
+#define ACT_HELP 7
+
static int zvm_smapi_reportError(void *, void *);
static struct option longopts[] = {
@@ -64,7 +73,7 @@ static struct option longopts[] = {
{NULL, 0, NULL, 0}
};
-static char *optString = "a:o:hn:p:t:u:";
+static const char *optString = "a:o:hn:p:t:u:";
static int zvm_metadata(void);
static int usage(void);
@@ -376,8 +385,7 @@ zvm_smapi_imageActivate(zvm_driver_t *zvm)
rc = 0;
} else {
if ((outPlist->hdr.rc == RCERR_IMAGEOP) &
- ((outPlist->hdr.reason == RS_NOT_ACTIVE) |
- (outPlist->hdr.reason == RS_BEING_DEACT))) {
+ (outPlist->hdr.reason == RS_ALREADY_ACTIVE)) {
syslog(LOG_INFO, "Activation of %s successful",
zvm->target);
rc = 0;
@@ -653,7 +661,7 @@ get_options_stdin (zvm_driver_t *zvm)
*arg;
int32_t lSrvName,
lTarget;
- int fence = 0;
+ int fence = ACT_OFFON;
while (fgets (buf, sizeof (buf), stdin) != 0) {
if (trim(buf) == 0) {
@@ -676,16 +684,22 @@ get_options_stdin (zvm_driver_t *zvm)
continue;
if (!strcasecmp (opt, "action")) {
- if (strcasecmp(arg, "off") == 0) {
- fence = 1;
+ if (strcasecmp(arg, "reboot") == 0) {
+ fence = ACT_OFFON;
+ } else if (strcasecmp(arg, "off") == 0) {
+ fence = ACT_OFF;
} else if (strcasecmp(arg, "on") == 0) {
- fence = 2;
+ fence = ACT_ON;
} else if (strcasecmp(arg, "metadata") == 0) {
- fence = 3;
+ fence = ACT_METADATA;
} else if (strcasecmp(arg, "status") == 0) {
- fence = 4;
+ fence = ACT_STATUS;
+ } else if (strcasecmp(arg, "monitor") == 0) {
+ fence = ACT_MONITOR;
+ } else if (strcasecmp(arg, "list") == 0) {
+ fence = ACT_LIST;
} else {
- fence = 5;
+ fence = ACT_HELP;
}
} else if (!strcasecmp (opt, "ipaddr")) {
lSrvName = MIN(strlen(arg), sizeof(zvm->smapiSrv)-1);
@@ -712,7 +726,7 @@ get_options_stdin (zvm_driver_t *zvm)
zvm->timeOut = DEFAULT_TIMEOUT;
}
} else if (!strcasecmp (opt, "help")) {
- fence = 5;
+ fence = ACT_HELP;
}
}
return(fence);
@@ -729,7 +743,7 @@ static int
get_options(int argc, char **argv, zvm_driver_t *zvm)
{
int c,
- fence = 0;
+ fence = ACT_OFFON;
int32_t lSrvName,
lTarget;
char *endPtr;
@@ -745,16 +759,22 @@ get_options(int argc, char **argv, zvm_driver_t *zvm)
memcpy(zvm->target, optarg, lTarget);
break;
case 'o' :
- if (strcasecmp(optarg, "off") == 0) {
- fence = 1;
+ if (strcasecmp(optarg, "reboot") == 0) {
+ fence = ACT_OFFON;
+ } else if (strcasecmp(optarg, "off") == 0) {
+ fence = ACT_OFF;
} else if (strcasecmp(optarg, "on") == 0) {
- fence = 2;
+ fence = ACT_ON;
} else if (strcasecmp(optarg, "metadata") == 0) {
- fence = 3;
+ fence = ACT_METADATA;
} else if (strcasecmp(optarg, "status") == 0) {
- fence = 4;
+ fence = ACT_STATUS;
+ } else if (strcasecmp(optarg, "monitor") == 0) {
+ fence = ACT_MONITOR;
+ } else if (strcasecmp(optarg, "list") == 0) {
+ fence = ACT_LIST;
} else {
- fence = 5;
+ fence = ACT_HELP;
}
break;
case 'p' :
@@ -784,7 +804,7 @@ get_options(int argc, char **argv, zvm_driver_t *zvm)
}
break;
default :
- fence = 5;
+ fence = ACT_HELP;
}
}
return(fence);
@@ -861,9 +881,12 @@ zvm_metadata()
fprintf (stdout, "<actions>\n");
fprintf (stdout, "\t<action name=\"off\" />\n");
- fprintf (stdout, "\t<action name=\"on\" />\n");
+ fprintf (stdout, "\t<action name=\"on\" automatic=\"0\" />\n");
+ fprintf (stdout, "\t<action name=\"list\" />\n");
fprintf (stdout, "\t<action name=\"metadata\" />\n");
+ fprintf (stdout, "\t<action name=\"monitor\" />\n");
fprintf (stdout, "\t<action name=\"status\" />\n");
+ fprintf (stdout, "\t<action name=\"reboot\" />\n");
fprintf (stdout, "</actions>\n");
fprintf (stdout, "</resource-agent>\n");
@@ -881,7 +904,8 @@ usage()
{
fprintf(stderr,"Usage: fence_zvmip [options]\n\n"
"\tWhere [options] =\n"
- "\t-o --action [action] - \"off\", \"on\", \"metadata\", \"status\"\n"
+ "\t-o --action [action] - \"off\", \"on\", \"list\", \"metadata\", "
+ "\"monitor\", \"reboot\", \"status\"\n"
"\t--delay [seconds] - Time to delay fencing action in seconds\n"
"\t-n --plug [target] - Name of virtual machine to fence\n"
"\t-a --ip [server] - IP Name/Address of SMAPI Server\n"
@@ -944,26 +968,32 @@ main(int argc, char **argv)
fence = get_options_stdin(&zvm);
switch(fence) {
- case 0 : // OFFON
+ case ACT_OFFON : // OFFON
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageRecycle(&zvm);
break;
- case 1 : // OFF
+ case ACT_OFF : // OFF
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageDeactivate(&zvm);
break;
- case 2 : // ON
+ case ACT_ON : // ON
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageActivate(&zvm);
break;
- case 3 : // METADATA
+ case ACT_METADATA : // METADATA
rc = zvm_metadata();
break;
- case 4 : // STATUS
+ case ACT_STATUS : // STATUS
if ((rc = check_parm(&zvm)) == 0)
rc = zvm_smapi_imageQuery(&zvm);
break;
- case 5 :
+ case ACT_MONITOR : // MONITOR
+ rc = 0;
+ break;
+ case ACT_LIST :
+ printf("N/A");
+ break;
+ case ACT_HELP :
rc = usage();
}
closelog();
diff --git a/tests/data/metadata/fence_zvmip.xml b/tests/data/metadata/fence_zvmip.xml
index 1e098d1..7791303 100644
--- a/tests/data/metadata/fence_zvmip.xml
+++ b/tests/data/metadata/fence_zvmip.xml
@@ -41,8 +41,11 @@
</parameters>
<actions>
<action name="off" />
- <action name="on" />
+ <action name="on" automatic="0" />
+ <action name="list" />
<action name="metadata" />
+ <action name="monitor" />
<action name="status" />
+ <action name="reboot" />
</actions>
</resource-agent>
9 years, 6 months
fence-agents: master - [build]: Add build requirements to autoconf
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=5a8786...
Commit: 5a87866c70e3dc77798d3e6fd77e2607757d26b5
Parent: 4dc849439b0db09d2e16422c1bba13add93a1bc1
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 23 14:53:26 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 23 14:53:26 2014 +0200
[build]: Add build requirements to autoconf
---
autogen.sh | 2 +-
configure.ac | 6 ++++++
make/ac_python_module.m4 | 30 ++++++++++++++++++++++++++++++
3 files changed, 37 insertions(+), 1 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 3c5e1d9..ee22af8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,4 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
mkdir -p m4
-autoreconf -i -v && echo Now run ./configure and make
+autoreconf -i -I make -v && echo Now run ./configure and make
diff --git a/configure.ac b/configure.ac
index b603878..e066f2c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,6 +159,11 @@ LOGDIR=${localstatedir}/log/cluster
CLUSTERVARRUN=${localstatedir}/run/cluster
CLUSTERDATA=${datadir}/cluster
+AC_PYTHON_MODULE(suds, 1)
+AC_PYTHON_MODULE(pexpect, 1)
+AC_PYTHON_MODULE(pycurl, 1)
+AC_PYTHON_MODULE(requests, 1)
+
## path to 3rd-party binaries
AC_PATH_PROG([IPMITOOL_PATH], [ipmitool], [/usr/bin/ipmitool])
AC_PATH_PROG([AMTTOOL_PATH], [amttool], [/usr/bin/amttool])
@@ -254,6 +259,7 @@ CFLAGS="$ENV_CFLAGS $OPT_CFLAGS $GDB_FLAGS \
CPPFLAGS="-I\$(top_builddir)/make -I\$(top_srcdir)/make -I. $ENV_CPPFLAGS"
LDFLAGS="$ENV_LDFLAGS"
+
AC_CONFIG_FILES([Makefile
fence/Makefile
fence/agents/Makefile
diff --git a/make/ac_python_module.m4 b/make/ac_python_module.m4
new file mode 100644
index 0000000..32b9d72
--- /dev/null
+++ b/make/ac_python_module.m4
@@ -0,0 +1,30 @@
+dnl @synopsis AC_PYTHON_MODULE(modname[, fatal])
+dnl
+dnl Checks for Python module.
+dnl
+dnl If fatal is non-empty then absence of a module will trigger an
+dnl error.
+dnl
+dnl @category InstalledPackages
+dnl @author Andrew Collier <colliera(a)nu.ac.za>.
+dnl @version 2004-07-14
+dnl @license AllPermissive
+
+AC_DEFUN([AC_PYTHON_MODULE],[
+ AC_MSG_CHECKING(python module: $1)
+ python -c "import $1" 2>/dev/null
+ if test $? -eq 0;
+ then
+ AC_MSG_RESULT(yes)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
+ else
+ AC_MSG_RESULT(no)
+ eval AS_TR_CPP(HAVE_PYMOD_$1)=no
+ #
+ if test -n "$2"
+ then
+ AC_MSG_ERROR(failed to find required module $1)
+ exit 1
+ fi
+ fi
+])
9 years, 6 months
fence-agents: v4.0.12 annotated tag has been created
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=f8a0e4...
Commit: f8a0e46dd33571f5f0ec5e72c03c0bea66a7c501
Parent: 0000000000000000000000000000000000000000
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: 2014-10-16 12:26 +0000
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: 2014-10-16 12:26 +0000
annotated tag: v4.0.12 has been created
at f8a0e46dd33571f5f0ec5e72c03c0bea66a7c501 (tag)
tagging 4dc849439b0db09d2e16422c1bba13add93a1bc1 (commit)
replaces v4.0.10
v4.0.12 release
Marek 'marx' Grac (36):
[build] Fix building of fence_scsi_check
fence_brocade: Add support for 'list' action
fencing: Monitor is not working correctly without 'list' or 'status'
fencing: Replace syslog.syslog() calls with new logging handler
fencing: 'nodename' should not be logged as ignored argument
Fix usage of non-existent function
fence_apc_snmp: Add support for firmware 6.x
fence_ilo_moonshot: New fence agent for HP Moonshot iLO
fence_zvm: Add support for "on" and "status"
fence_zvm: Add current XML metadata to test suite
fence_ilo_moonshot: Add current XML metadata to test suite
[build] Fix automake files, so 'make distcheck' works
fencing: Add new options --ssl-secure and --ssl-insecure
[tests] Update XML metadata of fence agents
fence_ilo_ssh: New fence agent for HP iLO3/4 via SSH
fence_cisco_ucs & fence_vmware_soap: Logout has to be performed even when fencing fails
[clenaup] Fix whitespace convention issues
fence_zvm: Fixes for better upstream inclusion
fence_zvm: Add support for 'on', improve documentation
fence_rhevm: Use https:// prefix also with --ssl-secure and --ssl-insecure
[build] fence_scsi_check is generated during build time
[build] Create a new target for wiki export
[build] Add XSLT for creating wiki
[build] Unify make clean
fence_apc: --shell-timeout was used instead of --power-timeout
[doc] Improve wiki export
[doc] Improve wiki export
fence_rsb: Fix 62d90e3a0827fcdc5be632bdf4103d3c08b39622
fence_wti: Fix invalid "eol"
fence_pve: Add support for --ssl-secure and --ssl-insecure
fence_rhevm: Add support for cookies based authentication
[test] fence_ilo_ssh: Add required parameter for testing --delay
[build] fencing library: Add fence2wiki.xsl as XSL in Makefile.am
[build] Fix paths in process of building releases
[build] During clean up stage remove also *.wiki files
[test] Update XML metadata
9 years, 6 months
fence-agents: master - [test] Update XML metadata
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=4dc849...
Commit: 4dc849439b0db09d2e16422c1bba13add93a1bc1
Parent: 14e454ef38b29c33399b1d3c598c7102ffedcade
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 16 14:14:31 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 16 14:14:31 2014 +0200
[test] Update XML metadata
---
tests/data/metadata/fence_ovh.xml | 2 +-
tests/data/metadata/fence_rhevm.xml | 5 +++++
tests/data/metadata/fence_xenapi.xml | 2 +-
tests/data/metadata/fence_zvmip.xml | 1 +
4 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/data/metadata/fence_ovh.xml b/tests/data/metadata/fence_ovh.xml
index 522da6c..7e2d83d 100644
--- a/tests/data/metadata/fence_ovh.xml
+++ b/tests/data/metadata/fence_ovh.xml
@@ -9,7 +9,7 @@
<shortdesc lang="en">Login password or passphrase</shortdesc>
</parameter>
<parameter name="email" unique="0" required="1">
- <getopt mixed="-Z, --email=<email>" />
+ <getopt mixed="-Z, --email=[email]" />
<content type="string" />
<shortdesc lang="en">Reboot email</shortdesc>
</parameter>
diff --git a/tests/data/metadata/fence_rhevm.xml b/tests/data/metadata/fence_rhevm.xml
index c9d6eeb..0db2e17 100644
--- a/tests/data/metadata/fence_rhevm.xml
+++ b/tests/data/metadata/fence_rhevm.xml
@@ -53,6 +53,11 @@
<content type="boolean" />
<shortdesc lang="en">SSL connection</shortdesc>
</parameter>
+ <parameter name="use_cookies" unique="0" required="0">
+ <getopt mixed="--use-cookies" />
+ <content type="boolean" />
+ <shortdesc lang="en">Reuse cookies for authentication</shortdesc>
+ </parameter>
<parameter name="ssl_insecure" unique="0" required="0">
<getopt mixed="--ssl-insecure" />
<content type="boolean" />
diff --git a/tests/data/metadata/fence_xenapi.xml b/tests/data/metadata/fence_xenapi.xml
index 0dd0a78..470d215 100644
--- a/tests/data/metadata/fence_xenapi.xml
+++ b/tests/data/metadata/fence_xenapi.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
-<resource-agent name="fence_xenapi" shortdesc="XenAPI based fencing for the Citrix XenServer virtual machines." >
+<resource-agent name="fence_xenapi" shortdesc="Fence agent for Citrix XenServer over XenAPI" >
<longdesc>fence_cxs is an I/O Fencing agent used on Citrix XenServer hosts. It uses the XenAPI, supplied by Citrix, to establish an XML-RPC sesssion to a XenServer host. Once the session is established, further XML-RPC commands are issued in order to switch on, switch off, restart and query the status of virtual machines running on the host.</longdesc>
<vendor-url>http://www.xenproject.org</vendor-url>
<parameters>
diff --git a/tests/data/metadata/fence_zvmip.xml b/tests/data/metadata/fence_zvmip.xml
index 5a737ca..1e098d1 100644
--- a/tests/data/metadata/fence_zvmip.xml
+++ b/tests/data/metadata/fence_zvmip.xml
@@ -1,6 +1,7 @@
<?xml version="1.0" ?>
<resource-agent name="fence_zvmip" shortdesc="Fence agent for use with z/VM Virtual Machines">
<longdesc>The fence_zvm agent is intended to be used with with z/VM SMAPI service via TCP/IP</longdesc>
+<vendor-url>http://www.ibm.com</vendor-url>
<parameters>
<parameter name="port" unique="1" required="1">
<getopt mixed="-n, --plug" />
9 years, 6 months
fence-agents: master - [build] During clean up stage remove also *.wiki files
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=14e454...
Commit: 14e454ef38b29c33399b1d3c598c7102ffedcade
Parent: f70a12d370a586085c19d7f184491cdb409ad574
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 16 14:14:01 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 16 14:14:01 2014 +0200
[build] During clean up stage remove also *.wiki files
---
make/fencebuild.mk | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/make/fencebuild.mk b/make/fencebuild.mk
index 015c6ac..77ac499 100644
--- a/make/fencebuild.mk
+++ b/make/fencebuild.mk
@@ -23,5 +23,6 @@ $(TARGET): $(SRC)
else true ; fi
clean: clean-man
- rm -f $(TARGET) $(SYMTARGET) *.pyc
+ rm -f $(TARGET) $(SYMTARGET) *.pyc *.wiki
+clean-local: clean
\ No newline at end of file
9 years, 6 months
fence-agents: master - [build] Fix paths in process of building releases
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=f70a12...
Commit: f70a12d370a586085c19d7f184491cdb409ad574
Parent: 9f180da9a4f14bf56e5d0f0f87260223cd49f35f
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 16 14:13:24 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 16 14:13:24 2014 +0200
[build] Fix paths in process of building releases
---
make/agentccheck.mk | 2 +-
make/agentpycheck.mk | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/make/agentccheck.mk b/make/agentccheck.mk
index 3ef97f9..46e2055 100644
--- a/make/agentccheck.mk
+++ b/make/agentccheck.mk
@@ -1,5 +1,5 @@
TEMPFILE:=$(shell mktemp)
-DATADIR:=$(abs_top_builddir)/../tests/data/metadata
+DATADIR:=$(abs_top_srcdir)/tests/data/metadata
check: $(TARGET:%=xml-check.%) $(SYMTARGET:%=xml-check.%)
diff --git a/make/agentpycheck.mk b/make/agentpycheck.mk
index ae4e477..63cb9da 100644
--- a/make/agentpycheck.mk
+++ b/make/agentpycheck.mk
@@ -1,5 +1,6 @@
TEMPFILE:=$(shell mktemp)
-DATADIR:=$(abs_top_builddir)/../tests/data/metadata
+#DATADIR:=$(abs_top_builddir)/tests/data/metadata
+DATADIR:=$(abs_top_srcdir)/tests/data/metadata
check: $(TARGET:%=xml-check.%) $(SYMTARGET:%=xml-check.%) $(TARGET:%=delay-check.%)
9 years, 6 months
fence-agents: master - [build] fencing library: Add fence2wiki.xsl as XSL in Makefile.am
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=9f180d...
Commit: 9f180da9a4f14bf56e5d0f0f87260223cd49f35f
Parent: fbef1a9288b311564e3abe840ba414a4fee59832
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 16 14:12:36 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 16 14:12:36 2014 +0200
[build] fencing library: Add fence2wiki.xsl as XSL in Makefile.am
---
fence/agents/lib/Makefile.am | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/fence/agents/lib/Makefile.am b/fence/agents/lib/Makefile.am
index 38281bc..749de19 100644
--- a/fence/agents/lib/Makefile.am
+++ b/fence/agents/lib/Makefile.am
@@ -8,7 +8,7 @@ endif
SRC = fencing.py.py fencing_snmp.py.py XenAPI.py.py check_used_options.py
-XSL = fence2man.xsl fence2rng.xsl
+XSL = fence2man.xsl fence2rng.xsl fence2wiki.xsl
FASRNG = fence.rng.head fence.rng.tail metadata.rng
@@ -23,3 +23,5 @@ rngdir = ${CLUSTERDATA}/relaxng
rng_DATA = $(XSL) $(FASRNG)
include $(top_srcdir)/make/fencebuild.mk
+
+clean-man:
9 years, 6 months
fence-agents: master - [test] fence_ilo_ssh: Add required parameter for testing --delay
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=fbef1a...
Commit: fbef1a9288b311564e3abe840ba414a4fee59832
Parent: 927f8c0c33d4a7b37b391bd50b3cb2915ab050cf
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Thu Oct 16 14:12:00 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Thu Oct 16 14:12:00 2014 +0200
[test] fence_ilo_ssh: Add required parameter for testing --delay
---
fence/agents/ilo_ssh/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fence/agents/ilo_ssh/Makefile.am b/fence/agents/ilo_ssh/Makefile.am
index 3605e3c..dff0e6a 100644
--- a/fence/agents/ilo_ssh/Makefile.am
+++ b/fence/agents/ilo_ssh/Makefile.am
@@ -10,7 +10,7 @@ sbin_SCRIPTS = $(TARGET)
man_MANS = $(TARGET).8
-FENCE_TEST_ARGS = -p test -a test
+FENCE_TEST_ARGS = -p test -a test -l test
include $(top_srcdir)/make/fencebuild.mk
include $(top_srcdir)/make/fenceman.mk
9 years, 6 months
fence-agents: master - fence_rhevm: Add support for cookies based authentication
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=927f8c...
Commit: 927f8c0c33d4a7b37b391bd50b3cb2915ab050cf
Parent: 43b6d69fe0ae104c7aecb2cbb8f7caba3091165c
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Wed Oct 15 14:22:07 2014 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Wed Oct 15 14:22:07 2014 +0200
fence_rhevm: Add support for cookies based authentication
The first command is authenticated as usually but rest can be used without additional authentication.
This is useful only for reboot or obtaining status of several nodes at once.
---
fence/agents/rhevm/fence_rhevm.py | 34 ++++++++++++++++++++++++++++++----
1 files changed, 30 insertions(+), 4 deletions(-)
diff --git a/fence/agents/rhevm/fence_rhevm.py b/fence/agents/rhevm/fence_rhevm.py
index 1002097..e47f58e 100644
--- a/fence/agents/rhevm/fence_rhevm.py
+++ b/fence/agents/rhevm/fence_rhevm.py
@@ -87,9 +87,16 @@ def send_command(opt, command, method="GET"):
conn = pycurl.Curl()
web_buffer = StringIO.StringIO()
conn.setopt(pycurl.URL, url)
- conn.setopt(pycurl.HTTPHEADER, ["Content-type: application/xml", "Accept: application/xml"])
- conn.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC)
- conn.setopt(pycurl.USERPWD, opt["--username"] + ":" + opt["--password"])
+ conn.setopt(pycurl.HTTPHEADER, ["Content-type: application/xml", "Accept: application/xml", "Prefer: persistent-auth"])
+
+ if opt.has_key("cookie"):
+ conn.setopt(pycurl.COOKIE, opt["cookie"])
+ else:
+ conn.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_BASIC)
+ conn.setopt(pycurl.USERPWD, opt["--username"] + ":" + opt["--password"])
+ if opt.has_key("--use-cookies"):
+ conn.setopt(pycurl.COOKIEFILE, "")
+
conn.setopt(pycurl.TIMEOUT, int(opt["--shell-timeout"]))
if opt.has_key("--ssl") or opt.has_key("--ssl-secure"):
conn.setopt(pycurl.SSL_VERIFYPEER, 1)
@@ -104,6 +111,15 @@ def send_command(opt, command, method="GET"):
conn.setopt(pycurl.WRITEFUNCTION, web_buffer.write)
conn.perform()
+
+ if not opt.has_key("cookie") and opt.has_key("--use-cookies"):
+ cookie = ""
+ for c in conn.getinfo(pycurl.INFO_COOKIELIST):
+ tokens = c.split("\t",7)
+ cookie = cookie + tokens[5] + "=" + tokens[6] + ";"
+
+ opt["cookie"] = cookie
+
result = web_buffer.getvalue()
logging.debug("%s\n", command)
@@ -111,10 +127,20 @@ def send_command(opt, command, method="GET"):
return result
+def define_new_opts():
+ all_opt["use_cookies"] = {
+ "getopt" : "s",
+ "longopt" : "use-cookies",
+ "help" : "--use-cookies Reuse cookies for authentication",
+ "required" : "0",
+ "shortdesc" : "Reuse cookies for authentication",
+ "order" : 1}
+
def main():
- device_opt = ["ipaddr", "login", "passwd", "ssl", "notls", "web", "port"]
+ device_opt = ["ipaddr", "login", "passwd", "ssl", "notls", "web", "port", "use_cookies" ]
atexit.register(atexit_handler)
+ define_new_opts()
all_opt["power_wait"]["default"] = "1"
9 years, 6 months