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

Anne Mulhern amulhern at redhat.com
Thu Oct 30 14:23:13 UTC 2014





----- Original Message -----
> From: "Vratislav Podzimek" <vpodzime at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Thursday, October 30, 2014 9:08:14 AM
> Subject: Re: [blivet][rhel7-branch] Pass a list of string items to	log_method_return. (#1155984)
> 
> On Thu, 2014-10-30 at 08:11 -0400, 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.
> To be consistent with something that makes storage.log really, really
> hard to use for debugging because it is full of "full-fat"
> representations of tons of objects? I like the idea of putting names in
> the log instead.
> 
> --
> Vratislav Podzimek
> 
> Anaconda Rider | RHCE | Red Hat, Inc. | Brno - Czech Republic
> 
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

__str__ representations of devices are just one line.

- mulhern






More information about the anaconda-patches mailing list