diff options
author | David Cantrell <dcantrell@redhat.com> | 2006-07-06 20:03:17 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2006-07-06 20:03:17 +0000 |
commit | 3006fa94d0ce4589505596eec15690134b96e8df (patch) | |
tree | 35aa81d90ac9ced1ca4974645cb396631dd93274 /vnc.py | |
parent | df5b52b890f1387ec2c0bfc6721e08b942ac3dc6 (diff) | |
download | anaconda-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.py | 34 |
1 files changed, 16 insertions, 18 deletions
@@ -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: |