Antoni Segura Puimedon has posted comments on this change.

Change subject: linkmonitor: fix reported device name of vlans and macvlans
......................................................................


Patch Set 10:

(4 comments)

....................................................
File lib/vdsm/ipwrapper.py
Line 578:                 line = line[len(cls._DELETED_TEXT):]
Line 579: 
Line 580:             ifindex, devName, data = [el.strip() for el in 
line.split(':', 2)]
Line 581:             if (state != cls.LINK_STATE_DELETED and
Line 582:                     not _dev_sysfs_exists(devName)):
or when we get an event for a just deleted event (happens for example when 
deleting dummy nics in rhel6.5).

Added comment.
Line 583:                 try:
Line 584:                     devName = _dev_get_by_index(ifindex)
Line 585:                 except OSError as ose:
Line 586:                     if ose.errno == errno.ENOENT:


Line 583:                 try:
Line 584:                     devName = _dev_get_by_index(ifindex)
Line 585:                 except OSError as ose:
Line 586:                     if ose.errno == errno.ENOENT:
Line 587:                         continue   # No device
It is very common for dummies on el6.5, I'd skip the logging in this case.
Line 588:                     else:
Line 589:                         raise
Line 590: 
Line 591:             flagVal, _ = data.split('\\', 1)  # We don't parse 
link/ether


Line 608: 
Line 609:         return self._parse(out)
Line 610: 
Line 611: 
Line 612: def _dev_get_by_index(ifindex):
Done
Line 613:     for filepath in iglob(NET_SYSFS+'/*/ifindex'):
Line 614:         with open(filepath) as ifFile:
Line 615:             try:
Line 616:                 if ifFile.read().strip() == ifindex:


Line 609:         return self._parse(out)
Line 610: 
Line 611: 
Line 612: def _dev_get_by_index(ifindex):
Line 613:     for filepath in iglob(NET_SYSFS+'/*/ifindex'):
Done
Line 614:         with open(filepath) as ifFile:
Line 615:             try:
Line 616:                 if ifFile.read().strip() == ifindex:
Line 617:                     return filepath.split('/')[-2]


-- 
To view, visit http://gerrit.ovirt.org/22061
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ieaeab6adc30a80b70e9e967768c10b3fea65aa16
Gerrit-PatchSet: 10
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegu...@redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com>
Gerrit-Reviewer: Assaf Muller <amul...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to