diff --git a/confluent_server/confluent/networking/lldp.py b/confluent_server/confluent/networking/lldp.py index 792b0a93..91e91393 100644 --- a/confluent_server/confluent/networking/lldp.py +++ b/confluent_server/confluent/networking/lldp.py @@ -40,7 +40,7 @@ import confluent.exceptions as exc import confluent.log as log import confluent.messages as msg import confluent.snmputil as snmp -import confluent.networking.netutil as netutil +import confluent.networking.switchutil as switchutil import confluent.util as util import confluent.tasks as tasks import re @@ -358,7 +358,7 @@ async def _extract_neighbor_data_b(args): async def update_switch_data(switch, configmanager, force=False, retexc=False): - switchcreds = netutil.get_switchcreds(configmanager, (switch,))[0] + switchcreds = switchutil.get_switchcreds(configmanager, (switch,))[0] ndr = await _extract_neighbor_data(switchcreds + (force, retexc)) if retexc and isinstance(ndr, Exception): raise ndr @@ -379,8 +379,8 @@ async def _update_neighbors_backend(configmanager, force, retexc): return _neighdata = {'!!vintage': now} _neighbypeerid = {'!!vintage': now} - switches = netutil.list_switches(configmanager) - switchcreds = netutil.get_switchcreds(configmanager, switches) + switches = switchutil.list_switches(configmanager) + switchcreds = switchutil.get_switchcreds(configmanager, switches) switchcreds = [ x + (force, retexc) for x in switchcreds] async for ans in tasks.task_imap(_extract_neighbor_data, switchcreds, max_concurrent=64): yield ans diff --git a/confluent_server/confluent/networking/macmap.py b/confluent_server/confluent/networking/macmap.py index 07473f3a..f37046ba 100644 --- a/confluent_server/confluent/networking/macmap.py +++ b/confluent_server/confluent/networking/macmap.py @@ -44,7 +44,7 @@ if __name__ == '__main__': import asyncio from confluent.networking.lldp import detect_backend, _handle_neighbor_query, get_fingerprint -from confluent.networking.netutil import get_switchcreds, list_switches, get_portnamemap +from confluent.networking.switchutil import get_switchcreds, list_switches, get_portnamemap import socket diff --git a/confluent_server/confluent/networking/netutil.py b/confluent_server/confluent/networking/switchutil.py similarity index 100% rename from confluent_server/confluent/networking/netutil.py rename to confluent_server/confluent/networking/switchutil.py