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

[rhel6-branch] Attempt to bring the network up before saving a bug report (#668570).



From: Chris Lumens <clumens redhat com>

Now that we're using report, we don't have quite the level of integration
necessary to only ask to bring up the network before saving to bugzilla
or scp.  Therefore, we just need to ask for the network before saving at all
and trust that report will fail correctly should the user not bring up an
interface but still try bugzilla.
---
 gui.py  |   15 +++++++++++++++
 text.py |   17 ++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/gui.py b/gui.py
index e30be09..4203731 100755
--- a/gui.py
+++ b/gui.py
@@ -1174,6 +1174,21 @@ class InstallInterface(InstallInterfaceBase):
 
     def saveExceptionWindow(self, accountManager, signature):
         from meh.ui.gui import SaveExceptionWindow
+        import urlgrabber
+
+        if not network.hasActiveNetDev():
+            if self.messageWindow(_("Warning"),
+                   _("You do not have an active network connection.  This is "
+                     "required by some exception saving methods.  Would you "
+                     "like to configure your network now?"),
+                   type = "yesno"):
+
+                if not self.enableNetwork():
+                    self.messageWindow(_("No Network Available"),
+                                       _("Remote exception saving methods will not work."))
+                else:
+                    urlgrabber.grabber.reset_curl_obj()
+
         win = SaveExceptionWindow (accountManager, signature)
         win.run()
 
diff --git a/text.py b/text.py
index e07553d..16f8ff1 100644
--- a/text.py
+++ b/text.py
@@ -387,7 +387,7 @@ class InstallInterface(InstallInterfaceBase):
     def enableNetwork(self):
         if len(self.anaconda.id.network.netdevices) == 0:
             return False
-        from netconfig_text import NetworkConfiguratorText
+        from textw.netconfig_text import NetworkConfiguratorText
         w = NetworkConfiguratorText(self.screen, self.anaconda)
         ret = w.run()
         return ret != INSTALL_BACK
@@ -409,6 +409,21 @@ class InstallInterface(InstallInterfaceBase):
 
     def saveExceptionWindow(self, accountManager, signature, *args, **kwargs):
         from meh.ui.text import SaveExceptionWindow
+        import urlgrabber
+
+        if not hasActiveNetDev():
+            if self.messageWindow(_("Warning"), 
+                   _("You do not have an active network connection.  This is "
+                     "required by some exception saving methods.  Would you "
+                     "like to configure your network now?"),
+                   type = "yesno"):
+
+                if not self.enableNetwork():
+                    self.messageWindow(_("No Network Available"),
+                                       _("Remote exception saving methods will not work."))
+                else:
+                    urlgrabber.grabber.reset_curl_obj()
+
         win = SaveExceptionWindow (accountManager, signature, screen=self.screen,
                                    *args, **kwargs)
         win.run()
-- 
1.7.3.2


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