Re: [PATCH] Do not raise UI dialog in stage2 if network is set in ks (#487503)

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

 



Alternative patch where ks network settings are not handled in enableNetworking UI method, and so have different behaviour (ask or don't ask in case of fail) in different places where we need to bring up network (exception dialog, repos
setting, UI repo editing).

Radek
>From 0567796171de79ddab1a59afafe2b6cd0deed0ca Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@xxxxxxxxxx>
Date: Mon, 27 Jul 2009 17:45:08 +0200
Subject: [PATCH] Do not raise UI dialog in stage2 if network is set in ks (#487503)

If we have network set in kickstart use it, and if we fail:
- ask with dialog
  - in exception handling dialog,
  - when adding/removing repositories in UI
- do not ask
  - in yuminstall.py (backend setup, configuring repositories...)

In rescue always ask.
---
 exception.py   |   10 ++++++++--
 iw/task_gui.py |   15 ++++++++++++---
 yuminstall.py  |   31 ++++++++++++++++++++++++-------
 3 files changed, 44 insertions(+), 12 deletions(-)

diff --git a/exception.py b/exception.py
index dffb7cb..ebbb0b3 100644
--- a/exception.py
+++ b/exception.py
@@ -539,7 +539,10 @@ def runSaveDialog(anaconda, exn):
                     continue
             elif saveWin.saveToRemote():
                 if not hasActiveNetDev():
-                    if not anaconda.intf.enableNetwork(anaconda):
+                    # if network is set in ks and fails, we offer network conf dialog
+                    if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                            not anaconda.id.network.bringUp()) and
+                        not anaconda.intf.enableNetwork(anaconda)):
                         anaconda.intf.messageWindow(_("No Network Available"),
                             _("Cannot save a bug report since there is no "
                               "active networking device available."))
@@ -562,7 +565,10 @@ def runSaveDialog(anaconda, exn):
                     continue
             else:
                 if not hasActiveNetDev():
-                    if not anaconda.intf.enableNetwork(anaconda):
+                    # if network is set in ks and fails, we offer network conf dialog
+                    if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                            not anaconda.id.network.bringUp()) and
+                        not anaconda.intf.enableNetwork(anaconda)):
                         anaconda.intf.messageWindow(_("No Network Available"),
                             _("Cannot save a bug report since there is no "
                               "active networking device available."))
diff --git a/iw/task_gui.py b/iw/task_gui.py
index a91209a..4a2b8e0 100644
--- a/iw/task_gui.py
+++ b/iw/task_gui.py
@@ -488,7 +488,10 @@ class TaskWindow(InstallWindow):
             return
 
         if repo.needsNetwork() and not network.hasActiveNetDev():
-            if not self.anaconda.intf.enableNetwork(self.anaconda):
+            # if network is set in ks and fails, we offer network conf dialog
+            if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                    not anaconda.id.network.bringUp()) and
+                not self.anaconda.intf.enableNetwork(self.anaconda)):
                 return gtk.RESPONSE_CANCEL
 
         dialog = RepoEditor(self.anaconda, repo)
@@ -504,7 +507,10 @@ class TaskWindow(InstallWindow):
             return gtk.RESPONSE_CANCEL
 
         if dialog.repo.needsNetwork() and not network.hasActiveNetDev():
-            if not self.anaconda.intf.enableNetwork(self.anaconda):
+            # if network is set in ks and fails, we offer network conf dialog
+            if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                    not anaconda.id.network.bringUp()) and
+                not self.anaconda.intf.enableNetwork(self.anaconda)):
                 return gtk.RESPONSE_CANCEL
 
         s = self.xml.get_widget("repoList").get_model()
@@ -536,7 +542,10 @@ class TaskWindow(InstallWindow):
 
         if not wasChecked:
             if repo.needsNetwork() and not network.hasActiveNetDev():
-                if not self.anaconda.intf.enableNetwork(self.anaconda):
+                # if network is set in ks and fails, we offer network conf dialog
+                if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                        not anaconda.id.network.bringUp()) and
+                    not self.anaconda.intf.enableNetwork(self.anaconda)):
                     return
 
             repo.enable()
diff --git a/yuminstall.py b/yuminstall.py
index b13e443..d920111 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -406,7 +406,10 @@ class AnacondaYum(YumSorter):
 
                 # Calling _switchImage takes care of mounting /mnt/isodir first.
                 if not network.hasActiveNetDev():
-                    if not self.anaconda.intf.enableNetwork(self.anaconda):
+                    # if there are ks network settings and they fail, don't ask in UI
+                    if ((anaconda.isKickstart and anaconda.id.ksdata.network and 
+                            not anaconda.id.network.bringUp()) or
+                        not self.anaconda.intf.enableNetwork(self.anaconda)):
                         self._baseRepoURL = None
                         return
 
@@ -416,7 +419,10 @@ class AnacondaYum(YumSorter):
                 self._baseRepoURL = m
             elif m.startswith("nfs:"):
                 if not network.hasActiveNetDev():
-                    if not self.anaconda.intf.enableNetwork(self.anaconda):
+                    # if there are ks network settings and they fail, don't ask in UI
+                    if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                            not anaconda.id.network.bringUp()) or
+                        not self.anaconda.intf.enableNetwork(self.anaconda)):
                         self._baseRepoURL = None
 
                 isys.mount(m[4:], self.tree, "nfs")
@@ -680,7 +686,10 @@ class AnacondaYum(YumSorter):
         pkgFile = to_unicode(os.path.basename(package.remote_path))
 
         if package.repo.needsNetwork() and not network.hasActiveNetDev():
-            if not self.anaconda.intf.enableNetwork(self.anaconda):
+            # if there are ks network settings and they fail, don't ask in UI
+            if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                    not anaconda.id.network.bringUp()) or
+                not self.anaconda.intf.enableNetwork(self.anaconda)):
                 return
 
         rc = self.anaconda.intf.messageWindow(_("Error"),
@@ -1043,7 +1052,10 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
         # 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):
+                # if there are ks network settings and they fail, don't ask in UI
+                if ((anaconda.isKickstart and anaconda.id.ksdata.network and
+                        not anaconda.id.network.bringUp()) or
+                    not self.anaconda.intf.enableNetwork(self.anaconda)):
                    anaconda.intf.messageWindow(_("No Network Available"),
                        _("Some of your software repositories require "
                          "networking, but there was an error enabling the "
@@ -1128,9 +1140,14 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
                 except RepoError, e:
                     waitwin.pop()
                     if repo.needsNetwork() and not network.hasActiveNetDev():
-                        if anaconda.intf.enableNetwork(anaconda):
-                            repo.mirrorlistparsed = False
-                            continue
+                        # if there are ks network settings and they fail, don't ask in UI
+                        if (anaconda.isKickstart and anaconda.id.ksdata.network):
+                            if anaconda.id.network.bringUp():
+                                repo.mirrorlistparsed = False
+                                continue
+                        elif anaconda.intf.enableNetwork(anaconda):
+                                repo.mirrorlistparsed = False
+                                continue
 
                     buttons = [_("_Exit installer"), _("Edit"), _("_Retry")]
                 else:
-- 
1.6.0.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux