summaryrefslogtreecommitdiff
path: root/Propellor/PrivData.hs
diff options
context:
space:
mode:
authorJoey Hess2014-04-13 12:57:35 -0400
committerJoey Hess2014-04-13 12:57:35 -0400
commitb9d2fcc432da003e2c6054a0d6bcbd7eb8457cf0 (patch)
tree20de81c148c279698ea22c04d54c69f4ca257293 /Propellor/PrivData.hs
parent8dd5cb92f8c8c88b1fb87710fa35fd33f68f8ed7 (diff)
propellor spin
Diffstat (limited to 'Propellor/PrivData.hs')
-rw-r--r--Propellor/PrivData.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/Propellor/PrivData.hs b/Propellor/PrivData.hs
index c7af1aac..ad2c8d22 100644
--- a/Propellor/PrivData.hs
+++ b/Propellor/PrivData.hs
@@ -8,6 +8,7 @@ import System.FilePath
import System.IO
import System.Directory
import Data.Maybe
+import Data.List
import Control.Monad
import "mtl" Control.Monad.Reader
@@ -30,9 +31,12 @@ withPrivData field a = maybe missing a =<< liftIO (getPrivData field)
where
missing = do
host <- getHostName
+ let host' = if ".docker" `isSuffixOf` host
+ then "$parent_host"
+ else host
liftIO $ do
warningMessage $ "Missing privdata " ++ show field
- putStrLn $ "Fix this by running: propellor --set "++host++" '" ++ show field ++ "'"
+ putStrLn $ "Fix this by running: propellor --set "++host'++" '" ++ show field ++ "'"
return FailedChange
getPrivData :: PrivDataField -> IO (Maybe String)