Dan Kenigsberg has posted comments on this change.
Change subject: netwiring: [4/4] Add API definitions.
......................................................................
Patch Set 29: I would prefer that you didn't submit this
(4 inline comments)
....................................................
File vdsm/dummybr.py
Line 42:
Line 43: if __name__ == '__main__':
Line 44: try:
Line 45: if not os.path.exists('/sys/class/net/%s' % DUMMY_BRIDGE):
Line 46: createEphemeralBridge(DUMMY_BRIDGE)
this does not raise libvirtError so it has no place within the try-block.
Line 47: addBridgeToLibvirt(DUMMY_BRIDGE)
Line 48: except libvirtError as le:
Line 49: if 'already exists' not in le.message:
Line 50: sys.stderr.write(le.message)
Line 45: if not os.path.exists('/sys/class/net/%s' % DUMMY_BRIDGE):
Line 46: createEphemeralBridge(DUMMY_BRIDGE)
Line 47: addBridgeToLibvirt(DUMMY_BRIDGE)
Line 48: except libvirtError as le:
Line 49: if 'already exists' not in le.message:
ahhh! there no specific code for NOENT? text lookup is very fragile - maybe a
libvirt rfe is in place.
Line 50: sys.stderr.write(le.message)
Line 51: sys.exit(1)
Line 52: except Exception as e:
Line 53: sys.stderr.write(e.message)
....................................................
File vdsm/libvirtvm.py
Line 1574:
Line 1575: @contextmanager
Line 1576: def setLinkAndNetwork(self, dev, conf, linkValue, networkValue):
Line 1577: vnicXML = dev.getXML()
Line 1578: vnicXMLBackup = dev.getXML()
why call dev.getXML() twice?
Line 1579: source = vnicXML.getElementsByTagName('source')[0]
Line 1580: source.setAttribute('bridge', networkValue)
Line 1581: try:
Line 1582: link = vnicXML.getElementsByTagName('link')[0]
....................................................
File vdsm/netinfo.py
Line 88: """
Line 89: nets = {}
Line 90: conn = libvirtconnection.get()
Line 91: for name in conn.listNetworks():
Line 92: if name.startswith(LIBVIRT_NET_PREFIX) and name !=
DUMMY_BRIDGE:
bug: you probably want to compare DUMMY_BRIDGE to netname, defined one line
below.
Line 93: # remove the LIBVIRT_NET_PREFIX from the network name
Line 94: netname = name[len(LIBVIRT_NET_PREFIX):]
Line 95: nets[netname] = {}
Line 96: net = conn.networkLookupByName(name)
--
To view, visit http://gerrit.ovirt.org/9562
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I3b9b4f49f80466a83e3e13f1042ac2a8866c6bcd
Gerrit-PatchSet: 29
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Alona Kaplan <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Livnat Peer <[email protected]>
Gerrit-Reviewer: Mark Wu <[email protected]>
Gerrit-Reviewer: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches