Many bugfix of terminate execute by InstallError.

Fix return code by answer 'no' for question continue installation.
Fix using translate for cl_fill_install module.
Add check existing of command fdisk and parted.
Add catch of exceptions for setInstallOption.
Change order of getting TargetDistr and printInfo for corrent work
with wrong pipe.
Fix string for translate and update translate.
netsetup
Mike Hiretsky 14 years ago
parent e459a79d5c
commit 4b55e557f2

Binary file not shown.

@ -15,6 +15,7 @@
# limitations under the License.
import os
import sys
import re
from crypt import crypt
import cl_overriding
@ -29,6 +30,11 @@ from cl_template import _terms
from subprocess import PIPE, Popen
from cl_install import convertDictOpt
from cl_lang import lang
tr = lang()
tr.setLocalDomain('cl_install')
tr.setLanguage(sys.modules[__name__])
class fillVars(object, glob_attr):
nonTransferedDirs = ["/","/bin", "/dev", "/etc",
"/lib", "/lib32", "/lib64",
@ -134,10 +140,15 @@ class fillVars(object, glob_attr):
curDevice = None
# getting id
execStr = '/sbin/fdisk -l'
execProg = '/sbin/fdisk'
execStr = '%s -l'%execProg
if not path.exists(execProg):
cl_overriding.printERROR(_("Command not found '%s'")%execProg)
cl_overriding.exit(1)
execStr = '%s -l'%execProg
res = self._runos(execStr,env={"LANG":"C"})
if res is False:
cl_overriding.printERROR("Cann't execute '%s'"%execStr)
cl_overriding.printERROR(_("Cann't execute '%s'")%execStr)
cl_overriding.exit(1)
partedLines = filter(lambda x: x.startswith('/dev/'), res or [] )
partedMatrix = map(lambda x: filter(lambda y: y and y!="*",
@ -149,10 +160,14 @@ class fillVars(object, glob_attr):
disk_hash[part]['id'] = sysid
# parse all parted lines started with Disk and started with number
execStr = '/usr/sbin/parted -l'
execProg = '/usr/sbin/parted'
execStr = '%s -l'%execProg
if not path.exists(execProg):
cl_overriding.printERROR(_("Command not found '%s'")%execProg)
cl_overriding.exit(1)
res = self._runos(execStr,env={"LANG":"C"})
if res is False:
cl_overriding.printERROR("Cann't execute '%s'"%execStr)
cl_overriding.printERROR(_("Cann't execute '%s'")%execStr)
cl_overriding.exit(1)
partedLines = filter(lambda x: x.startswith("Disk") or
x.strip()[:1].isdigit(), res )
@ -174,9 +189,12 @@ class fillVars(object, glob_attr):
disk_hash[partition]['size'] = parts[3]
# fill format, name and uuid
execStr = '/sbin/blkid'
if not path.exists(execStr):
cl_overriding.printERROR(_("Command not found '%s'")%execStr)
cl_overriding.exit(1)
res = self._runos(execStr)
if res is False:
cl_overriding.printERROR("Cann't execute '%s'"%execStr)
cl_overriding.printERROR(_("Cann't execute '%s'")%execStr)
cl_overriding.exit(1)
# map attribute name of blkid to disk_hash
blkid_hash = {'LABEL':'name',

@ -804,7 +804,7 @@ class cl_install(color_print, SignalInterrupt):
else:
return dirsFiles
def printInfo(self,sourceDistr,targetDistr):
def printInfo(self):
self.printSUCCESS(_("Installation") + " Calculate Linux")
self.defaultPrint("%s\n"%_("System information"))
self.printSUCCESS(_("Computer name")+": %s"%
@ -1278,11 +1278,15 @@ class cl_install(color_print, SignalInterrupt):
def setInstallOptions(self, listDisks, listBinds, listSwaps, listUsers,
mbrDisk):
"""Set install options (set users, disks and mbr"""
if self.setUsers(listUsers) and \
self.setDisks(listDisks,listBinds,listSwaps) and \
self.setMBR(mbrDisk):
return self.createListOptions()
else:
try:
if self.setUsers(listUsers) and \
self.setDisks(listDisks,listBinds,listSwaps) and \
self.setMBR(mbrDisk):
return self.createListOptions()
else:
return False
except InstallError,e:
self.printERROR(str(e).strip())
return False
def getDeviceByField(self,field,value, secondPrefix="os_disk"):
@ -1788,13 +1792,14 @@ class cl_install(color_print, SignalInterrupt):
rootPartIsFormat=rootPartCmdDict['isFormat']
rootPartSystemId=rootPartCmdDict['systemId']
self.printInfo()
targetDistr = self.getTargetDistributive(rootPartdev,
buildermode=builder,
fileSystem=rootPartFileSystem,
isFormat=rootPartIsFormat,
systemId=rootPartSystemId)
self.printInfo(sourceDistr,targetDistr)
distRep = DistributiveRepository()
minver = "10.8"
instver = \
@ -1818,7 +1823,8 @@ the system") + " (yes/no)"
self.defaultPrint("\n")
raise KeyboardInterrupt
if dialogRes in (None,False):
return True
self.printERROR(_("Interrupting the installation"))
return False
# set Users passwords
if self.clVars.Get('os_install_root_type') != "flash":
changePwdUsers = \

Loading…
Cancel
Save