[blivet:rhel7-master 3/3] Condense and comment sanitize_dasd_dev_input (#1070115)

Anne Mulhern amulhern at redhat.com
Thu Sep 11 12:17:35 UTC 2014





----- Original Message -----
> From: "Vratislav Podzimek" <vpodzime at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Thursday, September 11, 2014 4:57:05 AM
> Subject: Re: [blivet:rhel7-master 3/3] Condense and comment	sanitize_dasd_dev_input (#1070115)
> 
> On Mon, 2014-09-08 at 13:27 -0400, mulhern wrote:
> > Related: rhbz#1070115
> > 
> > Signed-off-by: mulhern <amulhern at redhat.com>
> > ---
> >  blivet/devicelibs/dasd.py | 28 +++++++++++++++++-----------
> >  1 file changed, 17 insertions(+), 11 deletions(-)
> > 
> > diff --git a/blivet/devicelibs/dasd.py b/blivet/devicelibs/dasd.py
> > index b558fef..b24add7 100644
> > --- a/blivet/devicelibs/dasd.py
> > +++ b/blivet/devicelibs/dasd.py
> > @@ -109,22 +109,28 @@ def dasd_needs_format(dasd):
> >      return False
> >  
> >  def sanitize_dasd_dev_input(dev):
> > -    """ Given a user-supplied device number, make sure the input is sane,
> > and
> > -        raise an error if it is not.
> > +    """ Synthesizes a complete DASD number from a possibly partial one.
> >  
> > -    :param dev: string representing a DASD device number
> > +        :param str dev: string representing a DASD device number
> > +        :returns: a synthesized DASD device number
> > +        :rtype: str
> > +
> > +        :raises: ValueError if dev is None or empty
> > +
> > +        *) Assumes that the rightmost '.' if any, separates the bus number
> > +           from the device number.
> > +        *) Pads the device number on the left with 0s to a length of four
> > +           characters.
> > +        *) If no bus number extracted from dev, uses bus number default
> > 0.0.
> The ')'s should be dropped to make this a proper ReST bullet point list.
> 
> --
> Vratislav Podzimek
> 
> Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Yeah, generated docs would look prettier with just '*'s. I'll keep that in 
mind for the future.

- mulhern


More information about the anaconda-patches mailing list