Get the grains from the proxied device

def grains():
    '''
    Get the grains from the proxied device
    '''

    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']