- XXX back out 1.5 temporarily for a tag
authorMark Huang <mlhuang@cs.princeton.edu>
Fri, 23 Sep 2005 01:14:26 +0000 (01:14 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Fri, 23 Sep 2005 01:14:26 +0000 (01:14 +0000)
source/BootManager.py

index 8f952b4..fdda2a3 100755 (executable)
@@ -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