[blivet][rhel7-branch] Fix up some logging methods. (#1155984)

David Lehman dlehman at redhat.com
Tue Jun 9 20:05:49 UTC 2015


On 06/08/2015 07:50 AM, Samantha N. Bueno wrote:
> (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)

Does this give a noticeable speedup? It is going to significantly reduce
my ability to debug problems using storage.log.

David

>           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):
>



More information about the anaconda-patches mailing list