Dan Kenigsberg 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)
ah, I've missed the lie 52 "except". oops.
Come to think of it, I do not see a big difference between the two except
clauses, and betwen them to the default behavior of the python interpreter of
unhandled exception. Please consider dropping the whole 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:
I am afraid that you are right about "asking for permission". sorry for pushing
you to the wrong track.
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()
nah, I think that your original code (and variable naming) is clear enough. I
should have noticed that there are mutables myself.
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:
I do not think I follow - I thought you decided to show ownership on the
DUMMY_BRIDGE network by calling int vdsm-;dummybridge; or whatever.
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