Re: [PATCH] (take III/^#!@*?) Use existing partitions when --onpart is used for PVs (#493065)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Store mapping from pv names used in ks (e.g. pv.1) to existing
> partitions in ks handler and use it when processing ks commands
> referring to the names.
> Also fix some attribute references.
> ---
>  kickstart.py |   16 +++++++++++-----
>  1 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/kickstart.py b/kickstart.py
> index 844e58c..01e7b0d 100644
> --- a/kickstart.py
> +++ b/kickstart.py
> @@ -619,6 +619,9 @@ class Partition(commands.partition.F9_Partition):
>              if devicetree.getDeviceByName(kwargs["name"]):
>                  raise KickstartValueError, formatErrorMsg(self.lineno, msg="PV partition defined multiple times")
>  
> +            # store mapping for other ks partitioning commands
> +            if pd.onPart:
> +                self.handler.onPart[kwargs["name"]] = pd.onPart
>              pd.mountpoint = ""
>          elif pd.mountpoint == "/boot/efi":
>              type = "EFI System Partition"
> @@ -879,6 +882,8 @@ class VolGroup(commands.volgroup.FC3_VolGroup):
>  
>          # Get a list of all the physical volume devices that make up this VG.
>          for pv in vgd.physvols:
> +            # if pv is using --onpart, use original device
> +            pv = self.handler.onPart.get(pv, pv)
>              dev = devicetree.getDeviceByName(pv)
>              if not dev:
>                  raise KickstartValueError, formatErrorMsg(self.lineno, msg="Tried to use undefined partition %s in Volume Group specification" % pv)

I think you are on the right track here.  I wonder if we will need
similar mappings for when we use --useexisting on the logvol or raid
commands.  I don't think so, but I have not been able to convince myself
of that.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux