summaryrefslogtreecommitdiffstats
path: root/rescue.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2008-10-10 16:10:49 -0400
committerChris Lumens <clumens@redhat.com>2008-10-10 16:11:03 -0400
commit1d54e2301af154938b81610bc18f7ef34c48d7c7 (patch)
tree2f6fb67c42ea8b38ff29a24ed34a386e7ca83404 /rescue.py
parentc79faccc50470bd9fac81930f91d3b4fd9651165 (diff)
downloadanaconda-1d54e2301af154938b81610bc18f7ef34c48d7c7.tar.gz
anaconda-1d54e2301af154938b81610bc18f7ef34c48d7c7.tar.xz
anaconda-1d54e2301af154938b81610bc18f7ef34c48d7c7.zip
Fix bringing up the network in rescue mode (#466523).
Diffstat (limited to 'rescue.py')
-rw-r--r--rescue.py56
1 files changed, 12 insertions, 44 deletions
diff --git a/rescue.py b/rescue.py
index 4cec51b5e..a9624ec11 100644
--- a/rescue.py
+++ b/rescue.py
@@ -81,6 +81,12 @@ class RescueInterface:
else:
return OkCancelWindow(self.screen, title, text)
+ def enableNetwork(self, anaconda):
+ from netconfig_text import NetworkConfiguratorText
+ w = NetworkConfiguratorText(self.screen, anaconda)
+ ret = w.run()
+ return ret != INSTALL_BACK
+
def passphraseEntryWindow(self, device):
w = PassphraseEntryWindow(self.screen, device)
(passphrase, isglobal) = w.run()
@@ -178,7 +184,7 @@ def runRescue(anaconda, instClass):
if not network.hasActiveNetDev():
screen = SnackScreen()
- while 1:
+ while True:
rc = ButtonChoiceWindow(screen, _("Setup Networking"),
_("Do you want to start the network interfaces on "
"this system?"), [_("Yes"), _("No")])
@@ -186,49 +192,11 @@ def runRescue(anaconda, instClass):
if rc != string.lower(_("No")):
anaconda.intf = RescueInterface(screen)
- # need to call sequence of screens, have to look in text.py
- #
- # this code is based on main loop in text.py, and if it
- # or the network step in dispatch.py change significantly
- # then this will certainly break
- pyfile = "network_text"
- classNames = ("NetworkDeviceWindow", "NetworkGlobalWindow")
-
- lastrc = INSTALL_OK
- step = 0
- anaconda.dir = 1
-
- while 1:
- s = "from %s import %s; nextWindow = %s" % \
- (pyfile, classNames[step], classNames[step])
- exec s
-
- win = nextWindow()
-
- rc = win(screen, anaconda, showonboot = 0)
-
- if rc == INSTALL_NOOP:
- rc = lastrc
-
- if rc == INSTALL_BACK:
- step = step - 1
- anaconda.dir = - 1
- elif rc == INSTALL_OK:
- step = step + 1
- anaconda.dir = 1
-
- lastrc = rc
-
- if step == -1:
- ButtonChoiceWindow(screen, _("Cancelled"),
- _("I can't go to the previous step "
- "from here. You will have to try "
- "again."),
- buttons=[_("OK")])
- anaconda.dir = 1
- step = 0
- elif step >= len(classNames):
- break
+ if not anaconda.intf.enableNetwork(anaconda):
+ anaconda.intf.messageWindow(_("No Network Available"),
+ _("Unable to activate a networking device. Networking "
+ "will not be available in rescue mode."))
+ break
startNetworking(anaconda.id.network, anaconda.intf)
break