|
|
|
@ -93,7 +93,7 @@ CMD_OPTIONS = [{'shortOption':"d",
|
|
|
|
|
#'help':_("installation for assembling")
|
|
|
|
|
#}]
|
|
|
|
|
|
|
|
|
|
class install_cmd(cl_install,share_cmd):
|
|
|
|
|
class install_cmd(share_cmd):
|
|
|
|
|
"""Class for work with cl_install by console"""
|
|
|
|
|
def __init__(self):
|
|
|
|
|
self.optobj = opt(package=__app__,
|
|
|
|
@ -102,7 +102,7 @@ class install_cmd(cl_install,share_cmd):
|
|
|
|
|
option_list= CMD_OPTIONS + opt.variable_control +
|
|
|
|
|
opt.color_control,
|
|
|
|
|
check_values=self.checkOpts)
|
|
|
|
|
cl_install.__init__(self)
|
|
|
|
|
self.logicObj = cl_install()
|
|
|
|
|
# names incompatible options with --live
|
|
|
|
|
self.optionsLiveIncompatible = ["d", "b", "mbr", "w", "f", "s"]
|
|
|
|
|
|
|
|
|
@ -155,7 +155,8 @@ class install_cmd(cl_install,share_cmd):
|
|
|
|
|
return False
|
|
|
|
|
if not (values.install or values.uninstall or values.live):
|
|
|
|
|
if values.v is False and \
|
|
|
|
|
values.d is None and not self.clVars.Get('os_install_dev_from'):
|
|
|
|
|
values.d is None and \
|
|
|
|
|
not self.logicObj.clVars.Get('os_install_dev_from'):
|
|
|
|
|
self.optobj.error(_("need specify disk by '-d' option"))
|
|
|
|
|
# check syntax DISK:DIR:FS:'Do I need to format the disk'
|
|
|
|
|
if values.d:
|
|
|
|
@ -204,7 +205,7 @@ class install_cmd(cl_install,share_cmd):
|
|
|
|
|
|
|
|
|
|
def setLang(self,lang):
|
|
|
|
|
"""Process set locales by lang"""
|
|
|
|
|
if self.setAllLocaleByLang(lang):
|
|
|
|
|
if self.logicObj.setAllLocaleByLang(lang):
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
self.printERROR(_("specified lang %s is unsupported")%lang)
|
|
|
|
@ -213,11 +214,11 @@ class install_cmd(cl_install,share_cmd):
|
|
|
|
|
def setProxyNtp(self,proxy,ntp):
|
|
|
|
|
"""Process set locales by lang"""
|
|
|
|
|
if proxy:
|
|
|
|
|
if not self.clVars.SetWriteVar('os_install_proxy',proxy):
|
|
|
|
|
if not self.logicObj.clVars.SetWriteVar('os_install_proxy',proxy):
|
|
|
|
|
self.printERROR(get_install_errors(),printBR=False)
|
|
|
|
|
return False
|
|
|
|
|
elif ntp:
|
|
|
|
|
if not self.clVars.SetWriteVar('os_install_ntp',ntp):
|
|
|
|
|
if not self.logicObj.clVars.SetWriteVar('os_install_ntp',ntp):
|
|
|
|
|
self.printERROR(get_install_errors(),printBR=False)
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
@ -228,19 +229,17 @@ class install_cmd(cl_install,share_cmd):
|
|
|
|
|
for vals in options.set:
|
|
|
|
|
for val in vals.split(','):
|
|
|
|
|
k,o,v = val.partition('=')
|
|
|
|
|
if self.clVars.exists(k):
|
|
|
|
|
if not self.clVars.SetWriteVar(k,v):
|
|
|
|
|
if self.logicObj.clVars.exists(k):
|
|
|
|
|
if not self.logicObj.clVars.SetWriteVar(k,v):
|
|
|
|
|
self.printERROR(get_install_errors(),printBR=False)
|
|
|
|
|
return False
|
|
|
|
|
else:
|
|
|
|
|
self.printERROR(_('variable %s not found')%k)
|
|
|
|
|
return False
|
|
|
|
|
if options.live:
|
|
|
|
|
#self.clVars.Set('cl_image','',True)
|
|
|
|
|
self.clVars.Set('cl_action','merge',True)
|
|
|
|
|
self.logicObj.clVars.Set('cl_action','merge',True)
|
|
|
|
|
else:
|
|
|
|
|
self.clVars.Set('cl_action','system',True)
|
|
|
|
|
|
|
|
|
|
self.logicObj.clVars.Set('cl_action','system',True)
|
|
|
|
|
if options.s:
|
|
|
|
|
self.setLinuxName(options.s.upper())
|
|
|
|
|
return True
|
|
|
|
@ -262,7 +261,7 @@ class install_cmd(cl_install,share_cmd):
|
|
|
|
|
listSwapOptions = self._parseOptSwap(swapOptions)
|
|
|
|
|
if listSwapOptions is False:
|
|
|
|
|
return False
|
|
|
|
|
if not self.setInstallOptions(listDiskOptions, listBindOptions,
|
|
|
|
|
if not self.logicObj.setInstallOptions(listDiskOptions, listBindOptions,
|
|
|
|
|
listSwapOptions):
|
|
|
|
|
return False
|
|
|
|
|
return True
|
|
|
|
@ -330,14 +329,36 @@ class install_cmd(cl_install,share_cmd):
|
|
|
|
|
|
|
|
|
|
def templateSelect(self,template):
|
|
|
|
|
"""Process template appling"""
|
|
|
|
|
if self.applyTemplatesForSystem():
|
|
|
|
|
if self.logicObj.applyTemplatesForSystem():
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def installSystem(self, force=False, bootDisk=None, users=[]):
|
|
|
|
|
if cl_install.installSystem(self, force=force, bootDisk=bootDisk,
|
|
|
|
|
"""Run install system"""
|
|
|
|
|
if self.logicObj.installSystem(force=force, bootDisk=bootDisk,
|
|
|
|
|
users=users):
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def configureSystem(self):
|
|
|
|
|
"""Run configure system"""
|
|
|
|
|
if self.logicObj.configureSystem():
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def installPackage(self):
|
|
|
|
|
"""Run package installation"""
|
|
|
|
|
if self.logicObj.installPackage():
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
def uninstallPackage(self):
|
|
|
|
|
"""Run package uninstallation"""
|
|
|
|
|
if self.logicObj.uninstallPackage():
|
|
|
|
|
return True
|
|
|
|
|
else:
|
|
|
|
|
return False
|
|
|
|
|