Dan Kenigsberg has posted comments on this change.
Change subject: Define network filter on libvirt
......................................................................
Patch Set 4: I would prefer that you didn't submit this
(2 inline comments)
only the tuple thingy is a must-fix.
....................................................
File vdsm/nwfilter.py
Line 34: try:
Line 35: NoMacSpoofingFilter().defineNwFilter(conn)
Line 36: finally:
Line 37: try:
Line 38: conn.close()
I would have trusted libvirt to be doing the cleanup automatically when the
process exists. But I suppose that you are right about explicitly closing.
However, why would a close fail? If it ever happens, it means that something
really bad has occurred, and I would have liked to see the error.
In any case, my position here is not very strong.
BTW, you know that I have a soft spot for contextmanagers. So for future
reference:
with contextlib.closing(libvirtconnection.get()) as conn:
NoMacSpoofingFilter().defineNwFilter(conn)
Line 39: except libvirt.libvirtError:
Line 40: pass
Line 41:
Line 42: class NwFilter(object):
Line 66: # is being used by running VMs
Line 67: pass
Line 68:
Line 69: nwFilter = conn.nwfilterDefineXML(self.buildFilterXml())
Line 70: logging.debug("Filter %s was defined" % (nwFilter.name()))
the parens around
(nwFilter.name())
are meaningless. use
(nwFilter.name(), )
to be uber-holy.
Line 71:
Line 72:
Line 73: class NoMacSpoofingFilter(NwFilter):
Line 74: """
--
To view, visit http://gerrit.ovirt.org/7354
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9f1708385dec6a87bc404e4ab25c4da8ab8a8acc
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Moti Asayag <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches