print( "Unable to open output file for log, continuing" )
self.OutputFile= None
- # for upload
- os.system( "ifconfig eth0 > /tmp/ifconfig" )
-
def LogEntry( self, str, inc_newline= 1, display_screen= 1 ):
if self.OutputFile:
"""
upload the contents of the log to the server
"""
-
- 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 --form ifconfig=\</tmp/ifconfig %s" % \
- (CURL_PATH, self.OutputFilePath, UPLOAD_LOG_URL)
- os.system( curl_cmd )
+
+ 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, UPLOAD_LOG_URL)
+ os.system( curl_cmd )