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):
"""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):
"""Type of device for install"""

@ -596,7 +596,8 @@ class cl_install(color_print):
def applyTemplatesForSystem(self):
"""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.clTempl = template(self.clVars)
dirsFiles = self.clTempl.applyTemplates()
@ -685,7 +686,8 @@ class cl_install(color_print):
def applyTemplates(self,directory):
"""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.clTempl = template(self.clVars)
dirsFiles = self.clTempl.applyTemplates()
@ -1124,8 +1126,25 @@ class cl_install(color_print):
def configureSystem(self):
"""configure current system"""
self.printSUCCESS("Configurating system")
if self.clVars.Get('os_root_type') == "livecd":
self.applyTemplates('/')
error = None
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
def installSystem(self, force=False, bootDisk=None, users=[]):
@ -1266,6 +1285,8 @@ the system") + " (yes/no)"
except (InstallError,DistributiveError),e:
error = e
#for i in apply(traceback.format_exception, sys.exc_info()):
# print i
except (Exception),e:
error = ""
for i in apply(traceback.format_exception, sys.exc_info()):
@ -1290,6 +1311,7 @@ the system") + " (yes/no)"
if error:
for line in filter(lambda x: x,str(error).split('\n')):
self.printERROR(line)
self.printERROR(_("System installation failed"))
return False
self.printSUCCESS(_("System successfully installed"))
return True

Loading…
Cancel
Save