From: Mark Huang Date: Fri, 23 Sep 2005 01:14:26 +0000 (+0000) Subject: - XXX back out 1.5 temporarily for a tag X-Git-Tag: bootmanager-3_1_9~1 X-Git-Url: http://git.onelab.eu/?p=bootmanager.git;a=commitdiff_plain;h=4c6ae1342e6544e6206ae633fcc71d2e25caac07 - XXX back out 1.5 temporarily for a tag --- diff --git a/source/BootManager.py b/source/BootManager.py index 8f952b4..fdda2a3 100755 --- a/source/BootManager.py +++ b/source/BootManager.py @@ -62,7 +62,7 @@ import notify_messages # 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" # the new contents of PATH when the boot manager is running BIN_PATH= ('/usr/local/bin', @@ -78,9 +78,6 @@ BIN_PATH= ('/usr/local/bin', class log: def __init__( self, OutputFilePath= None ): - - self.UPLOAD_LOG_URL= None - if OutputFilePath: try: self.OutputFilePath= OutputFilePath @@ -106,6 +103,7 @@ class log: self.OutputFile.flush() + def write( self, str ): """ make log behave like a writable file object (for traceback @@ -114,27 +112,21 @@ class log: self.LogEntry( str, 0, 1 ) - def SetUploadServer( self, server ): - """ - set the url we should use to upload the logs to - """ - self.UPLOAD_LOG_URL = "http://%s/alpina-logs/upload.php" % server - def Upload( self ): """ upload the contents of the log to the server """ - if self.OutputFile is not None and self.UPLOAD_LOG_URL is not None: - self.LogEntry( "Uploading logs to %s" % self.UPLOAD_LOG_URL ) + if self.OutputFile is not None: + self.LogEntry( "Uploading logs to %s" % UPLOAD_LOG_URL ) self.OutputFile.close() self.OutputFile= None curl_cmd= "%s -s --connect-timeout 60 --max-time 600 " \ "--form log=@%s %s" % \ - (CURL_PATH, self.OutputFilePath, self.UPLOAD_LOG_URL) + (CURL_PATH, self.OutputFilePath, UPLOAD_LOG_URL) os.system( curl_cmd ) @@ -172,7 +164,7 @@ class BootManager: # not sure what the current PATH is set to, replace it with what # we know will work with all the boot cds os.environ['PATH']= string.join(BIN_PATH,":") - + self.CAN_RUN= 1