From 1e8648c92de9df281aaabc5067d6d1d61be3a4a3 Mon Sep 17 00:00:00 2001 From: Likitha Shetty Date: Mon, 11 Feb 2013 11:49:52 -0800 Subject: [PATCH] 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. --- awsapi/src/com/cloud/stack/CloudStackClient.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/awsapi/src/com/cloud/stack/CloudStackClient.java b/awsapi/src/com/cloud/stack/CloudStackClient.java index 5002aa593e7..5017bd423dd 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);