cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [3/3] git commit: updated refs/heads/master to 01a325b
Date Wed, 07 Jan 2015 08:58:13 GMT
Network Id for direct-network should not be included in usage record response. Direct network
stats have network_id = 0. Ignore network with id = 0 in usage record


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

Branch: refs/heads/master
Commit: 01a325b2bfde3f82faca1361cfab3f66ee78a524
Parents: 30ab4d3
Author: Kishan Kavala <kishan@apache.org>
Authored: Mon Nov 24 11:35:36 2014 +0530
Committer: Kishan Kavala <kishan@apache.org>
Committed: Wed Jan 7 14:17:30 2015 +0530

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


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/01a325b2/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 dd55486..4726c24 100644
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -3169,9 +3169,11 @@ public class ApiResponseHelper implements ResponseGenerator {
                 }
             }
             //Network ID
-            NetworkVO network = _entityMgr.findByIdIncludingRemoved(NetworkVO.class, usageRecord.getNetworkId().toString());
-            if (network != null) {
-                usageRecResponse.setNetworkId(network.getUuid());
+            if((usageRecord.getNetworkId() != null) && (usageRecord.getNetworkId()
!= 0)) {
+                NetworkVO network = _entityMgr.findByIdIncludingRemoved(NetworkVO.class,
usageRecord.getNetworkId().toString());
+                if (network != null) {
+                    usageRecResponse.setNetworkId(network.getUuid());
+                }
             }
 
         } else if (usageRecord.getUsageType() == UsageTypes.VM_DISK_IO_READ || usageRecord.getUsageType()
== UsageTypes.VM_DISK_IO_WRITE


Mime
View raw message