[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     |    1 +
 network.py |   14 ++++++++++++++
 text.py    |    5 +++--
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/gui.py b/gui.py
index e30be09..7790aa0 100755
--- a/gui.py
+++ b/gui.py
@@ -1174,6 +1174,7 @@ class InstallInterface(InstallInterfaceBase):
 
     def saveExceptionWindow(self, accountManager, signature):
         from meh.ui.gui import SaveExceptionWindow
+        network.saveExceptionEnableNetwork(self)
         win = SaveExceptionWindow (accountManager, signature)
         win.run()
 
diff --git a/network.py b/network.py
index c488086..df82152 100644
--- a/network.py
+++ b/network.py
@@ -33,6 +33,7 @@ import struct
 import os
 import time
 import dbus
+import urlgrabber
 from flags import flags
 from simpleconfig import IfcfgFile
 import anaconda_log
@@ -820,3 +821,16 @@ def ifaceForHostIP(host):
 
     return routeInfo[routeInfo.index("dev") + 1]
 
+def saveExceptionEnableNetwork(intf):
+    if not hasActiveNetDev():
+        if intf.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 intf.enableNetwork():
+                intf.messageWindow(_("No Network Available"),
+                                   _("Remote exception saving methods will not work."))
+            else:
+                urlgrabber.grabber.reset_curl_obj()
diff --git a/text.py b/text.py
index e07553d..afb1b0f 100644
--- a/text.py
+++ b/text.py
@@ -35,7 +35,7 @@ from language import expandLangs
 from flags import flags
 from constants_text import *
 from constants import *
-from network import hasActiveNetDev
+import network
 from installinterfacebase import InstallInterfaceBase
 import imputil
 
@@ -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,7 @@ class InstallInterface(InstallInterfaceBase):
 
     def saveExceptionWindow(self, accountManager, signature, *args, **kwargs):
         from meh.ui.text import SaveExceptionWindow
+        network.saveExceptionEnableNetwork(self)
         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]