diff options
Diffstat (limited to 'network.py')
-rw-r--r-- | network.py | 15 |
1 files changed, 15 insertions, 0 deletions
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 = "" |