def walk_for_export(snmp_config, oid): # type: (snmp_utils.SNMPHostConfig, str) -> List[Tuple[str, str]] if snmp_config.is_inline_snmp_host: backend = inline_snmp.InlineSNMPBackend() # type: snmp_utils.ABCSNMPBackend else: backend = classic_snmp.ClassicSNMPBackend() rows = backend.walk(snmp_config, oid) return _convert_rows_for_stored_walk(rows)
def factory(snmp_config, enforce_stored_walks): # type: (snmp_utils.SNMPHostConfig, bool) -> snmp_utils.ABCSNMPBackend if enforce_stored_walks or snmp_config.is_usewalk_host: return StoredWalkSNMPBackend() if snmp_config.is_inline_snmp_host: return inline_snmp.InlineSNMPBackend() return classic_snmp.ClassicSNMPBackend()