From 2a91d511a0999ddd55ef808ef00f9a9b527fe853 Mon Sep 17 00:00:00 2001 From: Anthony Piddubny Date: Thu, 15 Sep 2016 14:43:28 +0300 Subject: [PATCH] fix bug #274 Delete vm only command completed with output:"null" --- .../cloudshell/cp/vcenter/common/utilites/command_result.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/cloudshell/cp/vcenter/common/utilites/command_result.py b/package/cloudshell/cp/vcenter/common/utilites/command_result.py index 0dc5155e..1b63730e 100644 --- a/package/cloudshell/cp/vcenter/common/utilites/command_result.py +++ b/package/cloudshell/cp/vcenter/common/utilites/command_result.py @@ -22,6 +22,10 @@ def set_command_result(result, unpicklable=False): :param unpicklable: If True adds JSON can be deserialized as real object. When False will be deserialized as dictionary """ + # we do not need to serialize an empty response from the vCenter + if result is None: + return + json = jsonpickle.encode(result, unpicklable=unpicklable) result_for_output = str(json) print result_for_output