def unshadow_output(self, job, only_log=False):
    ' Move files from shadow directory to real output paths. '
    if ((not job.shadow_dir) or (not job.expanded_output)):
        return
    files = (job.log if only_log else chain(job.expanded_output, job.log))
    for real_output in files:
        shadow_output = job.shadowed_path(real_output).file
        if os.path.islink(shadow_output):
            dest = os.readlink(shadow_output)
            if os.path.isabs(dest):
                rel_dest = os.path.relpath(dest, job.shadow_dir)
                os.remove(shadow_output)
                os.symlink(rel_dest, shadow_output)
        if (os.path.realpath(shadow_output) == os.path.realpath(real_output)):
            continue
        logger.debug('Moving shadow output {} to destination {}'.format(shadow_output, real_output))
        shutil.move(shadow_output, real_output)
    shutil.rmtree(job.shadow_dir)
Move files from shadow directory to real output paths.
def unshadow_output(self, job, only_log=False):
    '  '
    if ((not job.shadow_dir) or (not job.expanded_output)):
        return
    files = (job.log if only_log else chain(job.expanded_output, job.log))
    for real_output in files:
        shadow_output = job.shadowed_path(real_output).file
        if os.path.islink(shadow_output):
            dest = os.readlink(shadow_output)
            if os.path.isabs(dest):
                rel_dest = os.path.relpath(dest, job.shadow_dir)
                os.remove(shadow_output)
                os.symlink(rel_dest, shadow_output)
        if (os.path.realpath(shadow_output) == os.path.realpath(real_output)):
            continue
        logger.debug('Moving shadow output {} to destination {}'.format(shadow_output, real_output))
        shutil.move(shadow_output, real_output)
    shutil.rmtree(job.shadow_dir)