salt/grains/fx2.py
def _grains():
    '''
    Get the grains from the proxied device
    '''
    r = salt.modules.dracr.system_info(host=__pillar__['proxy']['host'],
                                       admin_username=__pillar__['proxy']['admin_username'],
                                       admin_password=__pillar__['proxy']['admin_password'])

    if r.get('retcode', 0) == 0:
        GRAINS_CACHE = r
        username = __pillar__['proxy']['admin_username']
        password = __pillar__['proxy']['admin_password']
    else:
        r = salt.modules.dracr.system_info(host=__pillar__['proxy']['host'],
                                           admin_username=__pillar__['proxy']['fallback_admin_username'],
                                           admin_password=__pillar__['proxy']['fallback_admin_password'])
        if r.get('retcode', 0) == 0:
            GRAINS_CACHE = r
            username = __pillar__['proxy']['fallback_admin_username']
            password = __pillar__['proxy']['fallback_admin_password']
        else:
            GRAINS_CACHE = {}

    GRAINS_CACHE.update(salt.modules.dracr.inventory(host=__pillar__['proxy']['host'],
                                                     admin_username=username,
                                                     admin_password=password))

    return GRAINS_CACHE

    Get the grains from the proxied device
    
Get the grains from the proxied device
Get the grains from the proxied device
def _grains():
    r = salt.modules.dracr.system_info(host=__pillar__['proxy']['host'],
                                       admin_username=__pillar__['proxy']['admin_username'],
                                       admin_password=__pillar__['proxy']['admin_password'])
    if r.get('retcode', 0) == 0:
        GRAINS_CACHE = r
        username = __pillar__['proxy']['admin_username']
        password = __pillar__['proxy']['admin_password']
    else:
        r = salt.modules.dracr.system_info(host=__pillar__['proxy']['host'],
                                           admin_username=__pillar__['proxy']['fallback_admin_username'],
                                           admin_password=__pillar__['proxy']['fallback_admin_password'])
        if r.get('retcode', 0) == 0:
            GRAINS_CACHE = r
            username = __pillar__['proxy']['fallback_admin_username']
            password = __pillar__['proxy']['fallback_admin_password']
        else:
            GRAINS_CACHE = {}
    GRAINS_CACHE.update(salt.modules.dracr.inventory(host=__pillar__['proxy']['host'],
                                                     admin_username=username,
                                                     admin_password=password))
    return GRAINS_CACHE
def _grains ( ) : r = salt . modules . dracr . system_info ( host = __pillar__ [ 'proxy' ] [ 'host' ] , admin_username = __pillar__ [ 'proxy' ] [ 'admin_username' ] , admin_password = __pillar__ [ 'proxy' ] [ 'admin_password' ] ) if r . get ( 'retcode' , 0 ) == 0 : GRAINS_CACHE = r username = __pillar__ [ 'proxy' ] [ 'admin_username' ] password = __pillar__ [ 'proxy' ] [ 'admin_password' ] else : r = salt . modules . dracr . system_info ( host = __pillar__ [ 'proxy' ] [ 'host' ] , admin_username = __pillar__ [ 'proxy' ] [ 'fallback_admin_username' ] , admin_password = __pillar__ [ 'proxy' ] [ 'fallback_admin_password' ] ) if r . get ( 'retcode' , 0 ) == 0 : GRAINS_CACHE = r username = __pillar__ [ 'proxy' ] [ 'fallback_admin_username' ] password = __pillar__ [ 'proxy' ] [ 'fallback_admin_password' ] else : GRAINS_CACHE = { } GRAINS_CACHE . update ( salt . modules . dracr . inventory ( host = __pillar__ [ 'proxy' ] [ 'host' ] , admin_username = username , admin_password = password ) ) return GRAINS_CACHE
Get the grains from the proxied device
Get the grains from the proxied device
'''
    Get the grains from the proxied device
    '''