summaryrefslogtreecommitdiffstats
path: root/pyanaconda/vnc.py
diff options
context:
space:
mode:
authorRadek Vykydal <rvykydal@redhat.com>2012-08-23 16:15:24 +0200
committerRadek Vykydal <rvykydal@redhat.com>2012-08-27 15:50:37 +0200
commit28381f5c74d6202cc2685d40db2a590e8d253286 (patch)
tree0281b95ce476aaeea3a35f89e07df4f45a896d69 /pyanaconda/vnc.py
parent2fe596d394981d638846aaad00fff27518db00cb (diff)
downloadanaconda-28381f5c74d6202cc2685d40db2a590e8d253286.tar.gz
anaconda-28381f5c74d6202cc2685d40db2a590e8d253286.tar.xz
anaconda-28381f5c74d6202cc2685d40db2a590e8d253286.zip
networking: remove Network() object
- We can add dhcp activation in networkInitialize in thread later - Also fixing merge (newui->master) of https://lists.fedorahosted.org/pipermail/anaconda-patches/2012-June/000023.html
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