summaryrefslogtreecommitdiff
path: root/src/Propellor/Property/Libvirt.hs
diff options
context:
space:
mode:
authorSean Whitton2018-11-05 19:50:56 -0700
committerSean Whitton2018-11-05 19:50:56 -0700
commit0ac69c084da0192559ffc063b77b4616010516f8 (patch)
tree5e1404152777144280035505cff7a21d208ec368 /src/Propellor/Property/Libvirt.hs
parentc244c40ebdaedeb6d6640abf02f3d65eb87c98f1 (diff)
libvirt: don't try to nuke if it is already nuked
Diffstat (limited to 'src/Propellor/Property/Libvirt.hs')
-rw-r--r--src/Propellor/Property/Libvirt.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Propellor/Property/Libvirt.hs b/src/Propellor/Property/Libvirt.hs
index 000f56c4..eb586df6 100644
--- a/src/Propellor/Property/Libvirt.hs
+++ b/src/Propellor/Property/Libvirt.hs
@@ -94,10 +94,11 @@ kvmDefined imageType mem cpus auto h =
(setupRevertableProperty $ imageBuiltFor h
(image) (Debootstrapped mempty))
nuked :: Property UnixLike
- nuked = property "destroy the chroot used to build the image" $ do
+ nuked = check (not <$> doesDirectoryExist (imageLoc <.> "chroot"))
+ (property "destroy the chroot used to build the image" $ do
liftIO $ removeChroot (imageLoc <.> "chroot")
liftIO $ nukeFile (imageLoc <.> "parttable")
- return MadeChange
+ return MadeChange)
defined :: Property UnixLike
defined = check (not <$> doesFileExist conf)
(scriptProperty