diff options
author | Mark Hamzy <hamzy@us.ibm.com> | 2012-04-23 10:39:09 -0500 |
---|---|---|
committer | Will Woods <wwoods@redhat.com> | 2012-04-23 12:26:05 -0400 |
commit | ef57e5e5f58a2b7ac1eef35423b6a8f556716cec (patch) | |
tree | 03b3601d28c4b055b3692b49ca2e65b45cfa4172 /pyanaconda/vnc.py | |
parent | 1aff0e4ca2148da9375ae486ef0a8300ed575bfc (diff) | |
download | anaconda-ef57e5e5f58a2b7ac1eef35423b6a8f556716cec.tar.gz anaconda-ef57e5e5f58a2b7ac1eef35423b6a8f556716cec.tar.xz anaconda-ef57e5e5f58a2b7ac1eef35423b6a8f556716cec.zip |
anaconda displays conflicting information when using vnc
https://bugzilla.redhat.com/show_bug.cgi?id=814402
Try using the network name of the displayed IP address rather than the
hostname.
Diffstat (limited to 'pyanaconda/vnc.py')
-rw-r--r-- | pyanaconda/vnc.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py index 784d5f7cb..83e2f2f2f 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,) |