summaryrefslogtreecommitdiffstats
path: root/pyanaconda/vnc.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyanaconda/vnc.py')
-rw-r--r--pyanaconda/vnc.py24
1 files changed, 5 insertions, 19 deletions
diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
index b06ac8743..22e758c6c 100644
--- a/pyanaconda/vnc.py
+++ b/pyanaconda/vnc.py
@@ -77,25 +77,11 @@ class VncServer:
def initialize(self):
"""Here is were all the relative vars get initialized. """
- # see if we can sniff out network info
- netinfo = network.Network()
-
- active_devs = network.getActiveNetDevs()
-
- self.ip = None
- if active_devs != []:
- devname = active_devs[0]
- try:
- ips = (isys.getIPAddresses(devname, version=4) +
- isys.getIPAddresses(devname, version=6))
- except Exception as e:
- log.warning("Got an exception trying to get the self.ip addr "
- "of %s: %s" % (devname, e))
- else:
- if ips and ips[0] not in ("127.0.0.1", "::1"):
- log.info("IPs (using first) of device %s: %s" % (devname,
- ips))
- self.ip = ips[0]
+ self.ip = network.getFirstRealIP()
+
+ if not self.ip:
+ # Raise this here which will be caught higher up
+ raise Exception("No IP addresses found.")
ipstr = self.ip