Change in vdsm[master]: Multiple Gateways[6/2]: Swapped libvirt network & netEnt cre...

wudxw at linux.vnet.ibm.com wudxw at linux.vnet.ibm.com
Thu Jul 11 07:55:43 UTC 2013


Mark Wu has posted comments on this change.

Change subject: Multiple Gateways[6/2]: Swapped libvirt network & netEnt creation
......................................................................


Patch Set 3: I would prefer that you didn't submit this

(6 inline comments)

....................................................
File vdsm/netconf/__init__.py
Line 72: 
Line 73:     def removeLibvirtNetwork(self, network):
Line 74:         self.configApplier.removeLibvirtNetwork(network)
Line 75: 
Line 76:     def _trackInterface(self, device):
I suggest you move this move function to class DynamicSourceRoute too.
Line 77:         _, _, _, bootproto, _ = device.getIpConfig()
Line 78:         if bootproto == 'dhcp' and device.master is None:
Line 79:             command = [_TOUCH_BINARY.cmd, TRACKED_INTERFACES_FOLDER + '/' +
Line 80:                        device.name]


Line 74:         self.configApplier.removeLibvirtNetwork(network)
Line 75: 
Line 76:     def _trackInterface(self, device):
Line 77:         _, _, _, bootproto, _ = device.getIpConfig()
Line 78:         if bootproto == 'dhcp' and device.master is None:
it seems the second condition is not neccessary.  We can't have a device with dhcp configured and also have a master device. You can remove the two lines above and move the check to line 93:
elif bootproto == 'dhcp':
    DynamicSourceRoute.addTrackInterface(netEnt.name)
Line 79:             command = [_TOUCH_BINARY.cmd, TRACKED_INTERFACES_FOLDER + '/' +
Line 80:                        device.name]
Line 81:             returnCode, _, error = execCmd(command)
Line 82: 


....................................................
File vdsm/sourceRoute.py
Line 114:                              for network in networks.itervalues()]
Line 115:         return self.device in trackedInterfaces
Line 116: 
Line 117:     def isVDSMInterface(self):
Line 118:         if os.path.exists(TRACKED_INTERFACES_FOLDER + '/' + self.device):
is it better to use os.path.join(TRACKED_INTERFACES_FOLDER, self.device). And you also could add a helper function in  DynamicSourceRoute to get the path of tracked interface.
Line 119:             logging.debug(">>> file exists")
Line 120:             return True
Line 121:         else:
Line 122:             logging.debug("<<< file doesn't exist")


Line 119:             logging.debug(">>> file exists")
Line 120:             return True
Line 121:         else:
Line 122:             logging.debug("<<< file doesn't exist")
Line 123:             return self._isLibvirtInterface()
I don't understand why _isLibvirtInterface is preserved. Could you please explain it? Thanks.
Line 124: 
Line 125:     def removeVDSMInterfaceTracking(self):
Line 126:         try:
Line 127:             os.remove(TRACKED_INTERFACES_FOLDER + '/' + self.device)


Line 121:         else:
Line 122:             logging.debug("<<< file doesn't exist")
Line 123:             return self._isLibvirtInterface()
Line 124: 
Line 125:     def removeVDSMInterfaceTracking(self):
We don't need it for static ip config, right?  It's better to move to DynamicSourceRoute
Line 126:         try:
Line 127:             os.remove(TRACKED_INTERFACES_FOLDER + '/' + self.device)
Line 128:         except:
Line 129:             pass


....................................................
File vdsm/sourceRouteThread.py
Line 34:                 sourceRoute.configure(ip, mask, gateway)
Line 35:             else:
Line 36:                 sourceRoute.remove()
Line 37: 
Line 38:             sourceRoute.removeVDSMInterfaceTracking()
it's possible only call removeVDSMInterfaceTracking when it run ifdown? Then you don't see add interface tracking when it's removed in ifcfg.py
Line 39: 
Line 40:         os.remove(sourceRouteFilePath)
Line 41: 
Line 42:     def process_IN_CLOSE_WRITE(self, event):


-- 
To view, visit http://gerrit.ovirt.org/16692
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic5af431909427dc7488875f0cb14fe4361657a83
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list