summaryrefslogtreecommitdiffstats
path: root/vnc.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-09-21 14:47:48 +0000
committerJeremy Katz <katzj@redhat.com>2004-09-21 14:47:48 +0000
commit76a938a1e392c8a880057aca446e94debe01c9ce (patch)
treec4e4be3ff9046dccda7e2007c648a037b79b6a9e /vnc.py
parent93725920d87dff9fff693e044896002abf2b253f (diff)
downloadanaconda-76a938a1e392c8a880057aca446e94debe01c9ce.tar.gz
anaconda-76a938a1e392c8a880057aca446e94debe01c9ce.tar.xz
anaconda-76a938a1e392c8a880057aca446e94debe01c9ce.zip
only ask about doing vnc if we have an active network device (#132833)
Diffstat (limited to 'vnc.py')
-rw-r--r--vnc.py22
1 files changed, 20 insertions, 2 deletions
diff --git a/vnc.py b/vnc.py
index f9cc174d1..2d840f9bc 100644
--- a/vnc.py
+++ b/vnc.py
@@ -17,12 +17,30 @@ import os, sys, string
from snack import *
from constants_text import *
from rhpl.translate import _, N_
+import network
+import isys
+
+def hasActiveNetDev():
+ # try to load /tmp/netinfo and see if we can sniff out network info
+ netinfo = network.Network()
+ for dev in netinfo.netdevices.keys():
+ try:
+ ip = isys.getIPAddress(dev)
+ except Exception, e:
+ log("Got an exception trying to get the ip addr of %s: "
+ "%s" %(dev, e))
+ continue
+ if ip == '127.0.0.1' or ip is None:
+ continue
+ return True
+ return False
-def radiocb(*args):
- pass
# return -1 to use text mode, None for no vncpass, or vncpass otherwise
def askVncWindow():
+ if hasActiveNetDev() == False:
+ return -1
+
screen = SnackScreen()
vncpass = None
vncconnect = 0