summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-07-07 01:57:59 -0400
committerJoey Hess2014-07-07 01:57:59 -0400
commit593043515fecb28d4a55d51515eea9fbb69bc05e (patch)
tree161053fb81cf8b7c706cb196c86ba7d9d662474b /src/Propellor/CmdLine.hs
parenta0fb0f99284a077e0179bdefc828fa0c39304f9f (diff)
propellor spin
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index 448e70d2..bc5421e7 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -92,7 +92,7 @@ defaultMain hostlist = do
go False (Boot hn) = onlyProcess $ withhost hn boot
withhost :: HostName -> (Host -> IO ()) -> IO ()
- withhost hn a = maybe (unknownhost hn) a (findHost hostlist hn)
+ withhost hn a = maybe (unknownhost hn hostlist) a (findHost hostlist hn)
onlyProcess :: IO a -> IO a
onlyProcess a = bracket lock unlock (const a)
@@ -106,11 +106,12 @@ onlyProcess a = bracket lock unlock (const a)
alreadyrunning = error "Propellor is already running on this host!"
lockfile = localdir </> ".lock"
-unknownhost :: HostName -> IO a
-unknownhost h = errorMessage $ unlines
+unknownhost :: HostName -> [Host] -> IO a
+unknownhost h hosts = errorMessage $ unlines
[ "Propellor does not know about host: " ++ h
, "(Perhaps you should specify the real hostname on the command line?)"
, "(Or, edit propellor's config.hs to configure this host)"
+ , "Known hosts: " ++ unwords (map hostName hosts)
]
buildFirst :: CmdLine -> IO () -> IO ()