def get_lldp_neighbors(self):
        """IOS implementation of get_lldp_neighbors."""
        lldp = {}
        neighbors_detail = self.get_lldp_neighbors_detail()
        for intf_name, entries in neighbors_detail.items():
            lldp[intf_name] = []
            for lldp_entry in entries:
                hostname = lldp_entry["remote_system_name"]
                # Match IOS behaviour of taking remote chassis ID
                # When lacking a system name (in show lldp neighbors)
                if hostname == "N/A":
                    hostname = lldp_entry["remote_chassis_id"]
                lldp_dict = {"port": lldp_entry["remote_port"], "hostname": hostname}
                lldp[intf_name].append(lldp_dict)

        return lldp
def get_lldp_neighbors ( self ) : lldp = { } neighbors_detail = self . get_lldp_neighbors_detail ( ) for intf_name , entries in neighbors_detail . items ( ) : lldp [ intf_name ] = [ ] for lldp_entry in entries : hostname = lldp_entry [ "remote_system_name" ] if hostname == "N/A" : hostname = lldp_entry [ "remote_chassis_id" ] lldp_dict = { "port" : lldp_entry [ "remote_port" ] , "hostname" : hostname } lldp [ intf_name ] . append ( lldp_dict ) return lldp
IOS implementation of get_lldp_neighbors.