Add setting cl_chroot_path. Fix os_install_net_domain variable.

Add try block for system configuration.
netsetup
Mike Hiretsky 14 years ago
parent ca1a6c94f3
commit 5c772abd13

@ -660,7 +660,8 @@ class fillVars(object, glob_attr):
def get_os_install_net_domain(self): def get_os_install_net_domain(self):
"""Domain""" """Domain"""
return self.Get("os_net_domain") domain=self._runos("hostname -d 2>&1")
return domain or "local"
def get_os_install_root_type(self): def get_os_install_root_type(self):
"""Type of device for install""" """Type of device for install"""

@ -596,7 +596,8 @@ class cl_install(color_print):
def applyTemplatesForSystem(self): def applyTemplatesForSystem(self):
"""Apply templates for root of system.""" """Apply templates for root of system."""
self.clVars.Set("cl_root_path","/", True) #self.clVars.Set("cl_root_path","/", True)
self.clVars.Set("cl_chroot_path","/", True)
self.clVars.Set("cl_pass_action", "system", True) self.clVars.Set("cl_pass_action", "system", True)
self.clTempl = template(self.clVars) self.clTempl = template(self.clVars)
dirsFiles = self.clTempl.applyTemplates() dirsFiles = self.clTempl.applyTemplates()
@ -685,7 +686,8 @@ class cl_install(color_print):
def applyTemplates(self,directory): def applyTemplates(self,directory):
"""Apply templates for root of system.""" """Apply templates for root of system."""
self.clVars.Set("cl_root_path",directory, True) #self.clVars.Set("cl_root_path",directory, True)
self.clVars.Set("cl_chroot_path",directory, True)
self.clVars.Set("cl_pass_action", "system", True) self.clVars.Set("cl_pass_action", "system", True)
self.clTempl = template(self.clVars) self.clTempl = template(self.clVars)
dirsFiles = self.clTempl.applyTemplates() dirsFiles = self.clTempl.applyTemplates()
@ -1124,8 +1126,25 @@ class cl_install(color_print):
def configureSystem(self): def configureSystem(self):
"""configure current system""" """configure current system"""
self.printSUCCESS("Configurating system") self.printSUCCESS("Configurating system")
if self.clVars.Get('os_root_type') == "livecd": error = None
self.applyTemplates('/') try:
if self.clVars.Get('os_root_type') == "livecd":
self.applyTemplates('/')
except (InstallError,DistributiveError),e:
error = e
except (Exception),e:
error = ""
for i in apply(traceback.format_exception, sys.exc_info()):
error += i
except KeyboardInterrupt,e:
self.defaultPrint("\n")
self.printWARNING("Interrupting the configuration")
error = _("Configuration manually interrupt")
if error:
for line in filter(lambda x: x,str(error).split('\n')):
self.printERROR(line)
self.printERROR(_("System configuration failed"))
return False
return True return True
def installSystem(self, force=False, bootDisk=None, users=[]): def installSystem(self, force=False, bootDisk=None, users=[]):
@ -1266,6 +1285,8 @@ the system") + " (yes/no)"
except (InstallError,DistributiveError),e: except (InstallError,DistributiveError),e:
error = e error = e
#for i in apply(traceback.format_exception, sys.exc_info()):
# print i
except (Exception),e: except (Exception),e:
error = "" error = ""
for i in apply(traceback.format_exception, sys.exc_info()): for i in apply(traceback.format_exception, sys.exc_info()):
@ -1290,6 +1311,7 @@ the system") + " (yes/no)"
if error: if error:
for line in filter(lambda x: x,str(error).split('\n')): for line in filter(lambda x: x,str(error).split('\n')):
self.printERROR(line) self.printERROR(line)
self.printERROR(_("System installation failed"))
return False return False
self.printSUCCESS(_("System successfully installed")) self.printSUCCESS(_("System successfully installed"))
return True return True

Loading…
Cancel
Save