def snmp_preprocessor(a_device, oid='.1.3.6.1.2.1.1.1.0'):
 if (not (a_device.snmp_credentials.snmp_mode == 'snmp3')):
  raise ValueError('Invalid SNMP mode in config_detect {}'.format(a_device.snmp_credentials.snmp_mode))
 snmp_device = (a_device.ip_address, a_device.snmp_port)
 snmp_user = (a_device.snmp_credentials.username, a_device.snmp_credentials.auth_key, a_device.snmp_credentials.encrypt_key)
 auth_proto = a_device.snmp_credentials.auth_proto
 encrypt_proto = a_device.snmp_credentials.encrypt_proto
 return {'snmp_device': snmp_device, 'snmp_user': snmp_user, 'oid': oid, 'auth_proto': auth_proto, 'encrypt_proto': encrypt_proto}

def snmp_preprocessor ( a_device , oid = '.1.3.6.1.2.1.1.1.0' ) : if ( not ( a_device . snmp_credentials . snmp_mode == 'snmp3' ) ) : raise ValueError ( 'Invalid SNMP mode in config_detect {}' . format ( a_device . snmp_credentials . snmp_mode ) ) snmp_device = ( a_device . ip_address , a_device . snmp_port ) snmp_user = ( a_device . snmp_credentials . username , a_device . snmp_credentials . auth_key , a_device . snmp_credentials . encrypt_key ) auth_proto = a_device . snmp_credentials . auth_proto encrypt_proto = a_device . snmp_credentials . encrypt_proto return { 'snmp_device' : snmp_device , 'snmp_user' : snmp_user , 'oid' : oid , 'auth_proto' : auth_proto , 'encrypt_proto' : encrypt_proto }
extract snmp parameters from networkdevice object only supports snmpv3 .