Revision 46300ac2
b/htools/Ganeti/Confd/Server.hs | ||
---|---|---|
43 | 43 |
import System.IO |
44 | 44 |
import System.Posix.Files |
45 | 45 |
import System.Posix.Types |
46 |
import System.Time |
|
47 | 46 |
import qualified Text.JSON as J |
48 | 47 |
import System.INotify |
49 | 48 |
|
... | ... | |
132 | 131 |
queryArgumentError :: StatusAnswer |
133 | 132 |
queryArgumentError = (ReplyStatusError, J.showJSON ConfdErrorArgument) |
134 | 133 |
|
135 |
-- | Returns the current time. |
|
136 |
getCurrentTime :: IO Integer |
|
137 |
getCurrentTime = do |
|
138 |
TOD ctime _ <- getClockTime |
|
139 |
return ctime |
|
140 |
|
|
141 | 134 |
-- | Converter from specific error to a string format. |
142 | 135 |
gntErrorToResult :: ErrorResult a -> Result a |
143 | 136 |
gntErrorToResult (Bad err) = Bad (show err) |
b/htools/Ganeti/Confd/Utils.hs | ||
---|---|---|
31 | 31 |
, parseRequest |
32 | 32 |
, parseMessage |
33 | 33 |
, signMessage |
34 |
, getCurrentTime |
|
34 | 35 |
) where |
35 | 36 |
|
36 | 37 |
import qualified Data.ByteString as B |
37 | 38 |
import qualified Text.JSON as J |
39 |
import System.Time |
|
38 | 40 |
|
39 | 41 |
import Ganeti.BasicTypes |
40 | 42 |
import Ganeti.Confd.Types |
... | ... | |
80 | 82 |
, signedMsgHmac = hmac |
81 | 83 |
} |
82 | 84 |
where hmac = computeMac key (Just salt) msg |
85 |
|
|
86 |
-- | Returns the current time. |
|
87 |
getCurrentTime :: IO Integer |
|
88 |
getCurrentTime = do |
|
89 |
TOD ctime _ <- getClockTime |
|
90 |
return ctime |
Also available in: Unified diff