[PATCH] anaconda displays conflicting information when using vnc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=814402

Try using the network name of the displayed IP address rather than the
hostname.

---
 pyanaconda/vnc.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index 784d5f7..83e2f2f 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -98,9 +98,18 @@ class VncServer:
                                                                      ips))
                     self.ip = ips[0]
 
-        self.name = network.getDefaultHostname(self.anaconda)
         ipstr = self.ip
 
+        try:
+            hinfo = socket.gethostbyaddr(ipstr)
+        except Exception as e:
+            log.debug("Exception caught trying to get host name of %s: %s" %
+                      (ipstr, e))
+            self.name = network.getDefaultHostname(self.anaconda)
+        else:
+            if len(hinfo) == 3:
+                self.name = hinfo[0]
+
         if self.ip.find(':') != -1:
             ipstr = "[%s]" % (self.ip,)
 
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux