You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2020/10/21 17:15:59 UTC

[cloudstack] branch 4.13 updated: Fix usage record count (#4193)

This is an automated email from the ASF dual-hosted git repository.

dahn pushed a commit to branch 4.13
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.13 by this push:
     new 963d603  Fix usage record count (#4193)
963d603 is described below

commit 963d603ede6a76a37d4195f3771ba254b3c680b3
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Wed Oct 21 22:45:34 2020 +0530

    Fix usage record count (#4193)
    
    
    Co-authored-by: Pearl Dsilva <pe...@shapeblue.com>
---
 .../cloudstack/api/command/admin/usage/ListUsageRecordsCmd.java      | 2 +-
 server/src/main/java/com/cloud/api/ApiResponseHelper.java            | 5 -----
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/usage/ListUsageRecordsCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/usage/ListUsageRecordsCmd.java
index a5199ec..748b9d7 100644
--- a/api/src/main/java/org/apache/cloudstack/api/command/admin/usage/ListUsageRecordsCmd.java
+++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/usage/ListUsageRecordsCmd.java
@@ -181,7 +181,7 @@ public class ListUsageRecordsCmd extends BaseListCmd {
                 }
             }
 
-            response.setResponses(usageResponses, usageResponses.size());
+            response.setResponses(usageResponses, usageRecords.second());
         }
 
         response.setResponseName(getCommandName());
diff --git a/server/src/main/java/com/cloud/api/ApiResponseHelper.java b/server/src/main/java/com/cloud/api/ApiResponseHelper.java
index 229b311..2f4ee9f 100644
--- a/server/src/main/java/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/main/java/com/cloud/api/ApiResponseHelper.java
@@ -3412,11 +3412,6 @@ public class ApiResponseHelper implements ResponseGenerator {
                 if (networkId == null) {
                     networkId = ip.getSourceNetworkId();
                 }
-                NetworkDetailVO networkDetail = networkDetailsDao.findDetail(networkId, Network.hideIpAddressUsage);
-                if (networkDetail != null && networkDetail.getValue() != null && networkDetail.getValue().equals("true")) {
-                    // Don't export network usage when admin wants it hidden
-                    return null;
-                }
                 resourceType = ResourceObjectType.PublicIpAddress;
                 resourceId = ip.getId();
                 usageRecResponse.setUsageId(ip.getUuid());