[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/2] Remove a couple redundant network bring up calls.



At least, I believe these are redundant and likely unreachable.  I don't
think there's a way to get to these places on a network install without any
network active.  These calls have all the marks of desperation to cover th
bases without thinking about whether they're even valid or not.
---
 yuminstall.py |   39 +++++++++++++--------------------------
 1 files changed, 13 insertions(+), 26 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 9d70600..0d773f7 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -786,13 +786,6 @@ class AnacondaYum(YumSorter):
             buttons = [_("Re_boot"), _("_Retry")]
 
         pkgFile = to_unicode(os.path.basename(package.remote_path))
-
-        if package.repo.needsNetwork() and not network.hasActiveNetDev():
-            if not self.anaconda.intf.enableNetwork():
-                return
-
-            urlgrabber.grabber.reset_curl_obj()
-
         rc = self.anaconda.intf.messageWindow(_("Error"),
                    _("The file %s cannot be opened.  This is due to a missing "
                      "file, a corrupt package or corrupt media.  Please "
@@ -1150,18 +1143,19 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
         # If any enabled repositories require networking, go ahead and bring
         # it up now.  No need to have people wait for the timeout when we
         # know this in advance.
-        if len(filter(lambda r: r.needsNetwork(), self.ayum.repos.listEnabled())) > 0 and \
-           not network.hasActiveNetDev():
-               if not anaconda.intf.enableNetwork():
-                   anaconda.intf.messageWindow(_("No Network Available"),
-                       _("Some of your software repositories require "
-                         "networking, but there was an error enabling the "
-                         "network on your system."),
-                       type="custom", custom_icon="error",
-                       custom_buttons=[_("_Exit installer")])
-                   sys.exit(1)
-
-               urlgrabber.grabber.reset_curl_obj()
+        for repo in self.ayum.repos.listEnabled():
+            if repo.needsNetwork() and not network.hasActiveNetDev():
+                if not anaconda.intf.enableNetwork():
+                    anaconda.intf.messageWindow(_("No Network Available"),
+                        _("Some of your software repositories require "
+                          "networking, but there was an error enabling the "
+                          "network on your system."),
+                        type="custom", custom_icon="error",
+                        custom_buttons=[_("_Exit installer")])
+                    sys.exit(1)
+
+                urlgrabber.grabber.reset_curl_obj()
+                break
 
         self.doRepoSetup(anaconda)
         self.doSackSetup(anaconda)
@@ -1238,13 +1232,6 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
                     waitwin.pop()
                 except RepoError, e:
                     waitwin.pop()
-                    if repo.needsNetwork() and not network.hasActiveNetDev():
-                        if anaconda.intf.enableNetwork():
-                            repo.mirrorlistparsed = False
-                            continue 
-
-                        urlgrabber.grabber.reset_curl_obj()
-
                     buttons = [_("_Exit installer"), _("Edit"), _("_Retry")]
                 else:
                     break # success
-- 
1.6.5.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]