Permalink
Browse files

Try dhclient if dhcpcd doesn't run

  • Loading branch information...
1 parent 8dcc6c1 commit ab1ab30ff38f402511e9aee47679ea3469f34068 @akkana committed Jun 22, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 netscheme
View
12 netscheme
@@ -234,10 +234,14 @@ psk="%s"
try :
subprocess.check_call(["dhcpcd", "-G", "-C", "resolv.conf",
iface.name])
- #subprocess.call(["dhclient", "-v", iface.name])
- except subprocess.CalledProcessError, e :
- print "DHCP failed, error", e.returncode
- iface.ifconfig_down()
+ #except subprocess.CalledProcessError, e :
+ except Exception, e :
+ print "Couldn't run dhcpcd; trying dhclient"
+ try :
+ subprocess.call(["dhclient", "-v", iface.name])
+ except Exception, e :
+ print "DHCP failed, error", e.returncode
+ iface.ifconfig_down()
else :
if not self.ip :

0 comments on commit ab1ab30

Please sign in to comment.