[PATCH rhel7-branch] network: display only actual fqdn of ip we offer for vnc connection (#1089429)
Radek Vykydal
rvykydal at redhat.com
Thu Sep 25 12:31:59 UTC 2014
Not just current hostname of the host (which can be eg bound to ip of
another active interface, as in the bz).
Resolves: rhbz#1089429
---
pyanaconda/vnc.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index 787a211..2b21fa4 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -120,7 +120,9 @@ class VncServer:
if self.ip.find(':') != -1:
ipstr = "[%s]" % (self.ip,)
- if (self.name is not None) and (not self.name.startswith('localhost')) and (ipstr is not None):
+ name_ips = [i[4][0] for i in socket.getaddrinfo(self.name, 0)]
+ if (self.name is not None) and (not self.name.startswith('localhost')) \
+ and (ipstr is not None) and self.ip in name_ips:
self.connxinfo = "%s:%s (%s:%s)" % (socket.getfqdn(name=self.name), self.display, ipstr, self.display)
elif ipstr is not None:
self.connxinfo = "%s:%s" % (ipstr, self.display,)
--
1.9.3
More information about the anaconda-patches
mailing list