[blivet][rhel7-branch] Pass a list of string items to log_method_return. (#1155984)

David Lehman dlehman at redhat.com
Thu Oct 30 14:42:48 UTC 2014


On 10/30/2014 07:11 AM, Anne Mulhern wrote:
>
>
>
>
> ----- Original Message -----
>> From: "Samantha N. Bueno" <sbueno+anaconda at redhat.com>
>> To: anaconda-patches at lists.fedorahosted.org
>> Sent: Wednesday, October 29, 2014 1:59:50 PM
>> Subject: [blivet][rhel7-branch] Pass a list of string items to	log_method_return. (#1155984)
>>
>> Otherwise there is some serious lagging in the UI when you select/de-select
>> a disk in the anaconda storage spoke.
>>
>> Resolves: rhbz#1155984
>> ---
>>   blivet/devicetree.py | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/blivet/devicetree.py b/blivet/devicetree.py
>> index a5310b7..8173e93 100644
>> --- a/blivet/devicetree.py
>> +++ b/blivet/devicetree.py
>> @@ -2298,7 +2298,7 @@ class DeviceTree(object):
>>                   continue
>>               if device.serial == serial:
>>                   retval.append(device)
>> -        log_method_return(self, retval)
>> +        log_method_return(self, [r.name for r in retval])
>>           return retval
>>
>>       def getDeviceByLabel(self, label, incomplete=False, hidden=False):
>> @@ -2376,7 +2376,7 @@ class DeviceTree(object):
>>           log_method_call(self, device_type=device_type,
>>           incomplete=incomplete, hidden=hidden)
>>           devices = self._filterDevices(incomplete=incomplete, hidden=hidden)
>>           result = [d for d in devices if d.type == device_type]
>> -        log_method_return(self, result)
>> +        log_method_return(self, [r.name for r in result])
>>           return result
>>
>>       def getDevicesByInstance(self, device_class, incomplete=False,
>>       hidden=False):
>> @@ -2391,7 +2391,7 @@ class DeviceTree(object):
>>           log_method_call(self, device_class=device_class,
>>           incomplete=incomplete, hidden=hidden)
>>           devices = self._filterDevices(incomplete=incomplete, hidden=hidden)
>>           result = [d for d in devices if isinstance(d, device_class)]
>> -        log_method_return(self, result)
>> +        log_method_return(self, [r.name for r in result])
>>           return result
>>
>>       def getDeviceByID(self, id_num, incomplete=False, hidden=False):
>> --
>> 1.9.3
>>
>> _______________________________________________
>> anaconda-patches mailing list
>> anaconda-patches at lists.fedorahosted.org
>> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>>
>
> Might be slightly better to use str(r) instead of r.name, to be consistent.

That was my first thought, too, but I think that we should do this in 
such a way as to require one reasonably short line per call to this 
method. Device names are more than enough for these methods IMO. After 
all, we didn't log the return values of by-instance or by-type until 
your patch from June and nobody expressed any bother about it for any 
reason other than that the code was not consistent in that way.

David
>
> Otherwise, ack, and thanks.
>
> - mulhern
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>



More information about the anaconda-patches mailing list