[PATCH] Tell lvcreate not to ask us any questions and do its job. (#1057066)

Anne Mulhern amulhern at redhat.com
Thu Jan 23 22:10:33 UTC 2014





----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Thursday, January 23, 2014 4:12:04 PM
> Subject: [PATCH] Tell lvcreate not to ask us any questions and do its job.	(#1057066)
> 
> Specifically, new functionality prompts the user whether or not they
> would like to wipe detected metadata when creating a new lv. This
> tells it to go ahead instead of asking.
> 
> This is a global setting for lvcreate, but I think we really do want
> to create the new lv in any case, regardless of what lvm might think
> we should stop and talk about first.
> ---
>  blivet/devicelibs/lvm.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/blivet/devicelibs/lvm.py b/blivet/devicelibs/lvm.py
> index 6f4bab2..342b70a 100644
> --- a/blivet/devicelibs/lvm.py
> +++ b/blivet/devicelibs/lvm.py
> @@ -409,7 +409,7 @@ def lvorigin(vg_name, lv_name):
>  def lvcreate(vg_name, lv_name, size, pvs=[]):
>      args = ["lvcreate"] + \
>              ["-L", "%dm" % size.convertTo(spec="mib")] + \
> -            ["-n", lv_name] + \
> +            ["-y", "-n", lv_name] + \
>              _getConfigArgs() + \
>              [vg_name] + pvs
>  
> --
> 1.8.5.3
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

One tiny thing: Possibly the -y should go on a separate line, otherwise ['-y', '-n'] briefly ends up looking like maybe.

One major thing: How do you ensure that you're running the newer version of lvcreate which requires this flag, so you don't get
a parsing error w/ older versions?

- mulhern


More information about the anaconda-patches mailing list