if __name__ == "__main__": connection = None job = None try: #Get WebServer configuration options = UtilityFunctions.DefaultWebAppConfiguration() #Parse the command line for more info parser = WebScript.CommandLineParser() parser.parseCommandLine() #Connect to the database in case there is an error connection = UtilityFunctions.ConnectionFromDefaultConfiguration() job = Data.Job(jobID=parser.jobID(), connection=connection) #call main print 'Setting up remote launch for job %s' % parser.jobID() main(parser, options, job) print 'Job sent' except SystemExit, data: connection.close() #This is raised by sys.exit #Should have already been logged by the script so ignore it print "\nEncountered an error with remote launch" print "Check database entry for job for more info" raise except BaseException, data: