Dan Kenigsberg has uploaded a new change for review.
Change subject: py3: make toolBondingTests pass
......................................................................
py3: make toolBondingTests pass
I don't really know why, but under Python 3, file.close() seems to issue
another attempt to flush "invalid" data. The added code explicitly
ignores the ensuing exception.
Change-Id: I4487b787c3a14ca9508847572622f431f1188e7f
Signed-off-by: Dan Kenigsberg <danken(a)redhat.com>
---
M lib/vdsm/network/netinfo/bonding.py
M tests/Makefile.am
2 files changed, 9 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/66/65666/1
diff --git a/lib/vdsm/network/netinfo/bonding.py b/lib/vdsm/network/netinfo/bonding.py
index 0ca2259..2f40b88 100644
--- a/lib/vdsm/network/netinfo/bonding.py
+++ b/lib/vdsm/network/netinfo/bonding.py
@@ -218,7 +218,7 @@
e.g. 'ad_num_ports' or 'slaves'.
"""
return dict(((opt, val) for (opt, val)
- in _bond_opts_name2numeric(bond).iteritems()
+ in six.iteritems(_bond_opts_name2numeric(bond))
if opt not in EXCLUDED_BONDING_ENTRIES))
@@ -268,6 +268,14 @@
vals[name] = numeric
+ # On Python 3, the final close seems to issue another flush attempt,
+ # which results in a repeated exception. Ignore it.
+ try:
+ opt_file.close()
+ except EnvironmentError as e:
+ if e.errno not in (errno.EINVAL, errno.EPERM, errno.EACCES):
+ raise
+
return vals
diff --git a/tests/Makefile.am b/tests/Makefile.am
index e96f226..6eb815b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -227,7 +227,6 @@
storage_workarounds_test.py \
storagefakelibTests.py \
storagetestlib_test.py \
- toolBondingTests.py \
unicode_test.py \
utilsTests.py \
v2vTests.py \
--
To view, visit
https://gerrit.ovirt.org/65666
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4487b787c3a14ca9508847572622f431f1188e7f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken(a)redhat.com>