cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject git commit: updated refs/heads/master to 29a399b
Date Tue, 13 Aug 2013 13:27:30 GMT
Updated Branches:
  refs/heads/master 9cc74429b -> 29a399b9a


CLOUDSTACK-4289, CLOUDSTACK-4290, CLOUDSTACK-4291 : Check for null when populated UUID while
listing usage records.
Filed CLOUDSTACK-4299 to make these entities always available.

Conflicts:
	server/src/com/cloud/api/ApiResponseHelper.java


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/29a399b9
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/29a399b9
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/29a399b9

Branch: refs/heads/master
Commit: 29a399b9aee0d022fb077e36c878a65698b4663d
Parents: 9cc7442
Author: Kishan Kavala <kishan@cloud.com>
Authored: Tue Aug 13 18:49:56 2013 +0530
Committer: Kishan Kavala <kishan@cloud.com>
Committed: Tue Aug 13 18:53:00 2013 +0530

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/29a399b9/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 1e13615..dca4148 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -3381,11 +3381,15 @@ public class ApiResponseHelper implements ResponseGenerator {
         } else if(usageRecord.getUsageType() == UsageTypes.LOAD_BALANCER_POLICY){
             //Load Balancer Policy ID
             LoadBalancerVO lb = _entityMgr.findById(LoadBalancerVO.class, usageRecord.getUsageId().toString());
-            usageRecResponse.setUsageId(lb.getUuid());
+            if(lb != null){
+                usageRecResponse.setUsageId(lb.getUuid());
+            }
         } else if(usageRecord.getUsageType() == UsageTypes.PORT_FORWARDING_RULE){
             //Port Forwarding Rule ID
             PortForwardingRuleVO pf = _entityMgr.findById(PortForwardingRuleVO.class, usageRecord.getUsageId().toString());
-            usageRecResponse.setUsageId(pf.getUuid());
+            if(pf != null){
+                usageRecResponse.setUsageId(pf.getUuid());
+            }
 
         } else if(usageRecord.getUsageType() == UsageTypes.NETWORK_OFFERING){
             //Network Offering Id
@@ -3397,7 +3401,9 @@ public class ApiResponseHelper implements ResponseGenerator {
         } else if(usageRecord.getUsageType() == UsageTypes.VPN_USERS){
             //VPN User ID
             VpnUserVO vpnUser = _entityMgr.findById(VpnUserVO.class, usageRecord.getUsageId().toString());
-            usageRecResponse.setUsageId(vpnUser.getUuid());
+            if(vpnUser != null){
+                usageRecResponse.setUsageId(vpnUser.getUuid());
+            }
 
         } else if(usageRecord.getUsageType() == UsageTypes.SECURITY_GROUP){
             //Security Group Id


Mime
View raw message