Ejemplo n.º 1
0
    def __init__(self, formData, construct=False):
        '''Constructor
		
		Parameters:
			formData - A FormData instance
			construct - If True this method calls construct immediately,
				otherwise construct must be called at a later stage.
				This allows parameters to be modified.'''

        self.formData = formData
        self.runString = None
        self.errorData = None
        self.job = None
        self.jobManager = None

        try:
            self.options = UtilityFunctions.DefaultWebAppConfiguration()
            self.connection = UtilityFunctions.ConnectionFromConfiguration(
                self.options)
            self.webServerDirectory = self.options.get('WEB APPLICATION',
                                                       'webServerDirectory')
            self.uploadLimit = int(
                self.options.get('WEB APPLICATION', 'uploadLimit'))
        except Core.Exceptions.EnvironmentError, data:
            self._setErrorData(data)
            return
Ejemplo n.º 2
0
            host=host)

    if (retval != 0):
        job.setError(description="Error during remote launch",
                     detailedDescription="Failed to submit job to queue")
        sys.exit(retval)


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: