Dan Kenigsberg has posted comments on this change.
Change subject: Don't crash on libvirt network re-definition.
......................................................................
Patch Set 5: I would prefer that you didn't submit this
(4 inline comments)
....................................................
File vdsm/configNetwork.py
Line 406: ports = []
Line 407: for file_path in glob.iglob(netinfo.NET_CONF_PREF + '*'):
Line 408: with open(file_path, 'r') as conf_file:
Line 409: for line in conf_file:
Line 410: if line.startswith('BRIDGE=' + 'network'):
I'm pretty sure you'd want to unquote 'network'. Too bad this code path was
never tested :-0
Line 411: ports.append(file_path[file_path.rindex('-')
+ 1:])
Line 412: return ports
Line 413:
Line 414: def writeConfFile(self, fileName, configuration):
Line 651: currmtu = None
Line 652: if bridged:
Line 653: try:
Line 654: currmtu = int(netinfo.getMtu(network))
Line 655: except IOError:
could we limit ourselves to ENOENT?
Line 656: currmtu = None
Line 657:
Line 658: nics, delvlan, bonding = \
Line 659: _netinfo.getNicsVlanAndBondingForNetwork(network)
Line 652: if bridged:
Line 653: try:
Line 654: currmtu = int(netinfo.getMtu(network))
Line 655: except IOError:
Line 656: currmtu = None
isn't this the default that was already set in line 651?
Line 657:
Line 658: nics, delvlan, bonding = \
Line 659: _netinfo.getNicsVlanAndBondingForNetwork(network)
Line 660: if delvlan is None:
Line 1376: # returned by libvirt, it means that we are
dealing with
Line 1377: # a broken network.
Line 1378: logger.debug('Removing broken network %r' %
network)
Line 1379: # Since delNetwork gets the information from the
"living"
Line 1380: # network entities via netinfo instantiation,
here we will
what about my idea of wrapping this ugly hack in a function called
"_delBrokenNetwork" (better find a better name...) make it more localized?
Even if it's bad, please say why.
Line 1381: # add some information about the non-living
network
Line 1382: # entities so they can be removed.
Line 1383: _customNetinfo = netinfo.NetInfo()
Line 1384: _customNetinfo.networks[network] =
libvirt_nets[network]
--
To view, visit http://gerrit.ovirt.org/10901
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I76d95e20b7aa99280e604abdb1663c6c5c7dd32e
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <[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: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches