ssh_update: log data that is received
[ganeti-github.git] / lib / tools / common.py
index a9149f6..3297025 100644 (file)
@@ -188,7 +188,14 @@ def LoadData(raw, data_check):
   @rtype: dict
 
   """
-  return serializer.LoadAndVerifyJson(raw, data_check)
+  result = None
+  try:
+    result = serializer.LoadAndVerifyJson(raw, data_check)
+    logging.debug("Received data: %s", serializer.DumpJson(result))
+  except Exception as e:
+    logging.warn("Received data is not valid json: %s.", str(raw))
+    raise e
+  return result
 
 
 def GenerateRootSshKeys(error_fn, _suffix="", _homedir_fn=None):