diff options
author | David Cantrell <dcantrell@redhat.com> | 2007-04-02 16:00:04 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2007-04-02 16:00:04 +0000 |
commit | ba6ac3f17370b83a852d5bb392119ea8caaf64bf (patch) | |
tree | 89bda40e5325d129c0b006aca92c328c897312ad /vnc.py | |
parent | 0f4dd6a1fd0de2b395fab771fa8ca89274165c6b (diff) | |
download | anaconda-ba6ac3f17370b83a852d5bb392119ea8caaf64bf.tar.gz anaconda-ba6ac3f17370b83a852d5bb392119ea8caaf64bf.tar.xz anaconda-ba6ac3f17370b83a852d5bb392119ea8caaf64bf.zip |
* vnc.py (startVNCServer): Display the IP address of the VNC server
when telling the user what to connect to. During DHCP install
scenarios, users might not know the address they are assigned (#234747)
Diffstat (limited to 'vnc.py')
-rw-r--r-- | vnc.py | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -283,8 +283,20 @@ def startVNCServer(vncpassword="", root='/', vncconnecthost="", if vncconnecthost != "": stdoutLog.info(_("Attempting to connect to vnc client on host %s...") % (vncconnecthost,)) - - hostarg = vncconnecthost + + res = [] + try: + res = socket.getaddrinfo(vncconnecthost, None, socket.AF_INET6, socket.SOCK_STREAM) + except socket.gaierror: + try: + res = socket.getaddrinfo(vncconnecthost, None, socket.AF_INET, socket.SOCK_STREAM) + except socket.gaierror: + hostarg = vncconnecthost + + if res != []: + for (family, socktype, proto, canonname, sockaddr,) in res: + (hostarg, port,) = sockaddr + if vncconnectport != "": hostarg = hostarg + ":" + vncconnectport |