[blivet][rhel7-branch] Fix up some logging methods. (#1155984)
Samantha N. Bueno
sbueno+anaconda at redhat.com
Mon Jun 8 12:50:53 UTC 2015
(Should be no anaconda changes with this version; old had the subject
"Remove a few lookup methods in blivet". This doesn't make custom part
with many disks as fast as it was in 7.0, but it helps quite a bit.)
Some small adjustments to a couple logging methods to help reduce the
verbosity, which can cause some lag when e.g. scanning disks if you have
a significant number of them on your system.
Resolves: rhbz#1155984
---
blivet/devicetree.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 9f1aa9e..73b6f79 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -1111,7 +1111,7 @@ class DeviceTree(object):
def addUdevDevice(self, info):
name = udev.device_get_name(info)
- log_method_call(self, name=name, info=pprint.pformat(info))
+ log_method_call(self, name=name)
uuid = udev.device_get_uuid(info)
sysfs_path = udev.device_get_sysfs_path(info)
@@ -1227,7 +1227,7 @@ class DeviceTree(object):
if parent.name not in self.exclusiveDisks:
self.exclusiveDisks.append(parent.name)
- log.info("got device: %r", device)
+ log.info("got device: %r", device.name)
# now handle the device's formatting
self.handleUdevDeviceFormat(info, device)
@@ -2337,7 +2337,8 @@ class DeviceTree(object):
result = next((d for d in devices if d.name == name or \
((d.type == "lvmlv" or d.type == "lvmvg") and d.name == name.replace("--","-"))),
None)
- log_method_return(self, result)
+
+ log_method_return(self, getattr(result, "name", None))
return result
def getDeviceByPath(self, path, incomplete=False, hidden=False):
--
1.9.3
More information about the anaconda-patches
mailing list