def grains():

    if not DETAILS.get('grains_cache', {}):
        cmd = 'info'

        # Send the command to execute
        out, err = DETAILS['server'].sendline(cmd)

        # "scrape" the output and return the right fields as a dict
        DETAILS['grains_cache'] = parse(out)

    return DETAILS['grains_cache']
Get the grains from the proxied device
dataset/ETHPy150Open saltstack/salt/salt/proxy/ssh_sample.py/grains