summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
authorJoey Hess2015-10-20 14:45:11 -0400
committerJoey Hess2015-10-20 15:28:52 -0400
commit4e5048727e7316d4101be19d4f1e42d72d008adb (patch)
tree85b3282bf12d68e3af8e847cef535008bc575a05 /src/Propellor/PrivData.hs
parent4c0b1f6e643882f43ac936b6bfdee78593ebc1d5 (diff)
privdata propigation for Spin.controller
Controlling host inherits the privdata for the host it spins, and sends it along to that host.
Diffstat (limited to 'src/Propellor/PrivData.hs')
-rw-r--r--src/Propellor/PrivData.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index fd790878..070070f0 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -16,6 +16,7 @@ module Propellor.PrivData (
listPrivDataFields,
makePrivDataDir,
decryptPrivData,
+ readPrivData,
PrivMap,
PrivInfo,
forceHostContext,
@@ -248,7 +249,10 @@ modifyPrivData' f = do
return r
decryptPrivData :: IO PrivMap
-decryptPrivData = fromMaybe M.empty . readish <$> gpgDecrypt privDataFile
+decryptPrivData = readPrivData <$> gpgDecrypt privDataFile
+
+readPrivData :: String -> PrivMap
+readPrivData = fromMaybe M.empty . readish
makePrivDataDir :: IO ()
makePrivDataDir = createDirectoryIfMissing False privDataDir