summaryrefslogtreecommitdiffstats
path: root/textw
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2008-02-08 16:53:18 -1000
committerDavid Cantrell <dcantrell@redhat.com>2008-02-08 16:53:18 -1000
commit0b703896e838fcb9ac09b9ebaab7b432c01e65ff (patch)
tree215631f40669000519de61587bcb196003cea086 /textw
parentccf19fb85571369949c1b1a60d2afd568c1934d2 (diff)
downloadanaconda-0b703896e838fcb9ac09b9ebaab7b432c01e65ff.tar.gz
anaconda-0b703896e838fcb9ac09b9ebaab7b432c01e65ff.tar.xz
anaconda-0b703896e838fcb9ac09b9ebaab7b432c01e65ff.zip
In rescue mode, show interface configuration (#429953)
On the first run of the chooseNetworkInterface() function in rescue mode, all network interfaces are shown as UNCONFIGURED regardless of their current configuration. This also affects text mode installations in the post-install configuration steps.
Diffstat (limited to 'textw')
-rw-r--r--textw/network_text.py61
1 files changed, 35 insertions, 26 deletions
diff --git a/textw/network_text.py b/textw/network_text.py
index b01e2fb6e..20db63a2a 100644
--- a/textw/network_text.py
+++ b/textw/network_text.py
@@ -562,6 +562,36 @@ class NetworkDeviceWindow:
screen.popWindow()
return self.devices[devname]
+ def makeDevDesc(self, dev):
+ if bool(dev.get('onboot')):
+ onboot = _("Active on boot")
+ else:
+ onboot = _("Inactive on boot")
+
+ if dev.get('bootproto').lower() == 'dhcp':
+ ipv4 = _("DHCP")
+ else:
+ ipv4 = dev.get('ipaddr')
+
+ if bool(dev.get('ipv6_autoconf')):
+ ipv6 = _("Auto IPv6")
+ elif dev.get('ipv6addr').lower() == 'dhcp':
+ ipv6 = _("DHCPv6")
+ else:
+ ipv6 = dev.get('ipv6addr')
+
+ devname = dev.get('device').lower()
+ if ipv4 != '' and ipv6 != '':
+ desc = "%s, %s, %s" % (onboot, ipv4, ipv6,)
+ elif ipv4 != '' and ipv6 == '':
+ desc = "%s, %s" % (onboot, ipv4,)
+ elif ipv4 == '' and ipv6 != '':
+ desc = "%s, %s" % (onboot, ipv6,)
+ else:
+ desc = None
+
+ return desc
+
def __call__(self, screen, anaconda, showonboot=1):
self.intf = anaconda.intf
self.devListDescs = {}
@@ -570,6 +600,10 @@ class NetworkDeviceWindow:
if not self.devices:
return INSTALL_NOOP
+ # initialize device descriptions before first run of list box
+ for devname in self.devices.keys():
+ self.devListDescs[devname] = self.makeDevDesc(self.devices[devname])
+
# collect configuration data for each interface selected by the user
doConf = True
while doConf is True:
@@ -620,32 +654,7 @@ class NetworkDeviceWindow:
if rc == INSTALL_BACK:
continue
- # set the listbox description text
- if bool(dev.get('onboot')):
- onboot = _("Active on boot")
- else:
- onboot = _("Inactive on boot")
-
- if dev.get('bootproto').lower() == 'dhcp':
- ipv4 = _("DHCP")
- else:
- ipv4 = dev.get('ipaddr')
-
- if bool(dev.get('ipv6_autoconf')):
- ipv6 = _("Auto IPv6")
- elif dev.get('ipv6addr').lower() == 'dhcp':
- ipv6 = _("DHCPv6")
- else:
- ipv6 = dev.get('ipv6addr')
-
- devname = dev.get('device').lower()
- if ipv4 is not None and ipv6 is not None:
- desc = "%s, %s, %s" % (onboot, ipv4, ipv6,)
- elif ipv4 is not None and ipv6 is None:
- desc = "%s, %s" % (onboot, ipv4,)
- elif ipv4 is None and ipv6 is not None:
- desc = "%s, %s" % (onboot, ipv6,)
- self.devListDescs[devname] = desc
+ self.devListDescs[devname] = makeDevDesc(dev)
if len(self.devices) == 1 and doConf is True:
doConf = False