From ea626b33eda8963e13c74e2b424da1f1e9ee386c Mon Sep 17 00:00:00 2001
From: Iustin Pop <iustin@google.com>
Date: Thu, 20 Dec 2012 13:30:44 +0100
Subject: [PATCH] confd: strip newlines before logging the request

The Python confd client sends newlines in messages (due to use of
DumpSignedJson/DumpJson), so that results in ugly debug output.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
---
 htools/Ganeti/Confd/Server.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/htools/Ganeti/Confd/Server.hs b/htools/Ganeti/Confd/Server.hs
index b4b13854f..a05d3501b 100644
--- a/htools/Ganeti/Confd/Server.hs
+++ b/htools/Ganeti/Confd/Server.hs
@@ -60,6 +60,7 @@ import Ganeti.Logging
 import qualified Ganeti.Constants as C
 import qualified Ganeti.Path as Path
 import Ganeti.Query.Server (prepQueryD, runQueryD)
+import Ganeti.Utils
 
 -- * Types and constants definitions
 
@@ -467,7 +468,7 @@ responder cfgref socket hmac msg peer = do
   ctime <- getCurrentTime
   case parseMessage hmac msg ctime of
     Ok (origmsg, rq) -> do
-              logDebug $ "Processing request: " ++ origmsg
+              logDebug $ "Processing request: " ++ rStripSpace origmsg
               mcfg <- readIORef cfgref
               let response = respondInner mcfg hmac rq
               _ <- S.sendTo socket response peer
-- 
GitLab