[PATCH 2/6] Don't ask for VNC if we can't do it

Jesse Keating jkeating at redhat.com
Fri Sep 28 19:17:43 UTC 2012


Moves the checks that were in the VNC question out to the prep for the
VNC question.  We don't get a simple true/false out of the question
anymore.
---
 anaconda | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/anaconda b/anaconda
index 0e47714..411bb07 100755
--- a/anaconda
+++ b/anaconda
@@ -406,6 +406,7 @@ def setupDisplay(anaconda, opts):
     from pyanaconda.ui.tui.simpleline import App
     from pyanaconda.ui.tui.spokes.askvnc import AskVNCSpoke
     from pykickstart.constants import DISPLAY_MODE_TEXT
+    from pyanaconda import network
 
     graphical_failed = 0
     vncS = vnc.VncServer()          # The vnc Server object.
@@ -460,6 +461,14 @@ def setupDisplay(anaconda, opts):
     if anaconda.ksdata.displaymode.displayMode == DISPLAY_MODE_TEXT:
         flags.vncquestion = False
 
+    # disable VNC question if we don't have network
+    if not network.hasActiveNetDev():
+        flags.vncquestion = False
+
+    # disable VNC question if we don't have X
+    if not os.access('/usr/bin/Xvnc', os.X_OK):
+        flags.vncquestion = False
+
     if os.environ.has_key('DISPLAY'):
         flags.preexisting_x11 = True
 
@@ -549,7 +558,7 @@ def setupDisplay(anaconda, opts):
     set_x_resolution(opts.runres)
 
     if anaconda.displayMode == 't' and graphical_failed and \
-         not anaconda.ksdata.vnc.enabled:
+         flags.vncquestion and not anaconda.ksdata.vnc.enabled:
         app = App("VNC Question")
         spoke = AskVNCSpoke(app, anaconda.ksdata)
         app.schedule_screen(spoke)
-- 
1.7.11.4



More information about the anaconda-patches mailing list