diff options
author | David Cantrell <dcantrell@redhat.com> | 2006-10-04 18:17:07 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2006-10-04 18:17:07 +0000 |
commit | 641c267cc2f3b6ea40aa323629cb328c54714cea (patch) | |
tree | 204cf3ab3ae05291af8da0a03cc59e455b5fde0b /iw | |
parent | 41fd58e49db24b94324218f1763c5674cbead34a (diff) | |
download | anaconda-641c267cc2f3b6ea40aa323629cb328c54714cea.tar.gz anaconda-641c267cc2f3b6ea40aa323629cb328c54714cea.tar.xz anaconda-641c267cc2f3b6ea40aa323629cb328c54714cea.zip |
* network.py (sanityCheckIPString): Test IP more accurately to
determine address family. Clean up error messages to make things
more clear. Have a catch-all else case that returns the given
IP address in an invalid message in the form of an IPError
exception.
* iw/network_gui.py (NetworkWindow.handleIPError): Display the
field description in the title bar rather than the field name.
Call __str__() on the msg parameter since msg could be an IPError
exception or a string.
* iw/network_gui.py (NetworkWindow): Set the IPv6 address entry
field to just the address portion of the value that's written
out to the ifcfg-ethX file (remove the /prefix part). Make sure
we set the ipv6prefix in the entrys hash and write out a new
ipv6addr with the new prefix in case the user changed it.
Diffstat (limited to 'iw')
-rw-r--r-- | iw/network_gui.py | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/iw/network_gui.py b/iw/network_gui.py index ac5aa45ed..965ad71d4 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -176,10 +176,16 @@ class NetworkWindow(InstallWindow): newfield = field self.intf.messageWindow(_("Error With Data"), - _("A value is required for the field \"%s\".") % (newfield,)) + _("A value is required for the field %s.") % (newfield,)) def handleIPError(self, field, msg): - self.intf.messageWindow(_("Error With %s Data") % (field,), msg) + try: + newfield = descr[field] + except: + newfield = field + + self.intf.messageWindow(_("Error With %s Data") % (newfield,), + _("%s") % msg.__str__()) def handleBroadCastError(self): self.intf.messageWindow(_("Error With Data"), @@ -362,7 +368,15 @@ class NetworkWindow(InstallWindow): v6list.append(gtk.Entry()) v6list[1].set_width_chars(41) - v6list[1].set_text(self.devices[dev].get('ipv6addr')) + + ipv6addr = self.devices[dev].get('ipv6addr') + brk = ipv6addr.find('/') + if brk != -1: + ipv6addr = ipv6addr[0:brk] + brk += 1 + ipv6prefix = ipv6addr[brk:] + + v6list[1].set_text(ipv6addr) entrys['ipv6addr'] = v6list[1] ipTable.attach(v6list[1], 1, 2, 2, 3, xpadding=0, ypadding=0) @@ -541,14 +555,14 @@ class NetworkWindow(InstallWindow): continue for t in entrys.keys(): - if t == 'ipv6prefix': - continue - if tmpvals.has_key(t): if t == 'ipv6addr': if entrys['ipv6prefix'] is not None: + a = tmpvals[t] + if a.find('/') != -1: + a = a[0:a.find('/')] p = entrys['ipv6prefix'].get_text() - q = "%s/%s" % (tmpvals[t], p,) + q = "%s/%s" % (a, p,) else: q = "%s" % (tmpvals[t],) |