summaryrefslogtreecommitdiffstats
path: root/vnc.py
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2007-04-02 16:00:04 +0000
committerDavid Cantrell <dcantrell@redhat.com>2007-04-02 16:00:04 +0000
commitba6ac3f17370b83a852d5bb392119ea8caaf64bf (patch)
tree89bda40e5325d129c0b006aca92c328c897312ad /vnc.py
parent0f4dd6a1fd0de2b395fab771fa8ca89274165c6b (diff)
downloadanaconda-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.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/vnc.py b/vnc.py
index 2d7631c3c..1f61024dd 100644
--- a/vnc.py
+++ b/vnc.py
@@ -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