cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kis...@apache.org
Subject [1/2] git commit: updated refs/heads/master to 9eb8d53
Date Wed, 07 Jan 2015 07:11:22 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 84c25f702 -> 9eb8d538d


Network offering usage event should be logged for UserVms only


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

Branch: refs/heads/master
Commit: 42cecbb000416978a7edcef5d8c664dac4b52277
Parents: 84c25f7
Author: Kishan Kavala <kishan@apache.org>
Authored: Fri Nov 21 12:10:50 2014 +0530
Committer: Kishan Kavala <kishan@apache.org>
Committed: Wed Jan 7 12:29:11 2015 +0530

----------------------------------------------------------------------
 .../src/com/cloud/vm/VirtualMachineManagerImpl.java           | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/42cecbb0/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index e9cd79c..8accebe 100644
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -2925,8 +2925,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
                     s_logger.debug("Nic is plugged successfully for vm " + vm + " in network
" + network + ". Vm  is a part of network now");
                     long isDefault = (nic.isDefaultNic()) ? 1 : 0;
                     // insert nic's Id into DB as resource_name
-                    UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN,
vmVO.getAccountId(), vmVO.getDataCenterId(), vmVO.getId(),
-                            Long.toString(nic.getId()), network.getNetworkOfferingId(), null,
isDefault, VirtualMachine.class.getName(), vmVO.getUuid(), vm.isDisplay());
+                    if(VirtualMachine.Type.User.equals(vmVO.getType())) {
+                        //Log usage event for user Vms only
+                        UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN,
vmVO.getAccountId(), vmVO.getDataCenterId(), vmVO.getId(),
+                                Long.toString(nic.getId()), network.getNetworkOfferingId(),
null, isDefault, VirtualMachine.class.getName(), vmVO.getUuid(), vm.isDisplay());
+                    }
                     return nic;
                 } else {
                     s_logger.warn("Failed to plug nic to the vm " + vm + " in network " +
network);


Mime
View raw message