From b9d2fcc432da003e2c6054a0d6bcbd7eb8457cf0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 13 Apr 2014 12:57:35 -0400 Subject: propellor spin --- Propellor/PrivData.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Propellor/PrivData.hs') 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) -- cgit v1.2.3