[PATCH] Don't apply action until after all checks have passed.
Anne Mulhern
amulhern at redhat.com
Thu Apr 24 16:47:06 UTC 2014
----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Thursday, April 24, 2014 12:07:43 PM
> Subject: [PATCH] Don't apply action until after all checks have passed.
>
> ---
> blivet/devicetree.py | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> index 731c448..1fe7d4b 100644
> --- a/blivet/devicetree.py
> +++ b/blivet/devicetree.py
> @@ -438,8 +438,6 @@ class DeviceTree(object):
> if action.device in self._devices:
> raise DeviceTreeError("device is already in the tree")
>
> - action.apply()
> -
> if action.isCreate and action.isDevice:
> self._addDevice(action.device)
> elif action.isDestroy and action.isDevice:
> @@ -449,6 +447,8 @@ class DeviceTree(object):
> action.device.format.mountpoint in self.filesystems:
> raise DeviceTreeError("mountpoint already in use")
>
> + # apply the action before adding it in case apply raises an
> exception
> + action.apply()
> log.info("registered action: %s", action)
> self._actions.append(action)
>
> --
> 1.9.0
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
>
Ack.
- mulhern
More information about the anaconda-patches
mailing list