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

Re: [PATCH] Override previously defined mountpoints in kickstart (#499746).



On Mon, 2009-05-11 at 10:07 -0400, Chris Lumens wrote:
> ---
>  kickstart.py |   27 +++++++++++++++++++++++++++
>  1 files changed, 27 insertions(+), 0 deletions(-)

Looks okay to me.

> 
> diff --git a/kickstart.py b/kickstart.py
> index a95762e..eb79bd9 100644
> --- a/kickstart.py
> +++ b/kickstart.py
> @@ -424,6 +424,15 @@ class LogVol(commands.logvol.F9_LogVol):
>  
>              devicetree.registerAction(ActionCreateFormat(device, format))
>          else:
> +            # If a previous device has claimed this mount point, delete the
> +            # old one.
> +            try:
> +                if format.mountpoint:
> +                    device = storage.fsset.mountpoints[format.mountpoint]
> +                    storage.destroyDevice(device)
> +            except KeyError:
> +                pass
> +
>              request = storage.newLV(format=format,
>                                      name=lvd.name,
>                                      vg=vg,
> @@ -663,6 +672,15 @@ class Partition(commands.partition.F9_Partition):
>  
>              devicetree.registerAction(ActionCreateFormat(device, kwargs["format"]))
>          else:
> +            # If a previous device has claimed this mount point, delete the
> +            # old one.
> +            try:
> +                if pd.mountpoint:
> +                    device = storage.fsset.mountpoints[pd.mountpoint]
> +                    storage.destroyDevice(device)
> +            except KeyError:
> +                pass
> +
>              request = storage.newPartition(**kwargs)
>  
>              # FIXME: no way to specify an fsprofile right now
> @@ -790,6 +808,15 @@ class Raid(commands.raid.F9_Raid):
>  
>              devicetree.registerAction(ActionCreateFormat(device, kwargs["format"]))
>          else:
> +            # If a previous device has claimed this mount point, delete the
> +            # old one.
> +            try:
> +                if rd.mountpoint:
> +                    device = storage.fsset.mountpoints[rd.mountpoint]
> +                    storage.destroyDevice(device)
> +            except KeyError:
> +                pass
> +
>              request = storage.newMDArray(**kwargs)
>  
>              # FIXME: no way to specify an fsprofile right now


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