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
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
08-08-2011, 08:39 AM
Martin Gracik
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):
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):