fence-agents: master - [cleanup] Replace vmware_log() with direct call of logging

Marek GrĂ¡c marx at fedoraproject.org
Wed Apr 16 13:05:18 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=6687842cd2bd608555efd2bc624c68c0250c6ef4
Commit:        6687842cd2bd608555efd2bc624c68c0250c6ef4
Parent:        40083240dfc96073905b7a42222111c7637a0feb
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Mon Apr 14 15:46:24 2014 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Wed Apr 16 14:50:46 2014 +0200

[cleanup] Replace vmware_log() with direct call of logging

---
 fence/agents/vmware/fence_vmware.py |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py
index 4576f40..00e7632 100644
--- a/fence/agents/vmware/fence_vmware.py
+++ b/fence/agents/vmware/fence_vmware.py
@@ -137,10 +137,6 @@ def vmware_prepare_command(options, add_login_params, additional_params):
 
 	return res
 
-# Log message if user set verbose option
-def vmware_log(options, message):
-	logging.debug("%s\n" % message)
-
 # Run command with timeout and parameters. Internaly uses vmware_prepare_command. Returns string
 # with output from vmrun command. If something fails (command not found, exit code is not 0), fail_usage
 # function is called (and never return).
@@ -148,7 +144,7 @@ def vmware_run_command(options, add_login_params, additional_params, additional_
 	command = vmware_prepare_command(options, add_login_params, additional_params)
 
 	try:
-		vmware_log(options, command)
+		logging.debug("%s\n" % command)
 
 		(res_output, res_code) = pexpect.run(command,
 				int(options["--shell-timeout"]) + int(options["--login-timeout"]) + additional_timeout, True)
@@ -156,10 +152,10 @@ def vmware_run_command(options, add_login_params, additional_params, additional_
 		if res_code == None:
 			fail(EC_TIMED_OUT)
 		if res_code != 0 and add_login_params:
-			vmware_log(options, res_output)
+			logging.debug("%s\n" % res_output)
 			fail_usage("%s returned %s"% (options["--exec"], res_output))
 		else:
-			vmware_log(options, res_output)
+			logging.debug("%s\n" % res_output)
 
 	except pexpect.ExceptionPexpect:
 		fail_usage("Cannot run command %s"% (options["--exec"]))


More information about the cluster-commits mailing list