cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Marek 'marx' Grac <mgrac@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 06/15] [cleanup] Remove problems with redefining variables/functions
Date: Wed,  2 Apr 2014 13:52:14 +0200	[thread overview]
Message-ID: <1396439543-29533-6-git-send-email-mgrac@redhat.com> (raw)
In-Reply-To: <1396439543-29533-1-git-send-email-mgrac@redhat.com>

---
 fence/agents/eps/fence_eps.py       |  4 ++--
 fence/agents/ifmib/fence_ifmib.py   |  4 ++--
 fence/agents/ipdu/fence_ipdu.py     |  2 ++
 fence/agents/lib/fencing.py.py      | 11 +++--------
 fence/agents/vmware/fence_vmware.py |  4 ++--
 5 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/fence/agents/eps/fence_eps.py b/fence/agents/eps/fence_eps.py
index bd43e58..42e2be7 100644
--- a/fence/agents/eps/fence_eps.py
+++ b/fence/agents/eps/fence_eps.py
@@ -16,9 +16,9 @@ BUILD_DATE=""
 #END_VERSION_GENERATION
 
 # Log actions and results from EPS device
-def eps_log(options, str):
+def eps_log(options, text):
 	if options["log"] >= LOG_MODE_VERBOSE:
-		options["debug_fh"].write(str)
+		options["debug_fh"].write(text)
 
 # Run command on EPS device.
 # @param options Device options
diff --git a/fence/agents/ifmib/fence_ifmib.py b/fence/agents/ifmib/fence_ifmib.py
index e7d1fa5..1273b0e 100644
--- a/fence/agents/ifmib/fence_ifmib.py
+++ b/fence/agents/ifmib/fence_ifmib.py
@@ -85,10 +85,10 @@ def get_outlets_status(conn, options):
 	res_aliases = array_to_dict(conn.walk(ALIASES_OID, 30))
 
 	for x in res_fc:
-		port_num = x[0].split('.')[-1]
+		port_number = x[0].split('.')[-1]
 
 		port_name = x[1].strip('"')
-		port_alias = (res_aliases.has_key(port_num) and res_aliases[port_num].strip('"') or "")
+		port_alias = (res_aliases.has_key(port_number) and res_aliases[port_number].strip('"') or "")
 		port_status = ""
 		result[port_name] = (port_alias, port_status)
 
diff --git a/fence/agents/ipdu/fence_ipdu.py b/fence/agents/ipdu/fence_ipdu.py
index b90a333..c1fc368 100644
--- a/fence/agents/ipdu/fence_ipdu.py
+++ b/fence/agents/ipdu/fence_ipdu.py
@@ -126,6 +126,8 @@ def get_outlets_status(conn, options):
 
 # Main agent method
 def main():
+	global device
+
 	device_opt = [ "ipaddr", "login", "passwd", "no_login", "no_password", \
 		       "port", "snmp_version", "community" ]
 
diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index a713dc8..6aab45b 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -408,11 +408,6 @@ def add_dependency_options(options):
 			added_opt.extend([y for y in DEPENDENCY_OPT[x] if options.count(y) == 0])
 	return added_opt
 
-def version(command, release, build_date, copyright_notice):
-	print command, " ", release, " ", build_date
-	if len(copyright_notice) > 0:
-		print copyright_notice
-
 def fail_usage(message = ""):
 	if len(message) > 0:
 		sys.stderr.write(message+"\n")
@@ -757,10 +752,10 @@ def check_input(device_opt, opt):
 
 	for opt in device_opt:
 		if all_opt[opt].has_key("choices"):
-			long = "--" + all_opt[opt]["longopt"]
+			longopt = "--" + all_opt[opt]["longopt"]
 			possible_values_upper = map (lambda y : y.upper(), all_opt[opt]["choices"])
-			if options.has_key(long):
-				options[long] = options[long].upper()
+			if options.has_key(longopt):
+				options[longopt] = options[longopt].upper()
 				if not options["--" + all_opt[opt]["longopt"]] in possible_values_upper:
 					fail_usage("Failed: You have to enter a valid choice " + \
 							"for %s from the valid values: %s" % \
diff --git a/fence/agents/vmware/fence_vmware.py b/fence/agents/vmware/fence_vmware.py
index f278698..f0f6023 100644
--- a/fence/agents/vmware/fence_vmware.py
+++ b/fence/agents/vmware/fence_vmware.py
@@ -94,10 +94,10 @@ def dsv_split(dsv_str):
 
 # Quote string for proper existence in quoted string used for pexpect.run function
 # Ex. test'this will return test'\''this. So pexpect run will really pass ' to argument
-def quote_for_run(str):
+def quote_for_run(text):
 	dstr = ''
 
-	for c in str:
+	for c in text:
 		if c == r"'":
 			dstr += "'\\''"
 		else:
-- 
1.9.0



  parent reply	other threads:[~2014-04-02 11:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-02 11:52 [Cluster-devel] [PATCH 01/15] [cleanup] Add missing spaces and fix tab/spaces indentation Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 02/15] [cleanup] Proper import of atexit Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 03/15] [cleanup] Remove unused variables Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 04/15] [cleanup] Split lines that were too long Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 05/15] [cleanup] Remove unused dependencies Marek 'marx' Grac
2014-04-02 11:52 ` Marek 'marx' Grac [this message]
2014-04-02 11:52 ` [Cluster-devel] [PATCH 07/15] [cleanup] Only symbols that should be used are exported from fencing library Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 08/15] [cleanup] Mark raw strings with r"" Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 09/15] [cleanup] Only symbols that should be used are exported from fencing_snmp library Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 10/15] [cleanup] Errors when encountering mixed space/tab in python Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 11/15] [cleanup] Mark raw strings with r"" in fence_virsh Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 12/15] [cleanup] Remove snmp_define_defaults() Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 13/15] [cleanup] Remove unused arguments Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 14/15] [cleanup] Remove transfer script used in transition 3.x->4.x Marek 'marx' Grac
2014-04-02 11:52 ` [Cluster-devel] [PATCH 15/15] [cleanup] Fix invalid names of variables Marek 'marx' Grac

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1396439543-29533-6-git-send-email-mgrac@redhat.com \
    --to=mgrac@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).