diff options
author | Jeremy Katz <katzj@redhat.com> | 2006-06-23 19:48:02 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2006-06-23 19:48:02 +0000 |
commit | f8dad5e0b913f84a5ebc29c88abd8dd7e4db244d (patch) | |
tree | 093a1ac1810d3b1789d7d93f4aa2c96003c07fa7 /textw | |
parent | de2c1f58fe77b815c39b5fa37ce06d63eca81468 (diff) | |
download | anaconda-f8dad5e0b913f84a5ebc29c88abd8dd7e4db244d.tar.gz anaconda-f8dad5e0b913f84a5ebc29c88abd8dd7e4db244d.tar.xz anaconda-f8dad5e0b913f84a5ebc29c88abd8dd7e4db244d.zip |
2006-06-23 Jeremy Katz <katzj@redhat.com>
* textw/network_text.py (sanityCheckIPString): Fix for internal
API changes (#196154)
Diffstat (limited to 'textw')
-rw-r--r-- | textw/network_text.py | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/textw/network_text.py b/textw/network_text.py index 6f1f4b712..8fb911b0b 100644 --- a/textw/network_text.py +++ b/textw/network_text.py @@ -18,8 +18,7 @@ import iutil import os import isys import string -from network import isPtpDev, anyUsingDHCP, sanityCheckIPString -from network import sanityCheckHostname +import network from snack import * from constants_text import * from constants import * @@ -31,6 +30,12 @@ def badIPDisplay(screen, the_ip): buttons = [ _("OK") ]) return +def sanityCheckIPString(val): + try: + network.sanityCheckIPString(val) + except IPError, err: + return err + class NetworkDeviceWindow: def setsensitive(self): if self.dhcpCb.selected (): @@ -51,7 +56,7 @@ class NetworkDeviceWindow: self.entries["netmask"].set (mask) - def runScreen(self, screen, network, dev, showonboot=1): + def runScreen(self, screen, net, dev, showonboot=1): boot = dev.get("bootproto") onboot = dev.get("onboot") @@ -66,7 +71,7 @@ class NetworkDeviceWindow: options = [(_("IP Address"), "ipaddr", 1), (_("Netmask"), "netmask", 1)] - if (isPtpDev(dev.info["DEVICE"])): + if (network.isPtpDev(dev.info["DEVICE"])): newopt = (_("Point to Point (IP)"), "remip", 1) options.append(newopt) @@ -251,7 +256,7 @@ class NetworkGlobalWindow: # we don't let you set gateway/dns if you've got any interfaces # using dhcp (for better or worse) - if anyUsingDHCP(devices): + if network.anyUsingDHCP(devices): return INSTALL_NOOP thegrid = Grid(2, 4) @@ -297,25 +302,29 @@ class NetworkGlobalWindow: return INSTALL_BACK val = gwEntry.value() - if val and sanityCheckIPString(val) is None: + if val and sanityCheckIPString(val) is not None: + screen.suspend() + print "gw", val, sanityCheckIPString(val) + import pdb; pdb.set_trace() + screen.resume() badIPDisplay(screen, val) continue anaconda.id.network.gateway = val val = ns1Entry.value() - if val and sanityCheckIPString(val) is None: + if val and sanityCheckIPString(val) is not None: badIPDisplay(screen, val) continue anaconda.id.network.primaryNS = val val = ns2Entry.value() - if val and sanityCheckIPString(val) is None: + if val and sanityCheckIPString(val) is not None: badIPDisplay(screen, val) continue anaconda.id.network.secondaryNS = val val = ns3Entry.value() - if val and sanityCheckIPString(val) is None: + if val and sanityCheckIPString(val) is not None: badIPDisplay(screen, val) continue anaconda.id.network.ternaryNS = val @@ -340,7 +349,7 @@ class HostnameWindow: return INSTALL_NOOP # figure out if the hostname is currently manually set - if anyUsingDHCP(devices): + if network.anyUsingDHCP(devices): if (anaconda.id.network.hostname != "localhost.localdomain" and anaconda.id.network.overrideDHCPhostname): manual = 1 @@ -364,7 +373,7 @@ class HostnameWindow: anchorLeft = 1) # disable the dhcp if we don't have any dhcp - if anyUsingDHCP(devices): + if network.anyUsingDHCP(devices): autoCb.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_RESET) else: autoCb.w.checkboxSetFlags(FLAG_DISABLED, FLAGS_SET) @@ -407,7 +416,7 @@ class HostnameWindow: _("You have not specified a hostname."), buttons = [ _("OK") ]) continue - neterrors = sanityCheckHostname(hname) + neterrors = network.sanityCheckHostname(hname) if neterrors is not None: ButtonChoiceWindow(screen, _("Invalid Hostname"), _("The hostname \"%s\" is not valid " |