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

Vratislav Podzimek vpodzime at redhat.com
Thu Sep 11 08:57:05 UTC 2014


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



More information about the anaconda-patches mailing list