fence-agents: master - vmware_soap: drop warning from python suds when error occours

Fabio M. Di Nitto fabbione at fedoraproject.org
Wed Feb 26 08:37:52 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=c360d3eecf6f9976d3371090034d08d03000f0e1
Commit:        c360d3eecf6f9976d3371090034d08d03000f0e1
Parent:        6bb1f3363e3856c1d95e21b25d380ca651eeeb1b
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Wed Feb 26 09:34:35 2014 +0100
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Wed Feb 26 09:34:35 2014 +0100

vmware_soap: drop warning from python suds when error occours

prepatch:
fence_vmware_soap -z -l test -p wrongpasswd -a blabla -n vm1 -o reboot -v
No handlers could be found for logger "suds.client"
Failed: The user does not have the correct privileges to do the requested action.

postpatch:
fence_vmware_soap -z -l test -p wrongpassed -a blabla -n vm1 -o reboot -v
Failed: The user does not have the correct privileges to do the requested action.

Based on https://fedorahosted.org/suds/wiki/Documentation
logging must be configured and filter for CRITICAL since the harmless
error is at INFO level.

Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 fence/agents/vmware_soap/fence_vmware_soap.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fence/agents/vmware_soap/fence_vmware_soap.py b/fence/agents/vmware_soap/fence_vmware_soap.py
index 400e81f..c73a1d6 100644
--- a/fence/agents/vmware_soap/fence_vmware_soap.py
+++ b/fence/agents/vmware_soap/fence_vmware_soap.py
@@ -2,6 +2,7 @@
 
 import sys, exceptions, time
 import shutil, tempfile, suds
+import logging
 sys.path.append("@FENCEAGENTSLIBDIR@")
 
 from suds.client import Client
@@ -199,6 +200,9 @@ Alternatively you can always use UUID to access virtual machine."
 	docs["vendorurl"] = "http://www.vmware.com"
 	show_docs(options, docs)
 
+	logging.basicConfig(level=logging.INFO)
+	logging.getLogger('suds.client').setLevel(logging.CRITICAL)
+
 	##
 	## Operate the fencing device
 	####


More information about the cluster-commits mailing list