cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [14/20] git commit: updated refs/heads/4.5 to 64e938b
Date Mon, 02 Feb 2015 10:17:12 GMT
Network offering usage event should be logged for UserVms only

(cherry picked from commit 42cecbb000416978a7edcef5d8c664dac4b52277)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


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

Branch: refs/heads/4.5
Commit: 0c1172ffe93b6283b5e849898267d2aa8b2128b3
Parents: 294f5bf
Author: Kishan Kavala <kishan@apache.org>
Authored: Fri Nov 21 12:10:50 2014 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Mon Feb 2 14:27:24 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/0c1172ff/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 8b8c83b..4c90dbe 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -2924,8 +2924,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