Выключение интерфейса если нет линка

master3.3 3.1.7
Mike khiretskiy 11 years ago
parent ef6876202d
commit 395c3771b0

@ -26,7 +26,7 @@ setLocalTranslate('cl_install3',sys.modules[__name__])
from calculate.lib.utils.ip import (getInterfaces,getIp,getMask,getMac,
cidrToMask,maskToCidr,getIpNet,isDhcpIp,checkIp,checkMask,
getOperState)
getOperState,getPlugged)
from calculate.lib.utils.device import lspci
from calculate.lib.utils.files import listDirectory,readLinesFile,process,\
readFile
@ -261,6 +261,8 @@ class VariableOsInstallNetStatus(NetHelper,Variable):
def getDefaultValue(self,iface):
def statusValue(ipaddr,dhcp):
if not getPlugged(iface):
return 'off'
if dhcp == "on":
return "dhcp"
elif ipaddr:

Loading…
Cancel
Save