Add the parseReply function to the Confd utils
This function will be used by the Haskell Confd client to parse the repliesit receives from the server.
Unit test is included as well.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Rename the Confd utils parseMessage function to parseRequest
With the upcoming implementation of the Haskell Confd client, requests willno longer be the only kind of message to be parsed, therefore the parsingfunction for requests is being renamed to be more specific, and to better fit...
Make the parseRequest function more general
The parseRequest function of the Confd utils can be used to parse both request(in the server) and reply (in the client, soon to be implemented) signedmessages.This patch changes the signature of the function to allow this, and its name...
Move Confd getCurrentTime to Utils
The Confd server implementation has a getCurrentTime function.This commit moves it to the Utils.hs file of Confd, so that it will beavailable to be used by the future Confd client as well.
Signed-off-by: Michele Tartara <mtartara@google.com>...
confd: strip newlines before logging the request
The Python confd client sends newlines in messages (due to use ofDumpSignedJson/DumpJson), so that results in ugly debug output.
Signed-off-by: Iustin Pop <iustin@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add constants for two values which we re-evaluate
Two constants which we use as Integer are defined as Int inConstants.hs (coming from constants.py), so we do the conversion everytime we use it. Let's move them to top-level names, so that theconversion is only done once....
Fix typo in comment
There was a typo in the docstring of the parseMessage function of theconfd server.
Signed-off-by: Michele Tartara <mtartara@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Remove read instances from our Haskell code
It turns out that optimising 'read' derived instances (via -O) forcomplex data types (like OpCode, or the various objects) can be slowto very slow. Disabling such instances results in (time make$all_our_haskell_binaries) large compile-time savings and also smaller...
Cleanup THH function use from built module namespace
Currently, THH.hs "injects" into the built code names of libraryfunctions like Text.JSON.makeObj, Ganeti.JSON.fromObj, etc. builtdirectly from strings, via (e.g.)
varE (mkName "makeObj")
This means that the "makeObj" name must exist in the target module,...
Remove unsafePerformIO usage
We need to change a few things, most importantly CLI options defaults,but otherwise we already used the path to files from functions whichwere already in the I/O monad, so we don't have to change much of thecode flow.
Additionally, Path.hs now has an explicit export list, to stop...
View revisions
Also available in: Atom