Debugging ssh_update can be annoying, because the data used as input is not dumped anywhere. This patch logs makes sure it gets logged (at DEBUG level) when ssh_update receives the data.
Signed-off-by: Helga Velroyen <[email protected]> Reviewed-by: Klaus Aehlig <[email protected]> --- lib/tools/common.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/tools/common.py b/lib/tools/common.py index a9149f6..3297025 100644 --- a/lib/tools/common.py +++ b/lib/tools/common.py @@ -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): -- 2.6.0.rc2.230.g3dd15c0
