From 0ac69c084da0192559ffc063b77b4616010516f8 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 5 Nov 2018 19:50:56 -0700 Subject: libvirt: don't try to nuke if it is already nuked --- src/Propellor/Property/Libvirt.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Propellor/Property') 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 -- cgit v1.2.3