mirror of https://github.com/apache/cloudstack.git
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
This commit is contained in:
parent
30ab4d3d66
commit
01a325b2bf
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue