<s> from subprocess import check_call , Popen , PIPE , CalledProcessError <EOL> from . queued_drmaa import DrmaaQueueManager <EOL> import logging <EOL> log = logging . getLogger ( __name__ ) <EOL> class XsedeDrmaaQueueManager ( DrmaaQueueManager ) : <EOL> """<STR_LIT>""" <EOL> manager_type = "<STR_LIT>" <EOL> def launch ( self , job_id , command_line , submit_params = { } , dependencies_description = None , env = [ ] ) : <EOL> super ( XsedeDrmaaQueueManager , self ) . launch ( <EOL> job_id , <EOL> command_line , <EOL> submit_params = submit_params , <EOL> dependencies_description = dependencies_description , <EOL> env = env <EOL> ) <EOL> try : <EOL> check_call ( [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> submit_params . get ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> '<STR_LIT>' , <EOL> check_output ( [ '<STR_LIT:date>' , '<STR_LIT>' ] ) . strip ( ) , <EOL> '<STR_LIT>' , <EOL> self . _external_ids [ job_id ] <EOL> ] ) <EOL> except ( OSError , IOError , CalledProcessError ) : <EOL> log . exception ( '<STR_LIT>' ) <EOL> def check_output ( args ) : <EOL> """<STR_LIT>""" <EOL> proc = Popen ( args , stdout = PIPE ) <EOL> out = proc . communicate ( ) [ <NUM_LIT:0> ] <EOL> if proc . returncode : <EOL> raise CalledProcessError ( proc . returncode , args , output = out ) <EOL> return out </s>
