[blivet:master 23/25] Rename to avoid conflict with name in outer scope.
mulhern
amulhern at redhat.com
Wed Apr 16 21:54:44 UTC 2014
All these names are method-local.
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/__init__.py | 6 +++---
blivet/arch.py | 6 +++---
blivet/devicelibs/lvm.py | 6 +++---
blivet/pyudev.py | 6 +++---
blivet/util.py | 8 ++++----
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index ceedbdf..0cb2ba8 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -3080,17 +3080,17 @@ def findExistingInstallations(devicetree):
continue
try:
- (arch, product, version) = getReleaseString()
+ (architecture, product, version) = getReleaseString()
except ValueError:
name = _("Linux on %s") % device.name
else:
# I'd like to make this finer grained, but it'd be very difficult
# to translate.
- if not product or not version or not arch:
+ if not product or not version or not architecture:
name = _("Unknown Linux")
else:
name = _("%(product)s Linux %(version)s for %(arch)s") % \
- {"product": product, "version": version, "arch": arch}
+ {"product": product, "version": version, "arch": architecture}
(mounts, swaps) = parseFSTab(devicetree, chroot=ROOT_PATH)
device.teardown()
diff --git a/blivet/arch.py b/blivet/arch.py
index f4dd23e..34586e3 100644
--- a/blivet/arch.py
+++ b/blivet/arch.py
@@ -358,13 +358,13 @@ def bits():
"""
try:
import platform
- bits = platform.architecture()[0]
+ nbits = platform.architecture()[0]
# the string is in the format:
# "<number>bit"
# so we remove the bit suffix and convert the
# number to an integer
- (bits, _rest) = bits.split("bit", 1)
- return int(bits)
+ (nbits, _rest) = nbits.split("bit", 1)
+ return int(nbits)
except Exception as e:
log.error("architecture word size detection failed: %s", e)
return None
diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
index d9de56c..e12cfb2 100644
--- a/blivet/devicelibs/lvm.py
+++ b/blivet/devicelibs/lvm.py
@@ -433,7 +433,7 @@ def lvs(vg_name=None):
args.append(vg_name)
buf = util.capture_output(["lvm"] + args)
- lvs = {}
+ logvols = {}
for line in buf.splitlines():
info = parse_lvm_vars(line)
if len(info.keys()) != 6:
@@ -441,9 +441,9 @@ def lvs(vg_name=None):
continue
lv_name = "%s-%s" % (info["LVM2_VG_NAME"], info["LVM2_LV_NAME"])
- lvs[lv_name] = info
+ logvols[lv_name] = info
- return lvs
+ return logvols
def lvorigin(vg_name, lv_name):
args = ["lvs", "--noheadings", "-o", "origin"] + \
diff --git a/blivet/pyudev.py b/blivet/pyudev.py
index d57c8a9..a799bce 100644
--- a/blivet/pyudev.py
+++ b/blivet/pyudev.py
@@ -26,11 +26,11 @@ def find_library(name, somajor=0):
def get_library():
name = "udev"
somajor = 1
- libudev = find_library(name=name, somajor=somajor)
+ lib = find_library(name=name, somajor=somajor)
- if not libudev or not os.path.exists(libudev):
+ if not lib or not os.path.exists(lib):
raise ImportError("No library named %s.%d" % (name, somajor))
- return libudev
+ return lib
# load the udev library
libudev = CDLL(get_library())
diff --git a/blivet/util.py b/blivet/util.py
index abef824..d2125df 100644
--- a/blivet/util.py
+++ b/blivet/util.py
@@ -91,9 +91,9 @@ def get_mount_paths(dev):
""" Given a device node path, return a list of all active mountpoints. """
mounts = open("/proc/mounts").readlines()
mount_paths = []
- for mount in mounts:
+ for mnt in mounts:
try:
- (device, path, _rest) = mount.split(None, 2)
+ (device, path, _rest) = mnt.split(None, 2)
except ValueError:
continue
@@ -108,9 +108,9 @@ def get_mount_device(mountpoint):
""" Given a mountpoint, return the device node path mounted there. """
mounts = open("/proc/mounts").readlines()
mount_device = None
- for mount in mounts:
+ for mnt in mounts:
try:
- (device, path, _rest) = mount.split(None, 2)
+ (device, path, _rest) = mnt.split(None, 2)
except ValueError:
continue
--
1.8.3.1
More information about the anaconda-patches
mailing list