Antoni Segura Puimedon has posted comments on this change.
Change subject: netwiring: [4/4] Add API definitions.
......................................................................
Patch Set 29: (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)
It is inside the try that is also caught by the except in line 52. I could
split it in two try-except blocks, if you wish.
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:
Looking into it.
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()
This first one I'm modifying the second one is kept as backup for the rollback
at line 1601. Alternatively I could make a copy importing copy and doing
vnicXMLBackup = copy.deepcopy(vnicXML)
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:
In fact, since DUMMY_BRIDGE does not start with LIBVIRT_NET_PREFIX, the
modification of this line should be dropped as unnecessary.
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