Hello Yaniv Bronhaim, Antoni Segura Puimedon,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/31419
to review the following change.
Change subject: ipwrapper: do not report devices that disappear
......................................................................
ipwrapper: do not report devices that disappear
There was a race in getLinks that consisted on devices disappearing
between them being reported by netlink and information being
retrieved by the Link class (driver info).
This patch solves it by reporting just those links that suceed.
Change-Id: Ib41336f3ac2f2278db2706f7d4eb3a9b579f66d4
Bug-Url: https://bugzilla.redhat.com/1129377
Signed-off-by: Antoni S. Puimedon <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/29442
Reviewed-by: Dan Kenigsberg <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/29546
Reviewed-by: Yaniv Bronhaim <[email protected]>
---
M lib/vdsm/ipwrapper.py
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/19/31419/1
diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index 522ac80..e1d48ad 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -283,7 +283,13 @@
def getLinks():
"""Returns a list of Link objects for each link in the system."""
- return [Link.fromDict(data) for data in netlink.iter_links()]
+ links = []
+ for data in netlink.iter_links():
+ try:
+ links.append(Link.fromDict(data))
+ except IOError: # If a link goes missing we just don't report it
+ continue
+ return links
def getLink(dev):
--
To view, visit http://gerrit.ovirt.org/31419
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib41336f3ac2f2278db2706f7d4eb3a9b579f66d4
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.4
Gerrit-Owner: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches