def salt_refs(data, ret=None):
    proto = 'salt://'
    if ret is None:
        ret = []
    if isinstance(data, str):
        if data.startswith(proto) and data not in ret:
            ret.append(data)
    if isinstance(data, list):
        for comp in data:
            salt_refs(comp, ret)
    if isinstance(data, dict):
        for comp in data:
            salt_refs(data[comp], ret)
    return ret
Pull salt file references out of the states
dataset/ETHPy150Open saltstack/salt/salt/client/ssh/state.py/salt_refs