Add autopartition variables.

master3.3
Mike Hiretsky 12 years ago
parent fe25f57302
commit 1857bddc10

@ -822,6 +822,8 @@ class Install(color_print, SignalInterrupt):
sourceDistr = None sourceDistr = None
try: try:
self.clVars.printVars() self.clVars.printVars()
if self.Get('cl_autopartition_scheme'):
raise InstallError(_('Autopartitioning is not supported'))
targetDistr = self.clVars.Get('cl_target') targetDistr = self.clVars.Get('cl_target')
sourceDistr = self.clVars.Get('cl_image') sourceDistr = self.clVars.Get('cl_image')
# cmd options # cmd options

@ -68,6 +68,12 @@ class InstallInfo(ClassSerializer):
os_install_fb_resolution = String os_install_fb_resolution = String
os_install_clock_timezone = String os_install_clock_timezone = String
os_install_kernel_scheduler = String os_install_kernel_scheduler = String
cl_autopartition_device = String
cl_autopartition_scheme = String
cl_autopartition_table = String
cl_autopartition_root_size = String
#default = Array(String) #default = Array(String)
CheckOnly = Boolean CheckOnly = Boolean
@ -88,10 +94,10 @@ def catchExcept():
group = GroupField(name=_("Error"),last=True) group = GroupField(name=_("Error"),last=True)
group.fields = [] group.fields = []
group.fields.append(Field( group.fields.append(Field(
name = "error_label", name = "error",
label = str(e), label = str(e),
default = 'color:red;', default = 'color:red;',
element = "label")) element = "error"))
view.groups.append(group) view.groups.append(group)
print "!!!!EXCEPTION!!!!" print "!!!!EXCEPTION!!!!"
for i in apply(traceback.format_exception, sys.exc_info()): for i in apply(traceback.format_exception, sys.exc_info()):
@ -102,15 +108,20 @@ def catchExcept():
class Wsdl: class Wsdl:
def check_params (self, dv, info,allvars=False,ordered=None): def check_params (self, dv, info,allvars=False,ordered=None):
errors = [] errors = []
keys = filter(lambda x:x.lower() == x, keys = sorted(filter(lambda x:x.lower() == x,
info._type_info.keys()) info._type_info.keys()))
if ordered: if ordered:
keys = ordered + filter(lambda x:not x in ordered, keys = ordered + filter(lambda x:not x in ordered,
keys) keys)
print "333333333333333:",info.cl_autopartition_scheme
print "222222222222222:",info.cl_autopartition_device
for var in keys: for var in keys:
# get value of variable from info
val = info.__getattribute__(var) val = info.__getattribute__(var)
# check value if value send of check allvariables
if val != None or allvars: if val != None or allvars:
try: try:
# if value not send, then get from datavars
if val == None: if val == None:
val = dv.Get(var) val = dv.Get(var)
else: else:
@ -144,7 +155,10 @@ class Wsdl:
dv.flIniFile() dv.flIniFile()
initfunc(dv) initfunc(dv)
errors = self.check_params(dv, info, errors = self.check_params(dv, info,
ordered=['cl_image_linux_shortname', ordered=['cl_autopartition_scheme',
'cl_autopartition_device',
'cl_autopartition_root_size',
'cl_image_linux_shortname',
'cl_image_arch_machine', 'cl_image_arch_machine',
'cl_image_linux_ver', 'cl_image_linux_ver',
'cl_image_linux_build'], 'cl_image_linux_build'],
@ -181,6 +195,7 @@ class Wsdl:
@rpc(Integer, Integer, Boolean,_returns = ViewInfo) @rpc(Integer, Integer, Boolean,_returns = ViewInfo)
@catchExcept() @catchExcept()
def install_view (self, sid, step,expert): def install_view (self, sid, step,expert):
curThread = threading.currentThread()
dv = self.get_cache(sid,"install","vars") dv = self.get_cache(sid,"install","vars")
if not dv: if not dv:
reload(cl_install) reload(cl_install)
@ -194,6 +209,11 @@ class Wsdl:
('cl_image_linux_shortname','cl_image_arch_machine', ('cl_image_linux_shortname','cl_image_arch_machine',
'cl_image_linux_ver','cl_image_linux_build'), 'cl_image_linux_ver','cl_image_linux_build'),
_("Next")), \ _("Next")), \
(_("Autopartition"), \
('cl_autopartition_device',
'cl_autopartition_scheme'),
('cl_autopartition_table','cl_autopartition_root_size'),
_("Next")), \
(_("Partitioning"), \ (_("Partitioning"), \
('os_location_data','os_install_scratch','cl_uuid_set'), ('os_location_data','os_install_scratch','cl_uuid_set'),
('os_install_root_type','os_install_mbr', ('os_install_root_type','os_install_mbr',
@ -212,7 +232,7 @@ class Wsdl:
(_("Video"), \ (_("Video"), \
('os_install_x11_video_drv', 'os_install_x11_composite', ('os_install_x11_video_drv', 'os_install_x11_composite',
'os_install_x11_resolution', 'os_install_fb_resolution'),(), \ 'os_install_x11_resolution', 'os_install_fb_resolution'),(), \
_("Done")), _("Install")),
],step,expert) ],step,expert)
self.set_cache(sid, 'install', "vars",dv,smart=False) self.set_cache(sid, 'install', "vars",dv,smart=False)
return view return view

@ -78,8 +78,10 @@ class VariableOsInstallX11Resolution(ResolutionVariable):
type = 'choiceedit' type = 'choiceedit'
opt = ['-X'] opt = ['-X']
metavalue = "<width>x<height>" metavalue = "<width>x<height>"
help = _("set Xorg resolution")
label = _("Screen resolution") def init(self):
self.help = _("set Xorg resolution")
self.label = _("Screen resolution")
def get(self): def get(self):
# get resolution from xorg.log # get resolution from xorg.log
@ -96,8 +98,10 @@ class VariableOsInstallX11VideoDrv(VideoVariable):
type = 'choice' type = 'choice'
opt = ['--video'] opt = ['--video']
metavalue = "VIDEODRV" metavalue = "VIDEODRV"
help = _("set the video driver")
label = _("{0} video driver").format("Xorg") def init(self):
self.help = _("set the video driver")
self.label = _("{0} video driver").format("Xorg")
def choice(self): def choice(self):
"""Get available (already installed or installable drivers""" """Get available (already installed or installable drivers"""
@ -145,8 +149,10 @@ class VariableOsInstallX11Composite(VideoVariable):
""" """
type = 'bool' type = 'bool'
opt = ['--composite'] opt = ['--composite']
help = _("set composite")
label = _("Composite") def init(self):
self.help = _("set composite")
self.label = _("Composite")
def get(self): def get(self):
"""On/off composite""" """On/off composite"""
@ -178,10 +184,12 @@ class VariableOsInstallFbResolution(ResolutionVariable):
type = 'choiceedit' type = 'choiceedit'
opt = ['--fb'] opt = ['--fb']
metavalue = "<width>x<height>" metavalue = "<width>x<height>"
help = _("set framebuffer resolution")
label = _("Framebuffer resolution")
xorg_need = False xorg_need = False
def init(self):
self.help = _("set framebuffer resolution")
self.label = _("Framebuffer resolution")
def get(self): def get(self):
"""Get current framebuffer resolution""" """Get current framebuffer resolution"""
resolution = "" resolution = ""

@ -21,7 +21,8 @@ from os import path
from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable from calculate.lib.datavars import Variable,VariableError,ReadonlyVariable
from calculate.lib.utils.device import (getUdevDeviceInfo,getDeviceType, from calculate.lib.utils.device import (getUdevDeviceInfo,getDeviceType,
getPartitionType,getPartitionDevice,getRaidPartitions, getPartitionType,getPartitionDevice,getRaidPartitions,
getLvmPartitions,getPartitionSize,getUUIDDict) getLvmPartitions,getPartitionSize,getUUIDDict,
humanreadableSize)
from calculate.lib.utils.files import (listDirectory,pathJoin,readFile,FStab, from calculate.lib.utils.files import (listDirectory,pathJoin,readFile,FStab,
readLinesFile) readLinesFile)
from calculate.install.cl_distr import PartitionDistributive from calculate.install.cl_distr import PartitionDistributive
@ -42,15 +43,7 @@ class AutoPartition:
"{rootsize}:/;{rootsize}:;{allsize}:/var/calculate;" "{rootsize}:/;{rootsize}:;{allsize}:/var/calculate;"
"/var/calculate:/home", "/var/calculate:/home",
_("Manual partition"):""} _("Manual partition"):""}
device = None
scheme = None
args = {'memory':0,
'rootsize':10,
'allsize':0}
def initArgs(self):
self.args['memory'] = self.Get('hr_memory_size')
self.args['rootsize'] = self.Get('cl_autopartition_root_size')
class VariableHrMemorySize(ReadonlyVariable): class VariableHrMemorySize(ReadonlyVariable):
""" """
@ -76,13 +69,19 @@ class VariableClAutopartitionDevice(Variable):
""" """
type = "choice" type = "choice"
value = "" value = ""
label = _("Install device")
opt = ["-D"] opt = ["-D"]
metavalue = "DEVICE" metavalue = "DEVICE"
help = _("set autopartition device")
def init(self):
self.help = _("set autopartition device")
self.label = _("Install device")
def choice(self): def choice(self):
return self.Get('os_device_dev') return [""]+self.Get('os_device_dev')
def check(self,value):
if self.Get('cl_autopartition_scheme') and not value:
raise VariableError(_("For autopartition need select install device"))
class VariableClAutopartitionScheme(Variable,AutoPartition): class VariableClAutopartitionScheme(Variable,AutoPartition):
""" """
@ -91,10 +90,12 @@ class VariableClAutopartitionScheme(Variable,AutoPartition):
type = "choice" type = "choice"
value = "" value = ""
element = "radio" element = "radio"
lable = _("Install scheme")
opt = ["--autopart"] opt = ["--autopart"]
metavalue = "AUTOPARTMODE" metavalue = "AUTOPARTMODE"
help = _("autopartition scheme")
def init(self):
self.help = _("autopartition scheme")
self.label = _("Install scheme")
def choice(self): def choice(self):
return map(lambda x:(x[1],x[0]), return map(lambda x:(x[1],x[0]),
@ -105,6 +106,12 @@ class VariableClAutopartitionRootSize(Variable):
Root partition size for autopartition Root partition size for autopartition
""" """
type = "int" type = "int"
opt = ["--root-size"]
metavalue = "SIZE"
def init(self):
self.label = _("Root partition size")
self.help = _("set root partition size for autopartition")
def get(self): def get(self):
if self.Get('os_install_linux_system') == 'server': if self.Get('os_install_linux_system') == 'server':
@ -112,11 +119,238 @@ class VariableClAutopartitionRootSize(Variable):
else: else:
return str(1024*10) return str(1024*10)
def check(self,value):
if self.Get('cl_autopartition_device') and \
self.Get('cl_autopartition_scheme') and \
self.Get('cl_autopartition_free_size') <= 0:
raise VariableError(_("Selected size is too large"))
class VariableClAutopartitionTable(Variable): class VariableClAutopartitionTable(Variable):
""" """
Partition table for autopartition Partition table for autopartition
""" """
type = "choice"
value = "dos" value = "dos"
opt = ["--partition-table"]
metavalue = "TABLE"
def init(self):
self.label = _("Partition table")
self.help = _("set partition table for autopartition")
def choice(self): def choice(self):
return ["dos","gpt"] return ["dos","gpt"]
class VariableClAutopartitionDiskData(ReadonlyVariable):
"""
New partition data for autopart device
"""
type = "table"
source = ['cl_autopartition_disk_dev',
'cl_autopartition_disk_mount',
'cl_autopartition_disk_format',
'cl_autopartition_disk_size',
'cl_autopartition_disk_part']
class VariableClAutopartitionDiskDev(ReadonlyVariable):
"""
Autopartition virtual disk on device
"""
type = "list"
def generateDisks(self,dos,device,scheme,number=0):
"""
Generate disks for automount scheme
"""
number = 1
for line in scheme.split(';'):
if dos and number == 4:
number += 1
sizeOrBind, mp = line.split(':')
if not sizeOrBind.startswith('/'):
yield "%s%d"%(device,number)
number += 1
def get(self):
scheme = self.Get('cl_autopartition_scheme')
device = self.Get('cl_autopartition_device')
if scheme and device:
res = list(self.generateDisks(
self.Get('cl_autopartition_table')=='dos',
device,scheme))
return res
return []
class VariableClAutopartitionDiskMount(ReadonlyVariable):
"""
Autopartition mount points
"""
type = "list"
def generateMounts(self,scheme):
"""
Generate mount points for automount scheme
"""
for line in scheme.split(';'):
if not line.startswith('/'):
source, mp = line.split(':')
yield mp
def get(self):
scheme = self.Get('cl_autopartition_scheme')
device = self.Get('cl_autopartition_device')
if scheme and device:
return list(self.generateMounts(scheme))
return []
class VariableClAutopartitionDiskFormat(ReadonlyVariable):
"""
Autopartition disk file system
"""
type = "list"
def generateFormat(self,scheme):
"""
Generate filesystems for automount scheme
"""
for line in scheme.split(';'):
source,mp = line.split(':')
if not source.startswith('/'):
if mp == "swap": yield "swap"
else: yield FileSystemManager.defaultFS['hdd']
def get(self):
scheme = self.Get('cl_autopartition_scheme')
device = self.Get('cl_autopartition_device')
if scheme and device:
return list(self.generateFormat(scheme))
return []
class VariableClAutopartitionDiskPart(ReadonlyVariable):
"""
Autopartition partition type (primary,extended,logical,gpt)
"""
type = "list"
def generatePart(self,scheme,dos):
"""
Generate part type for automount scheme
"""
number = 1
for line in scheme.split(';'):
sizeOrBind, mp = line.split(':')
if not sizeOrBind.startswith('/'):
if dos:
if number < 4: yield "primary"
else: yield "logical"
number += 1
else:
yield "gpt"
def get(self):
scheme = self.Get('cl_autopartition_scheme')
table = self.Get('cl_autopartition_table')
if scheme:
return list(self.generatePart(scheme,
self.Get('cl_autopartition_table')=='dos'))
return []
class VariableClAutopartitionDiskType(ReadonlyVariable):
"""
Autopartition partition scheme (simple - disk-partition)
"""
type = "list"
def get(self):
return map(lambda x:"disk-partition",
self.Get('cl_autopartition_disk_dev'))
class VariableClAutopartitionDiskSize(ReadonlyVariable):
"""
Autopartition disk size
"""
type = "list"
def generateSize(self,scheme,memory,rootsize):
args = {'memory':memory,
'rootsize': rootsize,
'allsize':"allfree"
}
for line in scheme.split(';'):
size,mp = line.split(':')
if not size.startswith('/'):
yield size.format(**args)
def get(self):
scheme = self.Get('cl_autopartition_scheme')
device = self.Get('cl_autopartition_device')
if scheme and device:
return list(self.generateSize(scheme,self.Get('hr_memory_size'),
str(int(self.Get('cl_autopartition_root_size'))
*1024*1024)))
return []
def humanReadable(self):
allSize = self.Get('cl_autopartition_free_size')
return map(humanreadableSize,
map(lambda x:allSize if x == "allfree" else x,
self.Get()))
class VariableClAutopartitionFreeSize(ReadonlyVariable):
"""
Freesize of device with current root_size and memory
"""
type = "int"
def get(self):
device = self.Get('cl_autopartition_device')
if not device:
return 0
sizeDevice = self.Select('os_device_size',
where='os_device_dev',
eq=device,limit=1)
sizes = self.Get('cl_autopartition_disk_size')
return reduce(lambda x,y: x - int(y) if y.isdigit() else x,
sizes,int(sizeDevice))
class VariableClAutopartitionBindData(ReadonlyVariable):
"""
Autopartition bind data
"""
type = "table"
source = ['cl_autopartition_bind_path',
'cl_autopartition_bind_mountpoint']
class VariableClAutopartitionBindPath(ReadonlyVariable):
"""
Autopartition bind points
"""
type = "list"
def generatePath(self,scheme):
for line in scheme.split(';'):
source,mp = line.split(':')
if source.startswith('/'):
yield source
def get(self):
scheme = self.Get('cl_autopartition_scheme')
device = self.Get('cl_autopartition_device')
return list(self.generatePath(scheme))
class VariableClAutopartitionBindMountpoint(ReadonlyVariable):
"""
Autopartition bind points
"""
type = "list"
def generateMountPoint(self,scheme):
for line in scheme.split(';'):
source,mp = line.split(':')
if source.startswith('/'):
yield mp
def get(self):
scheme = self.Get('cl_autopartition_scheme')
device = self.Get('cl_autopartition_device')
return list(self.generateMountPoint(scheme))

@ -155,11 +155,18 @@ class VariableOsDeviceTable(ReadonlyVariable):
def get(self): def get(self):
"""Get device partition table""" """Get device partition table"""
autopartition = self.Get('cl_autopartition_scheme')
autoDevice = self.Get('cl_autopartition_device')
def getTable(device): def getTable(device):
prop = getUdevDeviceInfo(name=device) prop = getUdevDeviceInfo(name=device)
return prop.get('ID_PART_TABLE_TYPE', return prop.get('ID_PART_TABLE_TYPE',
self.getTableByChild(device)) self.getTableByChild(device))
return map(getTable, def getByAutopartition(device):
if autopartition and autoDevice == device:
return self.Get('cl_autopartition_table')
else:
return getTable(device)
return map(getByAutopartition,
self.Get('os_device_dev')) self.Get('os_device_dev'))
class VariableOsDeviceName(ReadonlyVariable): class VariableOsDeviceName(ReadonlyVariable):
@ -481,29 +488,48 @@ class VariableOsBindMountpoint(ReadonlyVariable):
###################################################################### ######################################################################
# Userselect partion parameters # Userselect partion parameters
###################################################################### ######################################################################
class VariableOsLocationData(Variable): class LocationVariable:
"""
Location variable
"""
def uncompatible(self):
"""
Network setting up unavailable for flash installation
"""
if self.Get('cl_autopartition_scheme'):
return \
_("Location not available with autopartitioning")
return ""
class VariableOsLocationData(LocationVariable,Variable):
""" """
Select installation disk variable Select installation disk variable
""" """
type = "table" type = "table"
opt = ["--disk","-d"] opt = ["--disk","-d"]
metavalue = 'DISKS' metavalue = 'DISKS'
help = _("DISK for installation, will be mounted to DIR. "
"DIR set to 'none' will cancel the mount point "
"transfer. For creating bind mount point you have "
"to specify the source directory as DISK")
label = _("Locations")
source = ["os_location_source", source = ["os_location_source",
"os_location_dest", "os_location_dest",
"os_location_format", "os_location_format",
"os_location_perform_format"] "os_location_perform_format",
"os_location_size"]
def init(self):
self.help = _("DISK for installation, will be mounted to DIR. "
"DIR set to 'none' will cancel the mount point "
"transfer. For creating bind mount point you have "
"to specify the source directory as DISK")
self.label = _("Locations")
class VariableOsLocationSource(Variable): class VariableOsLocationSource(LocationVariable,Variable):
""" """
Source disk or directory Source disk or directory
""" """
type = "choiceedit-list" type = "choiceedit-list"
label = _("Disk or directory")
def init(self):
self.label = _("Disk or directory")
def availDevs(self): def availDevs(self):
""" """
@ -520,10 +546,39 @@ class VariableOsLocationSource(Variable):
return self.Get('os_disk_dev')+self.Get('os_bind_path') return self.Get('os_disk_dev')+self.Get('os_bind_path')
def get(self): def get(self):
return self.availDevs() print "LocationSource"
if self.Get('cl_autopartition_scheme'):
print "Scheme"
print self.Get('cl_autopartition_disk_dev') + \
self.Get('cl_autopartition_bind_path')
return self.Get('cl_autopartition_disk_dev') + \
self.Get('cl_autopartition_bind_path')
else:
print "Avail"
return self.availDevs()
def choice(self): def choice(self):
return self.availDevs() + [""] return self.fixOsDiskDev(self.availDevs()) + [""]
def fixOsDiskDev(self,sourcelist=None):
"""
Fix os_disk_dev by autopartitions
"""
if not sourcelist:
sourcelist = self.Get('os_disk_dev')
scheme = self.Get('cl_autopartition_scheme')
if scheme:
excludeDisks = self.Select('os_disk_dev',
where='os_disk_parent',
eq=self.Get('cl_autopartition_device'))
appendDisks = self.Get('cl_autopartition_disk_dev')+ \
self.Get('cl_autopartition_bind_path')
else:
excludeDisks = []
appendDisks = []
return list((set(sourcelist)
-set(excludeDisks))
|set(appendDisks))
def check(self,value): def check(self,value):
"""Check set location source""" """Check set location source"""
@ -537,7 +592,7 @@ class VariableOsLocationSource(Variable):
########################### ###########################
disks = filter(lambda x:x.startswith('/dev/'),value) disks = filter(lambda x:x.startswith('/dev/'),value)
wrongDevices = list(set(disks) - \ wrongDevices = list(set(disks) - \
set(self.Get('os_disk_dev'))) set(self.fixOsDiskDev()))
if wrongDevices: if wrongDevices:
raise VariableError(_("Incorrect device '%s'")%wrongDevices[0]) raise VariableError(_("Incorrect device '%s'")%wrongDevices[0])
wrongSource = filter(lambda x:x and not x.startswith('/'),value) wrongSource = filter(lambda x:x and not x.startswith('/'),value)
@ -552,33 +607,39 @@ class VariableOsLocationSource(Variable):
if dupDevices: if dupDevices:
raise VariableError(_("Device '%s' is used twice")%dupDevices[0]) raise VariableError(_("Device '%s' is used twice")%dupDevices[0])
class VariableOsLocationDest(Variable): class VariableOsLocationDest(LocationVariable,Variable):
""" """
Desination directory of install disk data Desination directory of install disk data
""" """
type = "choiceedit-list" type = "choiceedit-list"
label = _("Mount point")
def init(self):
self.label = _("Mount point")
def get(self): def get(self):
source = self.Get('os_location_source') if self.Get('cl_autopartition_scheme'):
installFrom = self.Get('os_install_dev_from') return self.Get('cl_autopartition_disk_mount') + \
singleDevice = self.Get('os_install_disk_single') self.Get('cl_autopartition_bind_mountpoint')
def installMountPoint(info): else:
dev,mount = info source = self.Get('os_location_source')
if self.Get('cl_action') == 'system': installFrom = self.Get('os_install_dev_from')
if self.Get('cl_install_type') == 'flash': singleDevice = self.Get('os_install_disk_single')
if dev == singleDevice: return "/" def installMountPoint(info):
else: return "" dev,mount = info
else: if self.Get('cl_action') == 'system':
if dev == installFrom: return "/" if self.Get('cl_install_type') == 'flash':
elif mount == "/": return "" if dev == singleDevice: return "/"
return mount else: return ""
return map(installMountPoint, else:
filter(lambda x:x[0] in source, if dev == installFrom: return "/"
zip(self.Get('os_disk_dev'), elif mount == "/": return ""
self.Get('os_disk_mount'))+\ return mount
zip(self.Get('os_bind_path'), return map(installMountPoint,
self.Get('os_bind_mountpoint')))) filter(lambda x:x[0] in source,
zip(self.Get('os_disk_dev'),
self.Get('os_disk_mount'))+\
zip(self.Get('os_bind_path'),
self.Get('os_bind_mountpoint'))))
def set(self,value): def set(self,value):
"""Add abilitiy not specify root""" """Add abilitiy not specify root"""
@ -702,16 +763,22 @@ class VariableOsLocationDest(Variable):
typepart=checkType.upper(), typepart=checkType.upper(),
part=memberData[0][0])) part=memberData[0][0]))
class VariableOsLocationFormat(Variable): class VariableOsLocationFormat(LocationVariable,Variable):
type = "choice-list" type = "choice-list"
label = _("File system")
def init(self):
self.label = _("File system")
def get(self): def get(self):
mount = self.Get("os_location_dest") if self.Get('cl_autopartition_scheme'):
source = self.Get("os_location_source") return self.Get('cl_autopartition_disk_format') + \
value = [""]*len(source) map(lambda x:"",self.Get('cl_autopartition_bind_path'))
return map(self.defaultFormat(), else:
zip(source,mount,value)) mount = self.Get("os_location_dest")
source = self.Get("os_location_source")
value = [""]*len(source)
return map(self.defaultFormat(),
zip(source,mount,value))
def choice(self): def choice(self):
if self.Get('cl_install_type') == "flash": if self.Get('cl_install_type') == "flash":
@ -770,17 +837,25 @@ class VariableOsLocationFormat(Variable):
_("Swap partition {dev} must be formatted as swap").format( _("Swap partition {dev} must be formatted as swap").format(
dev=dev)) dev=dev))
class VariableOsLocationPerformFormat(Variable): class VariableOsLocationPerformFormat(LocationVariable,Variable):
type = "bool-list" type = "bool-list"
label = _("Format")
def init(self):
self.label = _("Format")
def get(self): def get(self):
mount = self.Get("os_location_dest") if self.Get('cl_autopartition_scheme'):
source = self.Get("os_location_source") return map(lambda x:"on",
fs = self.Get("os_location_format") self.Get('cl_autopartition_disk_format')) + \
value = [""]*len(source) map(lambda x:"",
return map(self.defaultPerformFormat(), self.Get('cl_autopartition_bind_path'))
zip(source,mount,fs,value)) else:
mount = self.Get("os_location_dest")
source = self.Get("os_location_source")
fs = self.Get("os_location_format")
value = [""]*len(source)
return map(self.defaultPerformFormat(),
zip(source,mount,fs,value))
def check(self,value): def check(self,value):
"""Check perform format """Check perform format
@ -846,16 +921,36 @@ class VariableOsLocationPerformFormat(Variable):
return map(self.defaultPerformFormat(), return map(self.defaultPerformFormat(),
info) info)
class VariableOsLocationSize(LocationVariable,ReadonlyVariable):
"""
Location size
"""
type = "list"
def init(self):
self.label = _("Size")
def get(self):
mapDevSize = dict(self.ZipVars('os_disk_dev','os_disk_size'))
mapDevSize.update(
zip(self.Get('cl_autopartition_disk_dev'),
self.Get('cl_autopartition_disk_size',humanreadable=True)))
return map(lambda x:mapDevSize.get(x,''),
self.Get('os_location_source'))
class VariableClUuidSet(Variable): class VariableClUuidSet(Variable):
""" """
Use or not UUID for /etc/fstab Use or not UUID for /etc/fstab
""" """
type = "bool" type = "bool"
label = _("Use UUID")
opt = ["--uuid"] opt = ["--uuid"]
help = _("use UUID")
value = "on" value = "on"
def init(self):
self.label = _("Use UUID")
self.help = _("use UUID")
############################################################# #############################################################
# Install disk parameters # Install disk parameters
############################################################# #############################################################
@ -978,6 +1073,8 @@ class VariableOsInstallDiskId(ReadonlyVariable):
def get(self): def get(self):
diskId = dict(zip(self.Get('os_disk_dev'), diskId = dict(zip(self.Get('os_disk_dev'),
self.Get('os_disk_id'))) self.Get('os_disk_id')))
diskId.update(zip(self.Get('cl_autopartition_disk_dev'),
[""]*len(self.Get('cl_autopartition_disk_dev'))))
def getIdByFS(fs,parttable,oldid): def getIdByFS(fs,parttable,oldid):
if parttable == "gpt": if parttable == "gpt":
return PartitionDistributive.formatIdGpt.get(fs,oldid) return PartitionDistributive.formatIdGpt.get(fs,oldid)
@ -1016,7 +1113,7 @@ class VariableOsInstallDiskSize(ReadonlyVariable):
type = "list" type = "list"
def get(self): def get(self):
diskSize = dict(self.ZipVars('os_disk_dev','os_disk_size')) diskSize = dict(self.ZipVars('os_location_source','os_location_size'))
return map(lambda x:diskSize.get(x,''), return map(lambda x:diskSize.get(x,''),
self.Get('os_install_disk_dev')) self.Get('os_install_disk_dev'))
@ -1028,6 +1125,8 @@ class VariableOsInstallDiskType(ReadonlyVariable):
def get(self): def get(self):
diskType = dict(self.ZipVars('os_disk_dev','os_disk_type')) diskType = dict(self.ZipVars('os_disk_dev','os_disk_type'))
diskType.update(self.ZipVars('cl_autopartition_disk_dev',
'cl_autopartition_disk_type'))
return map(lambda x:diskType.get(x,''), return map(lambda x:diskType.get(x,''),
self.Get('os_install_disk_dev')) self.Get('os_install_disk_dev'))
@ -1038,6 +1137,10 @@ class VariableOsInstallDiskParent(ReadonlyVariable):
type = "list" type = "list"
def get(self): def get(self):
diskParent = dict(self.ZipVars('os_disk_dev','os_disk_parent')) diskParent = dict(self.ZipVars('os_disk_dev','os_disk_parent'))
# replace value for autopartition
diskParent.update(zip(self.Get('cl_autopartition_disk_dev'),
[self.Get('cl_autopartition_device')]*
len(self.Get('cl_autopartition_disk_dev'))))
return map(lambda x:diskParent.get(x,''), return map(lambda x:diskParent.get(x,''),
self.Get('os_install_disk_dev')) self.Get('os_install_disk_dev'))
@ -1048,6 +1151,8 @@ class VariableOsInstallDiskPart(ReadonlyVariable):
type = "list" type = "list"
def get(self): def get(self):
diskPart = dict(self.ZipVars('os_disk_dev','os_disk_part')) diskPart = dict(self.ZipVars('os_disk_dev','os_disk_part'))
diskPart.update(self.ZipVars('cl_autopartition_disk_dev',
'cl_autopartition_disk_part'))
return map(lambda x:diskPart.get(x,''), return map(lambda x:diskPart.get(x,''),
self.Get('os_install_disk_dev')) self.Get('os_install_disk_dev'))
@ -1080,14 +1185,16 @@ class VariableOsInstallBindMountpoint(ReadonlyVariable):
where='os_location_source', where='os_location_source',
func=lambda x:not x[0].startswith('/dev/') and x[1]) func=lambda x:not x[0].startswith('/dev/') and x[1])
class VariableOsInstallMbr(Variable): class VariableOsInstallMbr(LocationVariable,Variable):
""" """
Disks for boot mbr Disks for boot mbr
""" """
type = "choice-list" type = "choice-list"
opt = ["--mbr"] opt = ["--mbr"]
metavalue = "MBR" metavalue = "MBR"
label = _("Disk for install")
def init(self):
self.label = _("Disk for install")
def get(self): def get(self):
"""Get default Master boot record install """Get default Master boot record install
@ -1105,7 +1212,7 @@ class VariableOsInstallMbr(Variable):
# if loaded system livecd # if loaded system livecd
if self.Get('os_root_type') == "livecd": if self.Get('os_root_type') == "livecd":
# search /boot device or / device, by priority /boot,/ # search /boot device or / device, by priority /boot,/
bootDev=self.Select('os_disk_install_parent', bootDev=self.Select('os_install_disk_parent',
where='os_install_disk_mount', where='os_install_disk_mount',
_in=('/','/boot'), _in=('/','/boot'),
sort="DESC",limit=1) sort="DESC",limit=1)
@ -1182,16 +1289,18 @@ class VariableOsInstallMbr(Variable):
_("Legacy grub does not support booting from %s without " _("Legacy grub does not support booting from %s without "
"separate /boot partition")%bootDiskFormat) "separate /boot partition")%bootDiskFormat)
class VariableOsInstallRootType(Variable): class VariableOsInstallRootType(LocationVariable,Variable):
""" """
Type of installation Type of installation
""" """
label = _("Installation type")
opt = ["--type"] opt = ["--type"]
metavalue = "DISKTYPE" metavalue = "DISKTYPE"
help = _("device type for the system bound for install")
type = "choice" type = "choice"
def init(self):
self.help = _("device type for the system bound for install")
self.label = _("Installation type")
def get(self): def get(self):
rootdev = self.Get('os_install_root_dev') rootdev = self.Get('os_install_root_dev')
devicetype = getPartitionDevice( devicetype = getPartitionDevice(
@ -1286,7 +1395,9 @@ class VariableOsInstallDiskSingle(Variable):
Installation disk Installation disk
""" """
type = "choice" type = "choice"
label = _("Installation disk")
def init(self):
self.label = _("Installation disk")
def availDevs(self): def availDevs(self):
""" """

@ -263,9 +263,10 @@ class VariableClImageFilename(Variable,DistroRepository):
type = 'file' type = 'file'
element = 'file' element = 'file'
opt = ['--iso'] opt = ['--iso']
label = _("Installation image")
help = _("ISO image for installation")
def init(self):
self.label = _("Installation image")
self.help = _("ISO image for installation")
def get(self): def get(self):
if self.Get('cl_action') != 'system': if self.Get('cl_action') != 'system':
@ -313,9 +314,11 @@ class VariableClImageArchMachine(Variable,DistroRepository):
""" """
type = 'choice' type = 'choice'
opt = ['--march'] opt = ['--march']
label = _("Preferred processor architecture")
help = _("select the processor architecture")
available_arch = ["i686","x86_64"] available_arch = ["i686","x86_64"]
def init(self):
self.label = _("Preferred processor architecture")
self.help = _("select the processor architecture")
def set(self,march): def set(self,march):
if march == "auto": if march == "auto":
@ -331,8 +334,10 @@ class VariableClImageLinuxShortname(Variable,Linux,DistroRepository):
""" """
type = 'choice' type = 'choice'
opt = ['--os','-s'] opt = ['--os','-s']
label = _("Distributive")
help = _("select the operation system") def init(self):
self.label = _("Distributive")
self.help = _("select the operation system")
def choice(self): def choice(self):
return self.dictLinuxName.keys() return self.dictLinuxName.keys()
@ -341,17 +346,21 @@ class VariableClImageLinuxVer(Variable,DistroRepository):
""" """
Filter by version Filter by version
""" """
label = _("Version")
value = "" value = ""
help = _("select the operation system by version")
def init(self):
self.label = _("Version")
self.help = _("select the operation system by version")
class VariableClImageLinuxBuild(Variable,DistroRepository): class VariableClImageLinuxBuild(Variable,DistroRepository):
""" """
Filter by build Filter by build
""" """
label = _("Build")
value = "" value = ""
help = _("select the operation system by build")
def init(self):
self.label = _("Build")
self.help = _("select the operation system by build")
class VariableClImagePath(ReadonlyVariable): class VariableClImagePath(ReadonlyVariable):
""" """

@ -35,8 +35,10 @@ class VariableOsInstallKernelScheduler(Variable):
type = "choiceedit" type = "choiceedit"
opt = ["--scheduler"] opt = ["--scheduler"]
metavalue = "SCHEDULER" metavalue = "SCHEDULER"
help = _("set I/O scheduler")
label = _("I/O scheduler") def init(self):
self.help = _("set I/O scheduler")
self.label = _("I/O scheduler")
def get(self): def get(self):
"""Get scheduler for install root device""" """Get scheduler for install root device"""
@ -53,7 +55,7 @@ class VariableOsInstallKernelScheduler(Variable):
return "cfq" return "cfq"
def choice(self): def choice(self):
return ["cfg","deadline","none"] return ["cfq","deadline","none"]
class VariableOsInstallKernelAttr(Variable): class VariableOsInstallKernelAttr(Variable):
""" """

@ -21,6 +21,8 @@ from calculate.lib.datavars import Variable, VariableError, ReadonlyVariable
from calculate.lib.variables.locale import Locale from calculate.lib.variables.locale import Locale
from calculate.lib.utils.files import readLinesFile, process from calculate.lib.utils.files import readLinesFile, process
from calculate.lib.utils.common import getValueFromCmdLine, getValueFromConfig from calculate.lib.utils.common import getValueFromCmdLine, getValueFromConfig
from pytz import timezone,country_timezones,UnknownTimeZoneError
from datetime import datetime
from calculate.lib.cl_lang import setLocalTranslate from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install',sys.modules[__name__]) setLocalTranslate('cl_install',sys.modules[__name__])
@ -106,7 +108,8 @@ class VariableOsInstallLocaleLocale(LocaleVariable):
""" """
def get(self): def get(self):
"""locale (example: ru_RU.UTF-8)""" """locale (example: ru_RU.UTF-8)"""
return self.Get('os_locale_locale') return self.getFieldByLang("locale",
self.Get('os_install_locale_lang'))
class VariableOsInstallLocaleLang(LocaleVariable): class VariableOsInstallLocaleLang(LocaleVariable):
""" """
@ -114,16 +117,17 @@ class VariableOsInstallLocaleLang(LocaleVariable):
""" """
mode = 'w' mode = 'w'
type = 'choice' type = 'choice'
label = _("Language")
opt = ["--lang","-l"] opt = ["--lang","-l"]
def init(self):
self.label = _("Language")
def get(self): def get(self):
"""lang (example: ru_RU)""" """lang (example: ru_RU)"""
return self.getLangByField("locale", return self.Get('os_locale_lang')
self.Get('os_install_locale_locale'))
def choice(self): def choice(self):
return self.Get('os_lang') return zip(self.Get('os_lang'),self.Get('os_lang',humanreadable=True))
class VariableOsInstallLocaleLanguage(LocaleVariable): class VariableOsInstallLocaleLanguage(LocaleVariable):
""" """
@ -133,7 +137,6 @@ class VariableOsInstallLocaleLanguage(LocaleVariable):
return self.getFieldByLang("language", return self.getFieldByLang("language",
self.Get('os_install_locale_lang')) self.Get('os_install_locale_lang'))
class VariableOsInstallLocaleXkb(LocaleVariable): class VariableOsInstallLocaleXkb(LocaleVariable):
""" """
Keyboard layout for X server Keyboard layout for X server
@ -152,16 +155,19 @@ class VariableOsInstallLocaleXkbname(LocaleVariable):
return localeXkb.split("(")[0] return localeXkb.split("(")[0]
return "" return ""
class VariableOsInstallClockTimezone(LocaleVariable): class VariableOsInstallClockTimezone(LocaleVariable):
""" """
Installation timezone for clock Installation timezone for clock
""" """
mode = 'w' mode = 'w'
type = 'choiceedit' type = 'choiceedit'
label = _("Timezone")
metavalue = "TIMEZONE" metavalue = "TIMEZONE"
opt = ["--timezone"] opt = ["--timezone"]
def init(self):
self.label = _("Timezone")
def get(self): def get(self):
return self.Get('os_clock_timezone') return self.Get('os_clock_timezone')
@ -170,8 +176,24 @@ class VariableOsInstallClockTimezone(LocaleVariable):
"/usr/share/zoneinfo",value)): "/usr/share/zoneinfo",value)):
raise VariableError(_("%s timezone is wrong")%value) raise VariableError(_("%s timezone is wrong")%value)
def generateComments(self,tzs):
"""
Generate comments by timezone names
"""
for tzname in tzs:
# add separator
if tzname == "---":
yield ("---","---")
continue
try:
tz = timezone(tzname)
strinfo = tz.localize(datetime.now()).strftime('%z')
yield (tzname,"%s (%s:%s)"%(tzname,strinfo[:3],strinfo[-2:]))
except UnknownTimeZoneError:
pass
def choice(self): def choice(self):
return ["Etc/GMT-12", "Pacific/Midway", "Pacific/Honolulu", source = ["Etc/GMT-12", "Pacific/Midway", "Pacific/Honolulu",
"America/Anchorage", "Canada/Pacific", "America/Tijuana", "America/Anchorage", "Canada/Pacific", "America/Tijuana",
"America/Phoenix", "America/Denver", "America/Mazatlan", "America/Phoenix", "America/Denver", "America/Mazatlan",
"America/Mazatlan", "America/Monterrey", "America/Monterrey", "America/Mazatlan", "America/Monterrey", "America/Monterrey",
@ -200,6 +222,15 @@ class VariableOsInstallClockTimezone(LocaleVariable):
"Asia/Vladivostok", "Pacific/Guam", "Australia/Melbourne", "Asia/Vladivostok", "Pacific/Guam", "Australia/Melbourne",
"Australia/Hobart", "Asia/Magadan", "Asia/Kamchatka", "Australia/Hobart", "Asia/Magadan", "Asia/Kamchatka",
"Pacific/Auckland", "Etc/GMT-13"] "Pacific/Auckland", "Etc/GMT-13"]
try:
lang = self.Get('os_install_locale_lang').split('_')[1]
nativeTZ = map(lambda x:x.encode('utf-8'),
country_timezones[lang])
source = nativeTZ + ["---"] + filter(lambda x:not x in nativeTZ,
source)
except (KeyError,IndexError) as e:
pass
return list(self.generateComments(source))
class VariableOsInstallClockType(Variable): class VariableOsInstallClockType(Variable):
""" """
@ -207,10 +238,12 @@ class VariableOsInstallClockType(Variable):
""" """
mode = 'w' mode = 'w'
type = 'choice' type = 'choice'
label = _("Clock type")
opt = ["--clocktype"] opt = ["--clocktype"]
metavalue = "CLOCKTYPE" metavalue = "CLOCKTYPE"
def init(self):
self.label = _("Clock type")
def get(self): def get(self):
"""type of clock (UTC or local)""" """type of clock (UTC or local)"""
clockTypeFile = ['/etc/conf.d/clock','/etc/conf.d/hwclock'] clockTypeFile = ['/etc/conf.d/clock','/etc/conf.d/hwclock']

@ -63,12 +63,14 @@ class VariableOsInstallNtp(NetVariable):
""" """
NTP server for system NTP server for system
""" """
label = _("NTP server")
opt = ['--ntp'] opt = ['--ntp']
help = _("set the ntp server for the system")
metavalue = "NTP" metavalue = "NTP"
value = "ntp0.zenon.net" value = "ntp0.zenon.net"
def init(self):
self.label = _("NTP server")
self.help = _("set the ntp server for the system")
class VariableOsInstallProxy(NetVariable): class VariableOsInstallProxy(NetVariable):
""" """
Proxy for system Proxy for system
@ -81,7 +83,9 @@ class VariableOsInstallNetInterfaces(NetVariable):
""" """
type = "list" type = "list"
mode = READONLY mode = READONLY
label = _("Interface")
def init(self):
self.label = _("Interface")
def get(self): def get(self):
return getInterfaces() return getInterfaces()
@ -120,8 +124,10 @@ class VariableOsInstallNetData(NetVariable):
"os_install_net_mask", "os_install_net_mask",
"os_install_net_name", "os_install_net_name",
"os_install_net_mac"] "os_install_net_mac"]
help = _("ip address with net (example:%s)")%"192.168.1.1/24"
label = _("Addresses") def init(self):
self.label = _("Addresses")
self.help = _("ip address with net (example:%s)")%"192.168.1.1/24"
class VariableOsInstallNetHostname(NetVariable): class VariableOsInstallNetHostname(NetVariable):
""" """
@ -135,8 +141,10 @@ class VariableOsInstallNetFqdn(NetVariable):
Full host name Full host name
""" """
opt = ['--hostname'] opt = ['--hostname']
label = _("Hostname")
help = _("set the short hostname or full hostname") def init(self):
self.label = _("Hostname")
self.help = _("set the short hostname or full hostname")
def set(self,value): def set(self,value):
if "." in value: if "." in value:
@ -175,7 +183,9 @@ class VariableOsInstallNetName(NetVariable):
""" """
type = "list" type = "list"
mode = READONLY mode = READONLY
label = _("Name")
def init(self):
self.label = _("Name")
def get(self): def get(self):
rePci = re.compile(r"(\d\d:\d\d\.\d)(?:/[^/]+){2}$") rePci = re.compile(r"(\d\d:\d\d\.\d)(?:/[^/]+){2}$")
@ -200,7 +210,9 @@ class VariableOsInstallNetMac(NetVariable):
""" """
type = "list" type = "list"
mode = READONLY mode = READONLY
label = _("MAC")
def init(self):
self.label = _("MAC")
def get(self): def get(self):
return map(lambda x:getMac(x), return map(lambda x:getMac(x),
@ -211,7 +223,9 @@ class VariableOsInstallNetIp(NetVariable):
IP for all network interfaces IP for all network interfaces
""" """
type = "list" type = "list"
label = _("IP address")
def init(self):
self.label = _("IP address")
def get(self): def get(self):
return map(lambda x:getIp(x), return map(lambda x:getIp(x),
@ -228,7 +242,9 @@ class VariableOsInstallNetNetwork(NetVariable):
""" """
type = "list" type = "list"
mode = READONLY mode = READONLY
label = _("Network")
def init(self):
self.label = _("Network")
def get(self): def get(self):
return map(lambda x:getIpNet(x[0],x[1]) if x[0] else "", return map(lambda x:getIpNet(x[0],x[1]) if x[0] else "",
@ -241,7 +257,9 @@ class VariableOsInstallNetCidr(NetVariable):
""" """
type = "list" type = "list"
mode = READONLY mode = READONLY
label = _("CIDR")
def init(self):
self.label = _("CIDR")
def get(self): def get(self):
""" """
@ -255,7 +273,9 @@ class VariableOsInstallNetMask(NetVariable):
Net mask of interfaces (Example:255.255.0.0) Net mask of interfaces (Example:255.255.0.0)
""" """
type = "choiceedit-list" type = "choiceedit-list"
label = _("Mask")
def init(self):
self.label = _("Mask")
def get(self): def get(self):
return map(lambda x:cidrToMask(getMask(x)), return map(lambda x:cidrToMask(getMask(x)),
@ -291,7 +311,9 @@ class VariableOsInstallNetDhcpSet(NetVariable):
Describe ip was get by DHCP or manualy Describe ip was get by DHCP or manualy
""" """
type = "bool-list" type = "bool-list"
label = _("DHCP")
def init(self):
self.label = _("DHCP")
def get(self): def get(self):
return map(lambda x:"on" if isDhcpIp(x) else "off", return map(lambda x:"on" if isDhcpIp(x) else "off",
@ -311,16 +333,18 @@ class VariableOsInstallNetRouteData(NetVariable):
""" """
Route table data Route table data
""" """
label = _("Routing")
opt = ["--route"] opt = ["--route"]
metavalue = "NETWORK:[GATEWAY][:DEV[:SOURCE]]" metavalue = "NETWORK:[GATEWAY][:DEV[:SOURCE]]"
help = _("add a routing rule")
type = "table" type = "table"
source = ['os_install_net_route_network', source = ['os_install_net_route_network',
'os_install_net_route_gw', 'os_install_net_route_gw',
'os_install_net_route_dev', 'os_install_net_route_dev',
'os_install_net_route_src'] 'os_install_net_route_src']
def init(self):
self.label = _("Routing")
self.help = _("add a routing rule")
def get(self): def get(self):
"""Routing hash""" """Routing hash"""
interfaces = self.Get('os_install_net_interfaces') interfaces = self.Get('os_install_net_interfaces')
@ -343,10 +367,12 @@ class VariableOsInstallNetRouteNetwork(FieldValue,NetVariable):
Net for route table record Net for route table record
""" """
type = "choiceedit-list" type = "choiceedit-list"
label = _("Network")
source_variable = "os_install_net_route_data" source_variable = "os_install_net_route_data"
column = 0 column = 0
def init(self):
self.label = _("Network")
def choice(self): def choice(self):
return ["default"]+self.Get('os_install_net_network') return ["default"]+self.Get('os_install_net_network')
@ -363,10 +389,12 @@ class VariableOsInstallNetRouteGw(FieldValue,NetVariable):
""" """
Gateway for route table record Gateway for route table record
""" """
label = _("Gateway")
source_variable = "os_install_net_route_data" source_variable = "os_install_net_route_data"
column = 1 column = 1
def init(self):
self.label = _("Gateway")
def check(self,value): def check(self,value):
############################# #############################
# search unreachable gateways # search unreachable gateways
@ -391,10 +419,12 @@ class VariableOsInstallNetRouteDev(FieldValue,NetVariable):
Device for route table record Device for route table record
""" """
type = "choice-list" type = "choice-list"
label = _("Interface")
source_variable = "os_install_net_route_data" source_variable = "os_install_net_route_data"
column = 2 column = 2
def init(self):
self.label = _("Interface")
def choice(self): def choice(self):
return self.Get('os_install_net_interfaces') return self.Get('os_install_net_interfaces')
@ -403,10 +433,12 @@ class VariableOsInstallNetRouteSrc(FieldValue,NetVariable):
Source ip for route table record Source ip for route table record
""" """
type = "choiceedit-list" type = "choiceedit-list"
label = _("Source")
source_variable = "os_install_net_route_data" source_variable = "os_install_net_route_data"
column = 3 column = 3
def init(self):
self.label = _("Source")
def choice(self): def choice(self):
return [""]+self.Get('os_install_net_ip') return [""]+self.Get('os_install_net_ip')
@ -488,10 +520,12 @@ class VariableOsInstallNetConf(NetVariable):
Net setup (networkmanager or openrc) Net setup (networkmanager or openrc)
""" """
type = "choice" type = "choice"
label = _("Network manager")
opt = ["--netconf"] opt = ["--netconf"]
metavalue = "NETMANAGER" metavalue = "NETMANAGER"
help = _("network manager")
def init(self):
self.label = _("Network manager")
self.help = _("network manager")
def get(self): def get(self):
"""Net setup (networkmanager or openrc)""" """Net setup (networkmanager or openrc)"""

@ -48,8 +48,10 @@ class VariableOsInstallScratch(Variable):
""" """
type = "bool" type = "bool"
opt = ['--build'] opt = ['--build']
label = _("Builder mode")
help = _("installation for assemble") def init(self):
self.label = _("Builder mode")
self.help = _("installation for assemble")
def get(self): def get(self):
# for installation default - normal system # for installation default - normal system
@ -101,16 +103,20 @@ class VariableClMigrateData(UserVariable):
type = 'table' type = 'table'
opt = ["--users","-u"] opt = ["--users","-u"]
metavalue = 'USERS' metavalue = 'USERS'
help = _("add a user to the installed system")
label = _("Migration users")
source = ['cl_migrate_user','cl_migrate_user_pwd'] source = ['cl_migrate_user','cl_migrate_user_pwd']
def init(self):
self.help = _("add a user to the installed system")
self.label = _("Migration users")
class VariableClMigrateUser(UserVariable): class VariableClMigrateUser(UserVariable):
""" """
Migrate users list Migrate users list
""" """
type = 'list' type = 'list'
label = _("Login")
def init(self):
self.label = _("Login")
def get(self): def get(self):
""" """
@ -123,7 +129,9 @@ class VariableClMigrateUserPwd(UserVariable):
Migrate users who need to change passwords Migrate users who need to change passwords
""" """
type = 'password-list' type = 'password-list'
label = _("Password")
def init(self):
self.label = _("Password")
def get(self): def get(self):
""" """
@ -191,10 +199,12 @@ class VariableClAutologin(UserVariable):
empty string if disable empty string if disable
""" """
type = 'choiceedit' type = 'choiceedit'
label = _("Autologin")
opt = ["--autologin",'-A'] opt = ["--autologin",'-A']
metavalue = "USER" metavalue = "USER"
help = _("add an autologin user to the installed system")
def init(self):
self.label = _("Autologin")
self.help = _("add an autologin user to the installed system")
def get(self): def get(self):
# autologin enable for livecd and all install type CMC # autologin enable for livecd and all install type CMC

Loading…
Cancel
Save