summaryrefslogtreecommitdiff
path: root/src/Propellor/PrivData.hs
diff options
context:
space:
mode:
authorJoey Hess2014-06-19 14:56:50 -0400
committerJoey Hess2014-06-19 14:56:50 -0400
commitf674c56119bd9b1bb9af53d5063c57275be77827 (patch)
tree0512c77f1730d796c2af1a5a3490f4eb36261106 /src/Propellor/PrivData.hs
parent42594d6b4c14a21efc42e262e52c2c67f30c67c3 (diff)
Add --list-fields to list a host's currently set privdata fields.
Diffstat (limited to 'src/Propellor/PrivData.hs')
-rw-r--r--src/Propellor/PrivData.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Propellor/PrivData.hs b/src/Propellor/PrivData.hs
index fec6acc3..c2af4284 100644
--- a/src/Propellor/PrivData.hs
+++ b/src/Propellor/PrivData.hs
@@ -68,6 +68,13 @@ editPrivData host field = do
readFile f
setPrivDataTo host field v'
+listPrivDataFields :: HostName -> IO ()
+listPrivDataFields host = do
+ putStrLn (host ++ "'s currently set privdata fields:")
+ mapM_ list . M.keys =<< decryptPrivData host
+ where
+ list = putStrLn . ("\t" ++) . shellEscape . show
+
setPrivDataTo :: HostName -> PrivDataField -> String -> IO ()
setPrivDataTo host field value = do
makePrivDataDir