Hide install messages for cl-install --live.

Hide message in calculate-client and calculate-desktop
installation executed by cl-install --live.
master3.3
Mike Hiretsky 14 years ago
parent 929cd08b98
commit 7e14d1c7e3

@ -29,6 +29,7 @@ from cl_utils import runOsCommand,appendProgramToEnvFile, \
from cl_kernel_utils import KernelConfig,InitRamFs
import cl_overriding
from StringIO import StringIO
install_errors = ""
def installExit(*args,**kwars):
@ -770,6 +771,8 @@ class cl_install(color_print):
self.listBindsOptions = []
self.listSwapsOptions = []
self.startMessage = ""
self.stdoutHide = None
self.stderrHide = None
Spinner().setWriteFunc(self.defaultPrint)
def setNoColor(self):
@ -1570,6 +1573,22 @@ class cl_install(color_print):
os.unlink(nvidiaMaskFile)
return res
def hideStdout(self):
if not self.stdoutHide:
self.stdoutHide = sys.stdout
self.stderrHide = sys.stderr
sys.stdout = StringIO()
sys.stderr = StringIO()
sys.stdout.fileno = self.stdoutHide.fileno
sys.stderr.fileno = self.stderrHide.fileno
def showStdout(self):
if self.stdoutHide:
sys.stdout = self.stdoutHide
sys.stderr = self.stderrHide
self.stdoutHide = None
self.stderrHide = None
def configureSystem(self):
"""configure current system"""
configureMessage = _("Configure system")
@ -1589,9 +1608,14 @@ class cl_install(color_print):
if path.exists(desktopLib):
sys.path.insert(0, path.abspath(desktopLib))
from cl_desktop import desktop
self.printMessageForTest(
_("Link calculate-desktop to package configuration"))
self.hideStdout()
objDesktop = desktop()
objDesktop.createClVars()
objDesktop.installProg()
self.showStdout()
self.printByResult(True)
# install client package
if linuxShortname in ("CLD","CLDG","CLDX"):
@ -1599,12 +1623,17 @@ class cl_install(color_print):
if path.exists(clientLib):
sys.path.insert(0, path.abspath(clientLib))
from cl_client import client
self.printMessageForTest(
_("Link calculate-client to package configuration"))
objClient = client()
objClient.createClVars()
self.hideStdout()
if hasattr(objClient,"updateEnvFiles") and \
objClient.updateEnvFiles():
objClient.clVars.flIniFile()
objClient.installProg()
self.showStdout()
self.printByResult(True)
objUsers = currentUsers()
if self.clVars.Get('os_root_type') == "livecd":
@ -1631,6 +1660,7 @@ class cl_install(color_print):
keyInter = True
except KeyboardInterrupt:
keyInter = True
self.showStdout()
if keyInter:
if self.startMessage:
self.printByResult(False)

Loading…
Cancel
Save