From 815fd14b3f810e6acc6df6abda909ae4b40eec1f Mon Sep 17 00:00:00 2001 From: Mike Hiretsky Date: Tue, 15 May 2012 12:03:30 +0400 Subject: [PATCH] Fix detect dhcp by udhcpc --- calculate/lib/utils/ip.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/calculate/lib/utils/ip.py b/calculate/lib/utils/ip.py index aeb8de9..cfc0c2d 100644 --- a/calculate/lib/utils/ip.py +++ b/calculate/lib/utils/ip.py @@ -153,8 +153,9 @@ def isIpInNet(checkip,*ipnets): def isDhcpIp(interface="eth0"): """Get ip by dhcp or static""" - # dhclient - if filter(lambda x:interface in x and ("dhcpcd" in x or "dhclient" in x), + # dhclients (dhcpcd, dhclient (dhcp), udhcpc (busybox) + dhcpProgs = ("dhcpcd","dhclient","udhcpc") + if filter(lambda x:interface in x and any(prog in x for prog in dhcpProgs), getRunCommands()): return True else: