Fix autopartition_set variable

master3.3
Mike Hiretsky 13 years ago
parent f381838fd0
commit 21ff8b51bd

@ -683,7 +683,7 @@ class Install(color_print):
sourceDistr = None sourceDistr = None
try: try:
#self.clVars.printVars() #self.clVars.printVars()
if self.clVars.Get('cl_autopartition_set') == 'auto': if self.clVars.Get('cl_autopartition_set') == 'on':
self.startTask(_("Creating new partition table"), self.startTask(_("Creating new partition table"),
progress=True) progress=True)
ap = AutoPartition() ap = AutoPartition()

@ -314,7 +314,7 @@ class AutopartitionHelper:
return sorted(self.Get('cl_autopartition_scheme'),key=optOrder.get) return sorted(self.Get('cl_autopartition_scheme'),key=optOrder.get)
def uncompatible(self): def uncompatible(self):
if self.Get('cl_autopartition_set') == "manual": if self.Get('cl_autopartition_set') == "off":
return \ return \
_("Autopartition parameters are not available " _("Autopartition parameters are not available "
"with manual partitioning") "with manual partitioning")
@ -411,7 +411,7 @@ class VariableClAutopartitionDevice(AutopartitionHelper,Variable):
self.checkNeeded(valuelist,raidDevices,"RAID") self.checkNeeded(valuelist,raidDevices,"RAID")
def check(self,valuelist): def check(self,valuelist):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
if not valuelist: if not valuelist:
raise VariableError(_("For autopartition need select install" raise VariableError(_("For autopartition need select install"
" device")) " device"))
@ -441,16 +441,18 @@ class VariableClAutopartitionSet(Variable):
""" """
Using autopartition Using autopartition
""" """
type = "choiceedit" type = "bool"
value = "manual" value = "off"
element = "radio" element = "radio"
opt = ["--autopartition"]
def init(self): def init(self):
self.label = _("Partitions") self.label = _("Partitions")
self.help = _("use autoparitition")
def choice(self): def choice(self):
return [("manual",_("Manual partition")), return [("off",_("Manual partition")),
("auto",_("Autopartition"))] ("on",_("Autopartition"))]
class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition): class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition):
""" """
@ -459,7 +461,7 @@ class VariableClAutopartitionScheme(AutopartitionHelper,Variable,AutoPartition):
type = "choice-list" type = "choice-list"
value = ["swap","root","data"] value = ["swap","root","data"]
element = "selecttable" element = "selecttable"
opt = ["--autopart"] opt = ["--auto-scheme"]
metavalue = "AUTOPARTOPTS" metavalue = "AUTOPARTOPTS"
def init(self): def init(self):
@ -520,7 +522,7 @@ class VariableClAutopartitionRootSize(AutopartitionHelper,Variable):
def check(self,value): def check(self,value):
if self.Get('cl_autopartition_device') and \ if self.Get('cl_autopartition_device') and \
self.Get('cl_autopartition_set') == "auto": self.Get('cl_autopartition_set') == "on":
if int(value) < Sizes().to_M(MINROOTSIZE): if int(value) < Sizes().to_M(MINROOTSIZE):
raise VariableError( raise VariableError(
_("Root partition size should not be less {size}").format( _("Root partition size should not be less {size}").format(
@ -612,7 +614,7 @@ class VariableClAutopartitionDiskDev(ReadonlyVariable,AutopartitionHelper):
return self.generateDisks return self.generateDisks
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
scheme = self.getAutopartitionScheme() scheme = self.getAutopartitionScheme()
devices = self.Get('cl_autopartition_device') devices = self.Get('cl_autopartition_device')
if devices: if devices:
@ -637,7 +639,7 @@ class VariableClAutopartitionDiskMount(ReadonlyVariable,AutopartitionHelper):
yield self.mpByOpts(line) yield self.mpByOpts(line)
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
scheme = self.getAutopartitionScheme() scheme = self.getAutopartitionScheme()
device = self.Get('cl_autopartition_device') device = self.Get('cl_autopartition_device')
if device: if device:
@ -659,7 +661,7 @@ class VariableClAutopartitionDiskFormat(ReadonlyVariable,AutopartitionHelper):
else: yield FileSystemManager.defaultFS['hdd'] else: yield FileSystemManager.defaultFS['hdd']
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
scheme = self.getAutopartitionScheme() scheme = self.getAutopartitionScheme()
device = self.Get('cl_autopartition_device') device = self.Get('cl_autopartition_device')
if device: if device:
@ -686,7 +688,7 @@ class VariableClAutopartitionDiskPart(ReadonlyVariable,AutopartitionHelper):
yield "gpt" yield "gpt"
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
scheme = self.getAutopartitionScheme() scheme = self.getAutopartitionScheme()
table = self.Get('cl_autopartition_table') table = self.Get('cl_autopartition_table')
if scheme: if scheme:
@ -701,7 +703,7 @@ class VariableClAutopartitionDiskType(ReadonlyVariable,AutopartitionHelper):
type = "list" type = "list"
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
if self.Get('cl_autopartition_lvm_set')=="on": if self.Get('cl_autopartition_lvm_set')=="on":
diskType = "LVM" diskType = "LVM"
else: else:
@ -733,7 +735,7 @@ class VariableClAutopartitionDiskSize(ReadonlyVariable,AutopartitionHelper):
yield "allfree" yield "allfree"
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
scheme = self.getAutopartitionScheme() scheme = self.getAutopartitionScheme()
device = self.Get('cl_autopartition_device') device = self.Get('cl_autopartition_device')
availSize = self.Get('cl_autopartition_device_size') availSize = self.Get('cl_autopartition_device_size')
@ -802,7 +804,7 @@ class VariableClAutopartitionBindPath(ReadonlyVariable,AutopartitionHelper):
yield self.sourceMpByOpts(line) yield self.sourceMpByOpts(line)
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
scheme = self.getAutopartitionScheme() scheme = self.getAutopartitionScheme()
device = self.Get('cl_autopartition_device') device = self.Get('cl_autopartition_device')
return list(self.generatePath(scheme)) return list(self.generatePath(scheme))
@ -820,7 +822,7 @@ class VariableClAutopartitionBindMountpoint(ReadonlyVariable,
yield self.targetMpByOpts(line) yield self.targetMpByOpts(line)
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
scheme = self.getAutopartitionScheme() scheme = self.getAutopartitionScheme()
device = self.Get('cl_autopartition_device') device = self.Get('cl_autopartition_device')
return list(self.generateMountPoint(scheme)) return list(self.generateMountPoint(scheme))

@ -214,7 +214,7 @@ class VariableOsDeviceTable(ReadonlyVariable):
def get(self): def get(self):
"""Get device partition table""" """Get device partition table"""
autopartition = self.Get('cl_autopartition_set') == 'auto' autopartition = self.Get('cl_autopartition_set') == 'on'
autoDevice = self.Get('cl_autopartition_device') autoDevice = self.Get('cl_autopartition_device')
def getTable(device): def getTable(device):
prop = getUdevDeviceInfo(name=device) prop = getUdevDeviceInfo(name=device)
@ -589,7 +589,7 @@ class LocationHelper:
""" """
Network setting up unavailable for flash installation Network setting up unavailable for flash installation
""" """
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
return \ return \
_("Location not available with autopartitioning") _("Location not available with autopartitioning")
return "" return ""
@ -646,7 +646,7 @@ class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
self.Get('os_bind_path') self.Get('os_bind_path')
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
return self.Get('cl_autopartition_disk_dev') + \ return self.Get('cl_autopartition_disk_dev') + \
self.Get('cl_autopartition_bind_path') self.Get('cl_autopartition_bind_path')
else: else:
@ -663,7 +663,7 @@ class VariableOsLocationSource(LocationHelper,DeviceHelper,Variable):
""" """
if not sourcelist: if not sourcelist:
sourcelist = self.Get('os_disk_dev') sourcelist = self.Get('os_disk_dev')
scheme = self.Get('cl_autopartition_set') == "auto" scheme = self.Get('cl_autopartition_set') == "on"
if scheme: if scheme:
excludeDisks = self.Select('os_disk_dev', excludeDisks = self.Select('os_disk_dev',
where='os_disk_parent', where='os_disk_parent',
@ -712,7 +712,7 @@ class VariableOsLocationDest(LocationHelper,Variable):
self.label = _("Mount point") self.label = _("Mount point")
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
return self.Get('cl_autopartition_disk_mount') + \ return self.Get('cl_autopartition_disk_mount') + \
self.Get('cl_autopartition_bind_mountpoint') self.Get('cl_autopartition_bind_mountpoint')
else: else:
@ -876,7 +876,7 @@ class VariableOsLocationFormat(LocationHelper,Variable):
self.label = _("File system") self.label = _("File system")
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
return self.Get('cl_autopartition_disk_format') + \ return self.Get('cl_autopartition_disk_format') + \
map(lambda x:"",self.Get('cl_autopartition_bind_path')) map(lambda x:"",self.Get('cl_autopartition_bind_path'))
else: else:
@ -950,7 +950,7 @@ class VariableOsLocationPerformFormat(LocationHelper,Variable):
self.label = _("Format") self.label = _("Format")
def get(self): def get(self):
if self.Get('cl_autopartition_set') == "auto": if self.Get('cl_autopartition_set') == "on":
return map(lambda x:"on", return map(lambda x:"on",
self.Get('cl_autopartition_disk_format')) + \ self.Get('cl_autopartition_disk_format')) + \
map(lambda x:"", map(lambda x:"",
@ -1280,7 +1280,7 @@ class VariableOsInstallDiskParent(SourceReadonlyVariable):
def getMap(self): def getMap(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 # replace value for autopartition
if self.Get('cl_autopartition_set') == 'auto': if self.Get('cl_autopartition_set') == 'on':
diskParent.update(zip(self.Get('cl_autopartition_disk_dev'), diskParent.update(zip(self.Get('cl_autopartition_disk_dev'),
self.Get('cl_autopartition_device')* self.Get('cl_autopartition_device')*
len(self.Get('cl_autopartition_disk_dev')))) len(self.Get('cl_autopartition_disk_dev'))))
@ -1346,7 +1346,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
def get(self): def get(self):
"""Get default Master boot record install""" """Get default Master boot record install"""
if self.Get('cl_autopartition_set') == 'auto' and \ if self.Get('cl_autopartition_set') == 'on' and \
self.Get('cl_autopartition_lvm_set') == 'on': self.Get('cl_autopartition_lvm_set') == 'on':
return self.Get('cl_autopartition_device') return self.Get('cl_autopartition_device')
if self.Get('os_install_root_type') in ("flash","usb-hdd"): if self.Get('os_install_root_type') in ("flash","usb-hdd"):
@ -1419,7 +1419,7 @@ class VariableOsInstallMbr(LocationHelper,Variable):
raise VariableError( raise VariableError(
_("For flash installation need only one disk")) _("For flash installation need only one disk"))
for mbrDisk in value: for mbrDisk in value:
if self.Get('cl_autopartition_set') == 'auto': if self.Get('cl_autopartition_set') == 'on':
tableOnBootDisk = self.Get('cl_autopartition_table') tableOnBootDisk = self.Get('cl_autopartition_table')
else: else:
tableOnBootDisk = self.Select('os_device_table', tableOnBootDisk = self.Select('os_device_table',
@ -1488,7 +1488,7 @@ class VariableOsInstallRootType(LocationHelper,Variable):
self.label = _("Installation type") self.label = _("Installation type")
def get(self): def get(self):
if self.Get('cl_autopartition_set') == 'auto': if self.Get('cl_autopartition_set') == 'on':
return "hdd" return "hdd"
rootdev = self.Get('os_install_root_dev') rootdev = self.Get('os_install_root_dev')
devicetype = getPartitionDevice( devicetype = getPartitionDevice(

@ -262,12 +262,14 @@ class VariableClImageFilename(Variable,DistroRepository):
""" """
type = 'file' type = 'file'
element = 'file' element = 'file'
metaval = "IMAGE"
opt = ['--iso'] opt = ['--iso']
untrusted = True untrusted = True
def init(self): def init(self):
self.label = _("Installation image") self.label = _("Installation image")
self.help = _("ISO image for installation") self.help = _("ISO image for installation")
# TODO: ????
self.wrong = True self.wrong = True
def get(self): def get(self):
@ -325,6 +327,7 @@ class VariableClImageArchMachine(Variable,DistroRepository):
value = "" value = ""
type = 'choice' type = 'choice'
opt = ['--march'] opt = ['--march']
metaval = "ARCH"
available_arch = ["i686","x86_64"] available_arch = ["i686","x86_64"]
def init(self): def init(self):
@ -350,6 +353,7 @@ class VariableClImageLinuxShortname(Variable,Linux,DistroRepository):
""" """
value = "" value = ""
type = 'choice' type = 'choice'
metaval = "SYSTEM"
opt = ['--os','-s'] opt = ['--os','-s']
def init(self): def init(self):

@ -116,6 +116,7 @@ class VariableOsInstallLocaleLang(LocaleVariable):
Full language (at example: ru_RU) Full language (at example: ru_RU)
""" """
mode = 'w' mode = 'w'
metaval = "LANG"
type = 'choice' type = 'choice'
opt = ["--lang","-l"] opt = ["--lang","-l"]

@ -108,7 +108,7 @@ class VariableOsInstallNetData(NetHelper,TableVariable):
Hash for information about net Hash for information about net
""" """
opt = ["--ip"] opt = ["--ip"]
metavalue = "IFACE:IP:MASK" metavalue = "IFACE_SETTINGS"
source = ["os_install_net_interfaces", source = ["os_install_net_interfaces",
"os_install_net_dhcp_set", "os_install_net_dhcp_set",
"os_install_net_ip", "os_install_net_ip",
@ -132,6 +132,7 @@ class VariableOsInstallNetFqdn(NetHelper,Variable):
Full host name Full host name
""" """
opt = ['--hostname'] opt = ['--hostname']
metaval = "HOSTNAME"
def init(self): def init(self):
self.label = _("Hostname") self.label = _("Hostname")
@ -325,7 +326,7 @@ class VariableOsInstallNetRouteData(NetHelper,TableVariable):
Route table data Route table data
""" """
opt = ["--route"] opt = ["--route"]
metavalue = "NETWORK:[GATEWAY][:DEV[:SOURCE]]" metavalue = "NETROUTE"
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',
@ -334,7 +335,8 @@ class VariableOsInstallNetRouteData(NetHelper,TableVariable):
def init(self): def init(self):
self.label = _("Routing") self.label = _("Routing")
self.help = _("add a routing rule") self.help = \
_("add a routing rule (format NETWORK:[GATEWAY][:DEV[:SOURCE]])")
def get(self,hr=False): def get(self,hr=False):
"""Routing hash""" """Routing hash"""

Loading…
Cancel
Save