Change in vdsm[master]: virt: removing naming confilct in vmstats.py

mmirecki at redhat.com mmirecki at redhat.com
Wed Jul 15 11:45:32 UTC 2015


Marcin Mirecki has uploaded a new change for review.

Change subject: virt: removing naming confilct in vmstats.py
......................................................................

virt: removing naming confilct in vmstats.py

variable name 'nic' confilcts with function 'nic'
renaming variable to 'vm_nic'

Change-Id: I77307af135e0f6c3d8c5554e0f3fb4093e36ed0d
Signed-off-by: Marcin Mirecki <mmirecki at redhat.com>
---
M vdsm/virt/vmstats.py
1 file changed, 6 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/57/43657/1

diff --git a/vdsm/virt/vmstats.py b/vdsm/virt/vmstats.py
index b9caeac..53a909f 100644
--- a/vdsm/virt/vmstats.py
+++ b/vdsm/virt/vmstats.py
@@ -176,17 +176,17 @@
     if first_sample is None or last_sample is None:
         return
 
-    for nic in vm.getNicDevices():
-        if nic.name.startswith('hostdev'):
+    for vm_nic in vm.getNicDevices():
+        if vm_nic.name.startswith('hostdev'):
             continue
 
-        first_nic = first_sample.get('net', {}).get(nic.name, {})
-        last_nic = last_sample.get('net', {}).get(nic.name, {})
+        first_nic = first_sample.get('net', {}).get(vm_nic.name, {})
+        last_nic = last_sample.get('net', {}).get(vm_nic.name, {})
         # may happen if nic is a new hot-plugged one
         if not first_nic or not last_nic:
             continue
-        stats['network'][nic.name] = nic(
-            nic.name, nic.nicModel, nic.macAddr,
+        stats['network'][vm_nic.name] = nic(
+            vm_nic.name, vm_nic.nicModel, vm_nic.macAddr,
             first_nic, last_nic, interval)
 
 


-- 
To view, visit https://gerrit.ovirt.org/43657
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I77307af135e0f6c3d8c5554e0f3fb4093e36ed0d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <mmirecki at redhat.com>


More information about the vdsm-patches mailing list