[rhel6-branch] Fix dasdfmt progress bar. (#1210450)

Brian C. Lane bcl at redhat.com
Wed Nov 11 00:45:19 UTC 2015


On Tue, Nov 10, 2015 at 05:08:06PM -0500, Samantha N. Bueno wrote:
> On Mon, Nov 09, 2015 at 04:18:42PM -0500, Chris Lumens wrote:
> > > As a means of performance improvement, dasdfmt now defaults to formatting 10
> > > cylinders in one step instead of 01. However, this causes issues with updating
> > > the progress bar when dasdfmt is run. So, specify the old size of 01 cylinder
> > > formatted in each step. For more details on this dasdfmt feature, see bz1053828.
> > > 
> > > Resolves: rhbz#1210450
> > 
> > This'll slow dasd formatting speed back down though, right?  Do we
> > instead want to modify the progress bar side of things to expect updates
> > of ten cylinders at a time?
> 
> Ok, it turns out this was actually really simple to fix correctly after
> all, so, new patch is below:
> 
> ========
> 
> As a means of performance improvement, dasdfmt now defaults to formatting 10
> cylinders in one step instead of 01. However, this causes issues with updating
> the progress bar when dasdfmt is run. So, make a slight adjustment in our
> calculation of % formatted to accurately take into account the new dasdfmt
> changes. Previously we'd always add one to completedCylinders -- one per step.
> But now add 10 to completedCylinders -- 10 for each step.
> For more details on this dasdfmt feature, see bz1053828.
> 
> Resolves: rhbz#1210450
> ---
>  storage/dasd.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/storage/dasd.py b/storage/dasd.py
> index b73badf..f70ec11 100644
> --- a/storage/dasd.py
> +++ b/storage/dasd.py
> @@ -223,8 +223,8 @@ class DASD:
>              return
>  
>          if data == '\n':
> -            # each newline we see in this output means one more cylinder done
> -            self._completedCylinders += 1.0
> +            # each newline we see in this output means 10 more cylinders done
> +            self._completedCylinders += 10.0
>              callback_data.set(self._completedCylinders / self.totalCylinders)
>  
>  # Create DASD singleton
> -- 
> 2.4.3

I like that better. Ack :)

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list