'This method blocks, so if invoking the transfer manager ever starts
taking too long, we should move it to a thread.  However, the
transfer_manager will either daemonize or return after submitting to a
running daemon, so it should be fairly quick to return.'

def run(self, transfer_jobs):

    transfer_jobs = listify(transfer_jobs)
    printable_tj_ids = ',    '.join([str(tj.id) for tj in transfer_jobs])
    log.debug(('Initiating    transfer    job(s):    %s' % printable_tj_ids))
    [tj.__setattr__('state', tj.states.RUNNING) for tj in transfer_jobs]
    self.sa_session.add_all(transfer_jobs)
    self.sa_session.flush()
    for tj in transfer_jobs:
        cmd = ('%s    %s' % (self.command, tj.id))
        log.debug(('Transfer    command    is:    %s' % cmd))
        p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        p.wait()
        output = p.stdout.read(32768)
        if (p.returncode != 0):
            log.error(('Spawning    transfer    job    failed:    %s:    %s' % (tj.id, output)))
            tj.state = tj.states.ERROR
            tj.info = ('Spawning    transfer    job    failed:    %s' % output.splitlines()[(-1)])
            self.sa_session.add(tj)
            self.sa_session.flush()
