1
0
mirror of https://github.com/gryf/wicd.git synced 2026-01-05 21:34:16 +01:00

Merged in r331 of mainline 1.6.

This commit is contained in:
Andrew Psaltis
2009-03-22 00:22:07 -04:00

View File

@@ -469,7 +469,7 @@ class BaseInterface(object):
print 'DHCP connection failed' print 'DHCP connection failed'
return 'dhcp_failed' return 'dhcp_failed'
@neediface @neediface(False)
def StartDHCP(self): def StartDHCP(self):
""" Start the DHCP client to obtain an IP address. """ Start the DHCP client to obtain an IP address.
@@ -493,14 +493,14 @@ class BaseInterface(object):
else: else:
print 'ERROR no dhclient found!' print 'ERROR no dhclient found!'
@neediface @neediface(False)
def ReleaseDHCP(self): def ReleaseDHCP(self):
""" Release the DHCP lease for this interface. """ """ Release the DHCP lease for this interface. """
cmd = self._get_dhcp_command("release") cmd = self._get_dhcp_command("release")
if self.verbose: print cmd if self.verbose: print cmd
misc.Run(cmd) misc.Run(cmd)
@neediface @neediface(False)
def DelDefaultRoute(self): def DelDefaultRoute(self):
""" Delete only the default route for a device. """ """ Delete only the default route for a device. """
if self.ip_cmd and self.flush_tool in [misc.AUTO, misc.IP]: if self.ip_cmd and self.flush_tool in [misc.AUTO, misc.IP]:
@@ -513,7 +513,7 @@ class BaseInterface(object):
if self.verbose: print cmd if self.verbose: print cmd
misc.Run(cmd) misc.Run(cmd)
@neediface @neediface(False)
def SetDNS(self, dns1=None, dns2=None, dns3=None, def SetDNS(self, dns1=None, dns2=None, dns3=None,
dns_dom=None, search_dom=None): dns_dom=None, search_dom=None):
""" Set the DNS of the system to the specified DNS servers. """ Set the DNS of the system to the specified DNS servers.
@@ -557,7 +557,7 @@ class BaseInterface(object):
resolv.write(resolv_params + "\n") resolv.write(resolv_params + "\n")
resolv.close() resolv.close()
@neediface @neediface(False)
def FlushRoutes(self): def FlushRoutes(self):
""" Flush network routes for this device. """ """ Flush network routes for this device. """
if self.ip_cmd and self.flush_tool in [misc.AUTO, misc.IP]: if self.ip_cmd and self.flush_tool in [misc.AUTO, misc.IP]:
@@ -571,7 +571,7 @@ class BaseInterface(object):
if self.verbose: print cmd if self.verbose: print cmd
misc.Run(cmd) misc.Run(cmd)
@neediface @neediface(False)
def SetDefaultRoute(self, gw): def SetDefaultRoute(self, gw):
""" Add a default route with the specified gateway. """ Add a default route with the specified gateway.