'This checks the in memory cache first as the fact was not expired at \'gather time\'
and it would be problematic if the key did expire after some long running tasks and
user gets \'undefined\' error in the same play'

def get(self, key):

    if (key in self._cache):
        return self._cache.get(key)
    if (self.has_expired(key) or (key == '')):
        raise KeyError
    cachefile = ('%s/%s' % (self._cache_dir, key))
    try:
        try:
            value = self._load(cachefile)
            self._cache[key] = value
            return value
        except ValueError as e:
            display.warning(("error    in    '%s'    cache    plugin    while    trying    to    read    %s    :    %s.    Most    likely    a    corrupt    file,    so    erasing    and    failing." % (self.plugin_name, cachefile, to_bytes(e))))
            self.delete(key)
            raise AnsibleError(('The    cache    file    %s    was    corrupt,    or    did    not    otherwise    contain    valid    data.    It    has    been    removed,    so    you    can    re-run    your    command    now.' % cachefile))
    except (OSError, IOError) as e:
        display.warning(("error    in    '%s'    cache    plugin    while    trying    to    read    %s    :    %s" % (self.plugin_name, cachefile, to_bytes(e))))
        raise KeyError
    except Exception as e:
        raise AnsibleError(('Error    while    decoding    the    cache    file    %s:    %s' % (cachefile, to_bytes(e))))
