summaryrefslogtreecommitdiffstats
path: root/vnc.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2006-07-06 20:03:17 +0000
committerDavid Cantrell <dcantrell@redhat.com>2006-07-06 20:03:17 +0000
commit3006fa94d0ce4589505596eec15690134b96e8df (patch)
tree35aa81d90ac9ced1ca4974645cb396631dd93274 /vnc.py
parentdf5b52b890f1387ec2c0bfc6721e08b942ac3dc6 (diff)
downloadanaconda-3006fa94d0ce4589505596eec15690134b96e8df.tar.gz
anaconda-3006fa94d0ce4589505596eec15690134b96e8df.tar.xz
anaconda-3006fa94d0ce4589505596eec15690134b96e8df.zip
On behalf of all of us here at anaconda, we wish Chris the best of luck
getting his workstation back online.
Diffstat (limited to 'vnc.py')
-rw-r--r--vnc.py34
1 files changed, 16 insertions, 18 deletions
diff --git a/vnc.py b/vnc.py
index f61619e10..b099bceb7 100644
--- a/vnc.py
+++ b/vnc.py
@@ -197,24 +197,22 @@ def startVNCServer(vncpassword="", root='/', vncconnecthost="",
if netinfo.hostname != "localhost.localdomain" and netinfo.lookupHostname() is not None:
srvname = netinfo.hostname
else:
- # Otherwise, look for any configured interface and use its IP
- # address for the name to connect to.
- for dev in netinfo.netdevices.keys():
- try:
- ip = isys.getIPAddress(dev)
- log.info("ip of %s is %s" %(dev, ip))
- except Exception, e:
- log.warning("Got an exception trying to get the ip addr "
- "of %s: %s" %(dev, e))
- continue
-
- if ip != '127.0.0.1' and ip is not None:
- srvname = ip
- break
-
- # If we get here and there's no valid IP address, just use the
- # hostname and hope for the best (better than displaying nothing)
- if ip == '127.0.0.1' or ip is None:
+ # Otherwise, look for the first configured interface and use its
+ # IP address for the name to connect to.
+ dev = netinfo.getFirstDeviceName()
+
+ try:
+ ip = isys.getIPAddress(dev)
+ log.info("ip of %s is %s" % (dev, ip))
+ except Exception, e:
+ log.warning("Got an exception trying to get the ip addr "
+ "of %s: %s" % (dev, e))
+
+ if ip != "127.0.0.1" and ip is not None:
+ srvname = ip
+ else:
+ # If we get here and there's no valid IP address, just use the
+ # hostname and hope for the best (better than displaying nothing)
srvname = netinfo.hostname
if srvname is not None: