Revision ace37e24
b/src/Ganeti/Confd/Utils.hs | ||
---|---|---|
37 | 37 |
|
38 | 38 |
import qualified Data.ByteString as B |
39 | 39 |
import qualified Text.JSON as J |
40 |
import System.Time |
|
41 | 40 |
|
42 | 41 |
import Ganeti.BasicTypes |
43 | 42 |
import Ganeti.Confd.Types |
... | ... | |
96 | 95 |
, signedMsgHmac = hmac |
97 | 96 |
} |
98 | 97 |
where hmac = computeMac key (Just salt) msg |
99 |
|
|
100 |
-- | Returns the current time. |
|
101 |
getCurrentTime :: IO Integer |
|
102 |
getCurrentTime = do |
|
103 |
TOD ctime _ <- getClockTime |
|
104 |
return ctime |
b/src/Ganeti/Utils.hs | ||
---|---|---|
45 | 45 |
, exitUnless |
46 | 46 |
, rStripSpace |
47 | 47 |
, newUUID |
48 |
, getCurrentTime |
|
48 | 49 |
, clockTimeToString |
49 | 50 |
, chompPrefix |
50 | 51 |
) where |
... | ... | |
290 | 291 |
contents <- readFile C.randomUuidFile |
291 | 292 |
return $! rStripSpace $ take 128 contents |
292 | 293 |
|
294 |
-- | Returns the current time as an Integer representing the number of |
|
295 |
-- seconds from the Unix epoch. |
|
296 |
getCurrentTime :: IO Integer |
|
297 |
getCurrentTime = do |
|
298 |
TOD ctime _ <- getClockTime |
|
299 |
return ctime |
|
300 |
|
|
293 | 301 |
-- | Convert a ClockTime into a (seconds-only) timestamp. |
294 | 302 |
clockTimeToString :: ClockTime -> String |
295 | 303 |
clockTimeToString (TOD t _) = show t |
Also available in: Unified diff