diff options
author | David Cantrell <dcantrell@redhat.com> | 2006-09-06 18:20:08 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2006-09-06 18:20:08 +0000 |
commit | 8ffb06e432e3432efe95796730ef9f879c1d1957 (patch) | |
tree | 2d26277f3ac33c28ecbff0cab124b208364d7033 /iw | |
parent | d2e8a32bd2e7146d90106867a12554be50559fbe (diff) | |
download | anaconda-8ffb06e432e3432efe95796730ef9f879c1d1957.tar.gz anaconda-8ffb06e432e3432efe95796730ef9f879c1d1957.tar.xz anaconda-8ffb06e432e3432efe95796730ef9f879c1d1957.zip |
* isys/isys.py: Remove inet_aton() and inet_ntoa(). Replaced calls
to these functions with inet_pton() and inet_ntop().
* isys/isys.py: Added inet_convertNetmaskToPrefix() utility function
to convert dotted-quad IPv4 netmasks to CIDR prefix values.
* iw/network_gui.py (createIPRepr): Renamed to createIPV4Repr() and
have it write out ip/prefix rather than ip/netmask.
* iw/network_gui.py (createIPV4Repr): Added to handle IPv6 write
outs to the tree store.
* iw/network_gui.py (NetworkWindow.editDevice): Add IPv6 info to
the tree store.
* iw/network_gui.py (NetworkWindow.setupDevices): Initialize tree
store with IPv4 and IPv6 information.
Diffstat (limited to 'iw')
-rw-r--r-- | iw/network_gui.py | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/iw/network_gui.py b/iw/network_gui.py index 6c94661f0..bbf4aec96 100644 --- a/iw/network_gui.py +++ b/iw/network_gui.py @@ -485,7 +485,8 @@ class NetworkWindow(InstallWindow): self.devices[dev].set(('bootproto', bootproto)) self.devices[dev].set(('ONBOOT', onboot)) model.set_value(iter, 0, onboot == 'yes') - model.set_value(iter, 2, self.createIPRepr(self.devices[dev])) + model.set_value(iter, 2, self.createIPV4Repr(self.devices[dev])) + model.set_value(iter, 3, self.createIPV6Repr(self.devices[dev])) editWin.destroy() @@ -494,12 +495,22 @@ class NetworkWindow(InstallWindow): return - def createIPRepr(self, device): + def createIPV4Repr(self, device): bootproto = device.get("bootproto") if bootproto == "dhcp": ip = "DHCP" else: - ip = "%s/%s" % (device.get("ipaddr"), device.get("netmask")) + prefix = isys.inet_convertNetmaskToPrefix(device.get("netmask")) + ip = "%s/%s" % (device.get("ipaddr"), prefix,) + + return ip + + def createIPV6Repr(self, device): + bootproto = device.get("bootproto") + if bootproto == "dhcp": + ip = "DHCP" + else: + ip = "%s" % (device.get("ipv6addr"),) return ip @@ -550,6 +561,7 @@ class NetworkWindow(InstallWindow): store = gtk.TreeStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, + gobject.TYPE_STRING, gobject.TYPE_STRING) self.ethdevices = NetworkDeviceCheckList(3, store, clickCB=self.onbootToggleCB) @@ -566,7 +578,8 @@ class NetworkWindow(InstallWindow): bootproto = 'dhcp' self.devices[device].set(("bootproto", bootproto)) - ip = self.createIPRepr(self.devices[device]) + ipv4 = self.createIPV4Repr(self.devices[device]) + ipv6 = self.createIPV6Repr(self.devices[device]) # only if we want descriptions in the master device list # currently too wide, but might be able to do it with a tooltip on @@ -580,7 +593,7 @@ class NetworkWindow(InstallWindow): # self.ethdevices.append_row((device, ip, descr), active) # # use this for now - self.ethdevices.append_row((device, ip), active) + self.ethdevices.append_row((device, ipv4, ipv6), active) num += 1 |