CLOUDSTACK-1124 [EC2 Query API] Improve the logging. Having empty response objects is harmless to functionality
This is observed in the awsapi.log for all Describe* EC2 commands when the response object returned by CS has no elements. But with EC2DescribeImages command it is always observed. This is because every time DescribeImage is fired, we call CS listTemplates command multiple times, each time setting a different value for the templateFilter parameter (e.g. featured, executable, community etc.). And for some of these CS calls made we obtain am empty response and hence the message in the logs. Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/1e8648c9 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/1e8648c9 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/1e8648c9 Branch: refs/heads/vim51_win8 Commit: 1e8648c92de9df281aaabc5067d6d1d61be3a4a3 Parents: 5d09b9f Author: Likitha Shetty <[email protected]> Authored: Mon Feb 11 11:49:52 2013 -0800 Committer: Prachi Damle <[email protected]> Committed: Mon Feb 11 11:50:13 2013 -0800 ---------------------------------------------------------------------- awsapi/src/com/cloud/stack/CloudStackClient.java | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/1e8648c9/awsapi/src/com/cloud/stack/CloudStackClient.java ---------------------------------------------------------------------- diff --git a/awsapi/src/com/cloud/stack/CloudStackClient.java b/awsapi/src/com/cloud/stack/CloudStackClient.java index 5002aa5..5017bd4 100644 --- a/awsapi/src/com/cloud/stack/CloudStackClient.java +++ b/awsapi/src/com/cloud/stack/CloudStackClient.java @@ -151,7 +151,8 @@ public class CloudStackClient { return (new Gson()).fromJson(json.eval(responseName + "." + responseObjName), collectionType); } catch(Exception e) { // this happens because responseObjName won't exist if there are no objects in the list. - logger.debug("Unable to find responseObjName:[" + responseObjName + "]. Returning null! Exception: " + e.getMessage()); + logger.debug("CloudSatck API response doesn't contain responseObjName:" + responseObjName + + " because response is empty"); return null; } return (new Gson()).fromJson(json.eval(responseName), collectionType);
