|
|
|
@ -22,6 +22,7 @@ from calculate.lib.datavars import (Variable, VariableError, ReadonlyVariable,
|
|
|
|
|
VariableInterface, HumanReadable)
|
|
|
|
|
|
|
|
|
|
from calculate.lib.cl_lang import setLocalTranslate, _
|
|
|
|
|
from calculate.lib.variables.system import RootType
|
|
|
|
|
|
|
|
|
|
setLocalTranslate('cl_install3', sys.modules[__name__])
|
|
|
|
|
|
|
|
|
@ -57,9 +58,55 @@ class NetHelper(VariableInterface):
|
|
|
|
|
_notin=('off', 'dhcp'), limit=1):
|
|
|
|
|
return _("Network routing configuration is not available if all "
|
|
|
|
|
"interfaces are set to DHCP")
|
|
|
|
|
if self.Get('cl_network_migrate_set') == 'on':
|
|
|
|
|
return _("Network settings unavailable with use settings migration")
|
|
|
|
|
return ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableClNetworkConfigureSet(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
Выполнять ли настройку сети шаблонами
|
|
|
|
|
"""
|
|
|
|
|
type = "bool"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
if (self.Get('os_root_type_ext') in RootType.Live and
|
|
|
|
|
self.GetBool('cl_system_boot_set')):
|
|
|
|
|
return "on"
|
|
|
|
|
if self.GetBool("cl_network_migrate_set"):
|
|
|
|
|
return "off"
|
|
|
|
|
else:
|
|
|
|
|
return "on"
|
|
|
|
|
|
|
|
|
|
class VariableClNetworkMigrateSet(Variable):
|
|
|
|
|
"""
|
|
|
|
|
Использовать миграцию для переноса настроек
|
|
|
|
|
"""
|
|
|
|
|
type = "bool"
|
|
|
|
|
element = "radio"
|
|
|
|
|
|
|
|
|
|
def init(self):
|
|
|
|
|
self.label = _("Network")
|
|
|
|
|
self.help = _("use the network migration")
|
|
|
|
|
|
|
|
|
|
def choice(self):
|
|
|
|
|
return [("on", _("Migrate network settings")),
|
|
|
|
|
("off", _("Manually network configuration"))]
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
for manvar in ("os_install_net_conf",
|
|
|
|
|
"os_install_net_data",
|
|
|
|
|
"os_install_net_fqdn",
|
|
|
|
|
"os_install_ntp",
|
|
|
|
|
"os_install_net_dns",
|
|
|
|
|
"os_install_net_dns_search",
|
|
|
|
|
"os_install_net_route_data"):
|
|
|
|
|
if self.is_console_set(manvar):
|
|
|
|
|
return "off"
|
|
|
|
|
else:
|
|
|
|
|
return "on"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallNtp(NetHelper, Variable):
|
|
|
|
|
"""
|
|
|
|
|
NTP server for system
|
|
|
|
|