def _gather_pillar(pillarenv, pillar_override):
    pillar = salt.pillar.get_pillar(
        __opts__,
        __grains__,
        __opts__['id'],
        __opts__['environment'],
        pillar=pillar_override,
        pillarenv=pillarenv
    )
    ret = pillar.compile_pillar()
    if pillar_override and isinstance(pillar_override, dict):
        ret.update(pillar_override)
    return ret
Whenever a state run starts, gather the pillar data fresh
dataset/ETHPy150Open saltstack/salt/salt/modules/cmdmod.py/_gather_pillar