Change in vdsm[master]: netconf: Add dhcp support for iproute2 configurator
wudxw at linux.vnet.ibm.com
wudxw at linux.vnet.ibm.com
Tue Aug 6 05:34:33 UTC 2013
Mark Wu has posted comments on this change.
Change subject: netconf: Add dhcp support for iproute2 configurator
......................................................................
Patch Set 4:
(4 comments)
....................................................
File vdsm/netconf/iproute2.py
Line 172: if rc:
Line 173: logging.error('Restore network configuration failed: %s', err)
Line 174:
Line 175:
Line 176: class DhcpClient():
Done
Line 177: PID_FILE = '/var/run/dhclient-%s.pid'
Line 178: LEASE_DIR = '/var/lib/dhclient/'
Line 179: LEASE_FILE = LEASE_DIR + 'dhclient-%s.lease'
Line 180: DHCLIENT = CommandPath('dhclient', '/sbin/dhclient')
Line 197: t = threading.Thread(target=self._dhclient, name='vdsm-dhclient-%s'
Line 198: % self.iface)
Line 199: t.daemon = True
Line 200: t.start()
Line 201: else:
We have an option 'blockingdhcp' in setupNetworks API. So if the client specify blockingdhcp to True, then it will run into the case of sync.
Line 202: rc, out, err = self._dhclient()
Line 203: return rc
Line 204:
Line 205: def shutdown(self):
Line 205: def shutdown(self):
Line 206: try:
Line 207: pid = int(open(self.pidFile).readline().strip())
Line 208: except IOError as e:
Line 209: if e.errno == os.errno.ENOENT:
I agree with you. thanks for the improvement. I will rebase this patch after http://gerrit.ovirt.org/#/c/17661/ is merged.
Line 210: pass
Line 211: else:
Line 212: raise
Line 213: else:
Line 250: def ifup(self, iface):
Line 251: ipwrapper.linkSet(['dev', iface.name, 'up'])
Line 252: _, _, _, bootproto, async = iface.getIpConfig()
Line 253: if bootproto == 'dhcp':
Line 254: dhclient = DhcpClient(iface.name)
Giuseppe, sorry, I don't understand your point. I am willing to make the code friendly to test. Could you please elaborate it a little bit? Thanks.
Line 255: dhclient.start(async)
Line 256:
Line 257: def ifdown(self, iface):
Line 258: ipwrapper.linkSet(['dev', iface.name, 'down'])
--
To view, visit http://gerrit.ovirt.org/15492
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: Iea88e8693e47fa51edb89c33344332c88c5c964d
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap 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
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list