[rhel6-branch] Keep track of whether users should be prompted to format CDL dasds. (#1164240)

Anne Mulhern amulhern at redhat.com
Tue Mar 10 15:49:35 UTC 2015





----- Original Message -----
> From: "Samantha N. Bueno" <sbueno+anaconda at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Tuesday, March 10, 2015 11:10:37 AM
> Subject: Re: [rhel6-branch] Keep track of whether users should be prompted to	format CDL dasds. (#1164240)
> 
> On Mon, Mar 09, 2015 at 08:47:03AM -0400, Anne Mulhern wrote:
> > 
> > Could easily make that whole chunk of code shorter instead of longer,
> > in order to solve problem, something like:
> > 
> > if not intf and not zeroMbr and not cdl:
> >     log.info(...)
> >     sys.exit(0)
> > 
> > # now onto formatting...
> > if not len(self._dasdlist):
> >     log.info...
> > else:
> >     self.format_dasds(intf, not zeroMbr, self._dasdlist)
> > 
> > if not...
> >     log.info...
> > else:
> >     self.format_dasds(intf, not cdl, self._ldldasdlist)
> 
> Yeah that's true, so:
> 
> diff --git a/storage/dasd.py b/storage/dasd.py
> index 17f81bd..b73badf 100644
> --- a/storage/dasd.py
> +++ b/storage/dasd.py
> @@ -105,12 +105,9 @@ class DASD:
>                                                                           bypath))
>                  self._ldldasdlist.append((device, bypath))
>  
> -        askUser = True
> -
> -        if zeroMbr or cdl:
> -            askUser = False
> -        elif not intf and not zeroMbr:
> +        if not intf and (not zeroMbr or not cdl):

This is a change from the original patch, but it looks like it's what you'ld want,
so I suspect it's a change for the better.

>              log.info("    non-interactive kickstart install without zerombr
>              "
> +                     "or clearpart --cdl "
>                       "command, unable to run dasdfmt, exiting installer")
>              sys.exit(0)
>  
> @@ -118,12 +115,12 @@ class DASD:
>          if not len(self._dasdlist):
>              log.info("    no unformatted DASD devices found")
>          else:
> -            self.format_dasds(intf, askUser, self._dasdlist)
> +            self.format_dasds(intf, not zeroMbr, self._dasdlist)
>  
>          if not len(self._ldldasdlist):
>              log.info("    no LDL DASD devices found")
>          else:
> -            self.format_dasds(intf, askUser, self._ldldasdlist)
> +            self.format_dasds(intf, not cdl, self._ldldasdlist)
>  
>      def format_dasds(self, intf, askUser, dasdlist):
>          """ Iterate through a given list of DASDs and run dasdfmt on them.
>          """
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Looks good to me.

- mulhern


More information about the anaconda-patches mailing list