X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2FBootManager.py;h=b49d978ffa0966178349376b36a2f5e8e13cf264;hb=88cfdd881bbd5191eaaf6408e0b8d57bfdf51438;hp=a118f662f28006e415e7cf0ba959b76f1b60c965;hpb=dc8d8c9e8ec6b53bacf62fd301bbf0b28e836e44;p=bootmanager.git diff --git a/source/BootManager.py b/source/BootManager.py index a118f66..b49d978 100755 --- a/source/BootManager.py +++ b/source/BootManager.py @@ -56,13 +56,13 @@ from gzip import GzipFile from steps import * from Exceptions import * import notify_messages +import BootServerRequest # all output is written to this file LOG_FILE= "/tmp/bm.log" -CURL_PATH= "curl" -UPLOAD_LOG_URL = "http://boot.planet-lab.org/alpina-logs/upload.php" +UPLOAD_LOG_PATH = "/alpina-logs/upload.php" # the new contents of PATH when the boot manager is running BIN_PATH= ('/usr/local/bin', @@ -119,15 +119,16 @@ class log: """ if self.OutputFile is not None: - self.LogEntry( "Uploading logs to %s" % UPLOAD_LOG_URL ) + self.LogEntry( "Uploading logs to %s" % UPLOAD_LOG_PATH ) self.OutputFile.close() self.OutputFile= None - - curl_cmd= "%s -s --connect-timeout 60 --max-time 600 " \ - "--form log=@%s %s" % \ - (CURL_PATH, self.OutputFilePath, UPLOAD_LOG_URL) - os.system( curl_cmd ) + + bs_request = BootServerRequest.BootServerRequest() + bs_request.MakeRequest(PartialPath = UPLOAD_LOG_PATH, + GetVars = None, PostVars = None, + FormData = ["log=@" + self.OutputFilePath], + DoSSL = True, DoCertCheck = True) @@ -240,7 +241,7 @@ class BootManager: SendHardwareConfigToPLC.Run( self.VARS, self.LOG ) ChainBootNode.Run( self.VARS, self.LOG ) else: - self._nodeNotInstalled() + _nodeNotInstalled() def _newRun(): # implements the new install logic, which will first check @@ -252,7 +253,7 @@ class BootManager: return 0 self.VARS['BOOT_STATE']= 'rins' UpdateBootStateWithPLC.Run( self.VARS, self.LOG ) - self._rins() + _rinsRun() def _bootRun(): # implements the boot logic, which consists of first @@ -266,7 +267,7 @@ class BootManager: SendHardwareConfigToPLC.Run( self.VARS, self.LOG ) ChainBootNode.Run( self.VARS, self.LOG ) else: - self._nodeNotInstalled() + _nodeNotInstalled() def _debugRun(): @@ -315,7 +316,6 @@ class BootManager: InstallInit.Run( self.VARS, self.LOG ) InstallPartitionDisks.Run( self.VARS, self.LOG ) InstallBootstrapRPM.Run( self.VARS, self.LOG ) - InstallBase.Run( self.VARS, self.LOG ) InstallWriteConfig.Run( self.VARS, self.LOG ) InstallBuildVServer.Run( self.VARS, self.LOG ) InstallNodeInit.Run( self.VARS, self.LOG )