Change in vdsm[master]: WIP: Multiple Gateways[3/2]: Re-did comms between dhclient a...
asegurap at redhat.com
asegurap at redhat.com
Fri Jul 5 09:15:33 UTC 2013
Antoni Segura Puimedon has posted comments on this change.
Change subject: WIP: Multiple Gateways[3/2]: Re-did comms between dhclient and vdsm
......................................................................
Patch Set 2: I would prefer that you didn't submit this
(4 inline comments)
....................................................
File vdsm/sourceRoute.sh
Line 1: #!/bin/bash
Line 2:
Line 3: sourceRoute_config() {
Line 4: echo "configure" $new_ip_address $new_subnet_mask $new_routers \
Line 5: $interface > /var/run/vdsm/sourceRoutes/$interface
I don't know if it can bite us, but we should maybe consider what happens when an unexpected dhcp ifup or a lease renewal happens while sourceRouteThread.py is reading from the file.
Maybe we could name the file $interface_timestamp or something.
(same for restore)
Line 6: }
Line 7:
Line 8: sourceRoute_restore() {
Line 9: echo "remove" $interface > /var/run/vdsm/sourceRoutes/$interface
....................................................
File vdsm/sourceRouteThread.py
Line 6: from netconf.iproute2 import Iproute2
Line 7: from sourceRoute import DynamicSourceRoute
Line 8:
Line 9:
Line 10: SOURCE_ROUTES_FOLDER = os.path.join(os.sep, 'var', 'run', 'vdsm',
I don't think we need to support windows, thus, it is safe to have '/var/run/vdsm/sourceRoutes/'
Line 11: 'sourceRoutes', '')
Line 12: configurator = Iproute2()
Line 13:
Line 14:
Line 11: 'sourceRoutes', '')
Line 12: configurator = Iproute2()
Line 13:
Line 14:
Line 15: class dhClientEventHandler(pyinotify.ProcessEvent):
Class names should start with a capital letter.
Line 16: def process_IN_CREATE(self, event):
Line 17: with open(event.pathname, 'r') as sourceRouteFile:
Line 18: sourceRouteContents = sourceRouteFile.read().split()
Line 19: action = sourceRouteContents[0]
Line 19: action = sourceRouteContents[0]
Line 20: device = sourceRouteContents[-1]
Line 21: sourceRoute = DynamicSourceRoute(device, configurator)
Line 22:
Line 23: if action == 'configure':
For lease renewal, the configure action should check if there are already source routes for the device and remove them before (or after) we do this.
Line 24: ip = sourceRouteContents[1]
Line 25: mask = sourceRouteContents[2]
Line 26: gateway = sourceRouteContents[3]
Line 27: sourceRoute.configure(ip, mask, gateway)
--
To view, visit http://gerrit.ovirt.org/16461
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib7a47a680bfbfe285f708290de97e8f08714695a
Gerrit-PatchSet: 2
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: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list