summaryrefslogtreecommitdiff
path: root/src/Propellor
diff options
context:
space:
mode:
authorJoey Hess2015-04-29 14:26:13 -0400
committerJoey Hess2015-04-29 14:26:13 -0400
commit681e4dbbcb880e8e2526519fc58d4f2994a41577 (patch)
tree58f0951f6fc4fc7c534b7c293592386b7575164a /src/Propellor
parent960745b95e96e3d276e275554584c9bd13565f5b (diff)
propellor spin
Diffstat (limited to 'src/Propellor')
-rw-r--r--src/Propellor/Engine.hs1
-rw-r--r--src/Propellor/Exception.hs8
-rw-r--r--src/Propellor/Property/Debootstrap.hs1
-rw-r--r--src/Propellor/Spin.hs3
-rw-r--r--src/Propellor/Types.hs6
5 files changed, 9 insertions, 10 deletions
diff --git a/src/Propellor/Engine.hs b/src/Propellor/Engine.hs
index 99f1660d..dd3d4653 100644
--- a/src/Propellor/Engine.hs
+++ b/src/Propellor/Engine.hs
@@ -17,7 +17,6 @@ import Data.Monoid
import Control.Applicative
import System.Console.ANSI
import "mtl" Control.Monad.RWS.Strict
-import Control.Exception (bracket)
import System.PosixCompat
import System.Posix.IO
import System.FilePath
diff --git a/src/Propellor/Exception.hs b/src/Propellor/Exception.hs
index f6fd15f1..2b38af0c 100644
--- a/src/Propellor/Exception.hs
+++ b/src/Propellor/Exception.hs
@@ -2,11 +2,11 @@
module Propellor.Exception where
-import qualified "MonadCatchIO-transformers" Control.Monad.CatchIO as M
-import Control.Exception
-
import Propellor.Types
import Propellor.Message
+import Utility.Exception
+
+import Control.Exception (IOException)
-- | Catches IO exceptions and returns FailedChange.
catchPropellor :: Propellor Result -> Propellor Result
@@ -15,4 +15,4 @@ catchPropellor a = either err return =<< tryPropellor a
err e = warningMessage (show e) >> return FailedChange
tryPropellor :: Propellor a -> Propellor (Either IOException a)
-tryPropellor = M.try
+tryPropellor = try
diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs
index d4947ab7..5d6a8bed 100644
--- a/src/Propellor/Property/Debootstrap.hs
+++ b/src/Propellor/Property/Debootstrap.hs
@@ -20,7 +20,6 @@ import Utility.FileMode
import Data.List
import Data.Char
-import Control.Exception
import System.Posix.Directory
import System.Posix.Files
diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs
index f55f2977..986305d7 100644
--- a/src/Propellor/Spin.hs
+++ b/src/Propellor/Spin.hs
@@ -12,7 +12,6 @@ import System.PosixCompat
import System.Posix.IO
import System.Posix.Directory
import Control.Concurrent.Async
-import Control.Exception (bracket)
import qualified Data.ByteString as B
import qualified Data.Set as S
import qualified Network.BSD as BSD
@@ -168,7 +167,7 @@ updateServer
-> CreateProcess
-> IO ()
updateServer target relay hst connect haveprecompiled =
- withBothHandles createProcessSuccess connect go
+ withIOHandles createProcessSuccess connect go
where
hn = fromMaybe target relay
relaying = relay == Just target
diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs
index ba63cf9d..474385b7 100644
--- a/src/Propellor/Types.hs
+++ b/src/Propellor/Types.hs
@@ -40,7 +40,7 @@ module Propellor.Types
import Data.Monoid
import Control.Applicative
import "mtl" Control.Monad.RWS.Strict
-import "MonadCatchIO-transformers" Control.Monad.CatchIO
+import Control.Monad.Catch
import qualified Data.Set as S
import qualified Data.Map as M
@@ -73,7 +73,9 @@ newtype Propellor p = Propellor { runWithHost :: RWST Host [EndAction] () IO p }
, MonadReader Host
, MonadWriter [EndAction]
, MonadIO
- , MonadCatchIO
+ , MonadCatch
+ , MonadThrow
+ , MonadMask
)
instance Monoid (Propellor Result) where