import threading
import fcntl
import commands
-import sioc
-
import logger
-
PID_FILE = '/var/run/nm.pid'
def get_default_if():
return interface
def get_hwaddr_from_plnode():
- for line in open("/usr/boot/plnode.txt", 'r').readlines():
- if line.startswith("NET_DEVICE"):
- return line.split("=")[1].strip().strip('"')
+ try:
+ for line in open("/usr/boot/plnode.txt", 'r').readlines():
+ if line.startswith("NET_DEVICE"):
+ return line.split("=")[1].strip().strip('"')
+ except:
+ pass
return None
def get_if_from_hwaddr(hwaddr):
+ import sioc
devs = sioc.gifconf()
for dev in devs:
dev_hwaddr = sioc.gifhwaddr(dev)