def get_input_file_dictionary(indata, workdir):
    """
    Return an input file dictionary.
    Format: {'guid': 'pfn', ..}
    Normally use_turl would be set to True if direct access is used.

    :param indata: list of FileSpec objects.
    :param workdir: job.workdir (string).
    :return: file dictionary.
    """
    ret = {}
    for fspec in indata:
        ret[fspec.guid
            ] = fspec.turl if fspec.status == 'remote_io' else fspec.lfn
        if not ret[fspec.guid]:
            ret[fspec.guid] = fspec.lfn
    return ret
