1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

ifreload causes unnecessary dhcp restart for eth0

Ticket: CM-5730
Reviewed By: roopa
Testing Done: tested change on Sean and Jason's lab setup

The dhcp restart on all interfaces using dhcp causes a reconnection
for NTP and in addition, a recent addition of rack management packages
(CM-5782) added ntp and a exit-hook script that also interrupted NTP
for a second time.   This patch will check for dhclient running (IPv4 and IPv6)
and not restart dhcp if it's already running.
This commit is contained in:
Sam Tannous
2015-06-30 13:47:08 -04:00
parent 914caaa2d0
commit 9e1b366e33

View File

@@ -23,6 +23,12 @@ class dhcp(moduleBase):
self.ipcmd = None
def _up(self, ifaceobj):
# if dhclient is already running do not stop and start it
if self.dhclientcmd.is_running(ifaceobj.name) or \
self.dhclientcmd.is_running6(ifaceobj.name):
self.logger.info('dhclient already running on %s. Not restarting.' % \
ifaceobj.name)
return
try:
if ifaceobj.addr_family == 'inet':
# First release any existing dhclient processes