summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2006-02-14 17:55:54 +0000
committerChris Lumens <clumens@redhat.com>2006-02-14 17:55:54 +0000
commite859025153412b0bca1aea8c6de1cfefcd4fd40f (patch)
treef288ef9eb9a92f56594587464a72fba584248c9d
parent13a5677623cb005adf00b9776e9ad2420f15e797 (diff)
downloadanaconda-e859025153412b0bca1aea8c6de1cfefcd4fd40f.tar.gz
anaconda-e859025153412b0bca1aea8c6de1cfefcd4fd40f.tar.xz
anaconda-e859025153412b0bca1aea8c6de1cfefcd4fd40f.zip
Move hasActiveNetDev frmo vnc to network.
-rw-r--r--ChangeLog3
-rwxr-xr-xgui.py2
-rw-r--r--network.py15
-rw-r--r--text.py2
-rw-r--r--vnc.py18
5 files changed, 21 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d975632f..640cf669a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2006-02-14 Chris Lumens <clumens@redhat.com>
+ * network.py (hasActiveNetDev): Moved here from vnc.py.
+ * vnc.py: Likewise.
+
* gui.py (ExceptionWindow.__init__): Remove remote button if there's
no network.
* text.py (ExceptionWindow.__init__): Likewise.
diff --git a/gui.py b/gui.py
index 1b1671195..302df13fc 100755
--- a/gui.py
+++ b/gui.py
@@ -41,7 +41,7 @@ import warnings
from language import expandLangs
from flags import flags
from constants import *
-from vnc import hasActiveNetDev
+from network import hasActiveNetDev
import floppy
from rhpl.translate import _, N_
diff --git a/network.py b/network.py
index e2d9a1e6d..23abe270e 100644
--- a/network.py
+++ b/network.py
@@ -96,6 +96,21 @@ def sanityCheckIPString(ip_string):
return octets
+def hasActiveNetDev():
+ # try to load /tmp/netinfo and see if we can sniff out network info
+ netinfo = Network()
+ for dev in netinfo.netdevices.keys():
+ try:
+ ip = isys.getIPAddress(dev)
+ except Exception, e:
+ log.error("Got an exception trying to get the ip addr of %s: "
+ "%s" %(dev, e))
+ continue
+ if ip == '127.0.0.1' or ip is None:
+ continue
+ return True
+ return False
+
class NetworkDevice(SimpleConfigFile):
def __str__(self):
s = ""
diff --git a/text.py b/text.py
index c3c4d0072..b17237b73 100644
--- a/text.py
+++ b/text.py
@@ -28,7 +28,7 @@ from language import expandLangs
from flags import flags
from constants_text import *
from constants import *
-from vnc import hasActiveNetDev
+from network import hasActiveNetDev
import floppy
from rhpl.translate import _, cat, N_
diff --git a/vnc.py b/vnc.py
index 88fc1cc91..31b4e0ef3 100644
--- a/vnc.py
+++ b/vnc.py
@@ -23,25 +23,9 @@ import isys
import logging
log = logging.getLogger("anaconda")
-def hasActiveNetDev():
- # try to load /tmp/netinfo and see if we can sniff out network info
- netinfo = network.Network()
- for dev in netinfo.netdevices.keys():
- try:
- ip = isys.getIPAddress(dev)
- except Exception, e:
- log.error("Got an exception trying to get the ip addr of %s: "
- "%s" %(dev, e))
- continue
- if ip == '127.0.0.1' or ip is None:
- continue
- return True
- return False
-
-
# return -1 to use text mode, None for no vncpass, or vncpass otherwise
def askVncWindow():
- if hasActiveNetDev() == False:
+ if network.hasActiveNetDev() == False:
return -1
screen = SnackScreen()