'Stores the content of a DRMAA JobTemplate object in a file as a JSON string.
Path is hard-coded, but it\'s no worse than other path in this module.
Uses Galaxy\'s JobID, so file is expected to be unique.'

def store_jobtemplate(self, job_wrapper, jt):

    filename = ('%s/%s.jt_json' % (self.app.config.cluster_files_directory, job_wrapper.get_id_tag()))
    with open(filename, 'w+') as fp:
        json.dump(jt, fp)
    log.debug(('(%s)    Job    script    for    external    submission    is:    %s' % (job_wrapper.job_id, filename)))
    return filename
