Dan Kenigsberg has uploaded a new change for review.
Change subject: py3: let bulk_sampling_test pass under py3
......................................................................
py3: let bulk_sampling_test pass under py3
Change-Id: Ic8f148a7984fab0a092fca588b5de61bdeb4e899
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/virt/sampling.py
M lib/vdsm/virt/utils.py
M tests/Makefile.am
3 files changed, 8 insertions(+), 7 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/65006/1
diff --git a/lib/vdsm/virt/sampling.py b/lib/vdsm/virt/sampling.py
index 87e86c6..e8fa2c1 100644
--- a/lib/vdsm/virt/sampling.py
+++ b/lib/vdsm/virt/sampling.py
@@ -18,6 +18,7 @@
# Refer to the README and COPYING files for full details of the license
#
from __future__ import absolute_import
+import six
"""
Support for VM and host statistics sampling.
@@ -279,12 +280,12 @@
def to_connlog(self):
text = ', '.join(
('%s:(%s)' % (ifid, ifacesample.to_connlog()))
- for (ifid, ifacesample) in self.interfaces.iteritems())
+ for (ifid, ifacesample) in six.iteritems(self.interfaces))
return ('recent_client:%s, ' % self.recentClient) + text
def connlog_diff(self, other):
text = ''
- for ifid, sample in self.interfaces.iteritems():
+ for ifid, sample in six.iteritems(self.interfaces):
if ifid in other.interfaces:
diff = sample.connlog_diff(other.interfaces[ifid])
if diff:
@@ -292,7 +293,7 @@
else:
text += 'new %s:(%s) ' % (ifid, sample.to_connlog())
- for ifid, sample in other.interfaces.iteritems():
+ for ifid, sample in six.iteritems(other.interfaces):
if ifid not in self.interfaces:
text += 'dropped %s:(%s) ' % (ifid, sample.to_connlog())
@@ -560,14 +561,14 @@
vm_sample.first_value,
vm_sample.last_value,
vm_sample.interval)
- for vm_id, vm_sample in vm_samples.items()
+ for vm_id, vm_sample in six.iteritems(vm_samples)
}
vmstats.send_metrics(stats)
def _get_responsive_doms(self):
vms = self._get_vms()
doms = []
- for vm_id, vm_obj in vms.iteritems():
+ for vm_id, vm_obj in six.iteritems(vms):
to_skip = self._skip_doms.get(vm_id, False)
if to_skip:
continue
diff --git a/lib/vdsm/virt/utils.py b/lib/vdsm/virt/utils.py
index 1d215e0..7d64a28 100644
--- a/lib/vdsm/virt/utils.py
+++ b/lib/vdsm/virt/utils.py
@@ -18,6 +18,7 @@
# Refer to the README and COPYING files for full details of the license
#
from __future__ import absolute_import
+import six
"""
shared utilities and common code for the virt package
@@ -93,7 +94,7 @@
with self._lock:
expired_keys = [
key for key, (expiration, _)
- in self._items.iteritems()
+ in six.iteritems(self._items)
if expiration <= now]
for key in expired_keys:
del self._items[key]
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fb3d7c3..c690f3e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -167,7 +167,6 @@
blockVolumeTests.py \
blocksdTests.py \
bridgeTests.py \
- bulk_sampling_test.py \
cPopenTests.py \
clientifTests.py \
deviceTests.py \
--
To view, visit
https://gerrit.ovirt.org/65006
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8f148a7984fab0a092fca588b5de61bdeb4e899
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>