[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[PATCH] Avoid tracebacks when filling in static network config fields (#474275)
- From: David Cantrell <dcantrell redhat com>
- To: anaconda-devel-list redhat com
- Cc:
- Subject: [PATCH] Avoid tracebacks when filling in static network config fields (#474275)
- Date: Thu, 4 Dec 2008 17:30:53 -1000
If the user changes to static network configuration, we may or may not
have values already that we can populate the fields with. If we do,
take them. Otherwise, leave the field blank and keep going.
---
iw/netconfig_dialog.py | 27 +++++++++++++++++++++++----
1 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/iw/netconfig_dialog.py b/iw/netconfig_dialog.py
index 6a8bdc7..4818171 100644
--- a/iw/netconfig_dialog.py
+++ b/iw/netconfig_dialog.py
@@ -74,10 +74,29 @@ class NetworkConfigurator:
self.xml.get_widget("dhcpCheckbutton").set_active(False)
# FIXME: need to set ipv6 here too once we have that
- if netdev.get('IPADDR'): self.xml.get_widget("ipv4Address").set_text(netdev.get('IPADDR'))
- if netdev.get('NETMASK'): self.xml.get_widget("ipv4Netmask").set_text(netdev.get('NETMASK'))
- if self.network.gateway: self.xml.get_widget("gatewayEntry").set_text(self.network.gateway)
- if self.network.primaryNS: self.xml.get_widget("nameserverEntry").set_text(self.network.primaryNS)
+ try:
+ if netdev.get('IPADDR'):
+ self.xml.get_widget("ipv4Address").set_text(netdev.get('IPADDR'))
+ except:
+ pass
+
+ try:
+ if netdev.get('NETMASK'):
+ self.xml.get_widget("ipv4Netmask").set_text(netdev.get('NETMASK'))
+ except:
+ pass
+
+ try:
+ if self.network.gateway:
+ self.xml.get_widget("gatewayEntry").set_text(self.network.gateway)
+ except:
+ pass
+
+ try:
+ if self.network.primaryNS:
+ self.xml.get_widget("nameserverEntry").set_text(self.network.primaryNS)
+ except:
+ pass
def _ipv4Toggled(self, cb):
if self.xml.get_widget("dhcpCheckbutton").get_active():
--
1.6.0.3
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]