diff --git a/netbox/extras/rpc.py b/netbox/extras/rpc.py index 613bdb743..d2d4835ea 100644 --- a/netbox/extras/rpc.py +++ b/netbox/extras/rpc.py @@ -20,19 +20,6 @@ class RPCClient(object): except AttributeError: raise Exception("Specified device ({}) does not have a primary IP defined.".format(device)) - def get_lldp_neighbors(self): - """ - Returns a list of dictionaries, each representing an LLDP neighbor adjacency. - - { - 'local-interface': , - 'name': , - 'remote-interface': , - 'chassis-id': , - } - """ - raise NotImplementedError("Feature not implemented for this platform.") - def get_inventory(self): """ Returns a dictionary representing the device chassis and installed inventory items. @@ -123,30 +110,6 @@ class JunosNC(RPCClient): # Close the connection to the device self.manager.close_session() - def get_lldp_neighbors(self): - - rpc_reply = self.manager.dispatch('get-lldp-neighbors-information') - lldp_neighbors_raw = xmltodict.parse(rpc_reply.xml)['rpc-reply']['lldp-neighbors-information']['lldp-neighbor-information'] - - result = [] - for neighbor_raw in lldp_neighbors_raw: - neighbor = dict() - neighbor['local-interface'] = neighbor_raw.get('lldp-local-port-id') - name = neighbor_raw.get('lldp-remote-system-name') - if name: - neighbor['name'] = name.split('.')[0] # Split hostname from domain if one is present - else: - neighbor['name'] = '' - try: - neighbor['remote-interface'] = neighbor_raw['lldp-remote-port-description'] - except KeyError: - # Older versions of Junos report on interface ID instead of description - neighbor['remote-interface'] = neighbor_raw.get('lldp-remote-port-id') - neighbor['chassis-id'] = neighbor_raw.get('lldp-remote-chassis-id') - result.append(neighbor) - - return result - def get_inventory(self): def glean_items(node, depth=0):