mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Handle exception CPE reparenting.
This commit is contained in:
parent
631b9672f5
commit
6f986f4cd1
@ -44,7 +44,7 @@ pub async fn build_full_network(
|
||||
|
||||
// Obtain the UISP data and transform it into easier to work with types
|
||||
let (sites_raw, devices_raw, data_links_raw) = load_uisp_data(config.clone()).await?;
|
||||
let (mut sites, data_links, devices) = parse_uisp_datasets(
|
||||
let (mut sites, data_links, mut devices) = parse_uisp_datasets(
|
||||
&sites_raw,
|
||||
&data_links_raw,
|
||||
&devices_raw,
|
||||
|
@ -76,11 +76,19 @@ impl UispDevice {
|
||||
ip_ranges.is_permitted(addr, subnet)
|
||||
});
|
||||
|
||||
// Handle any "exception CPE" entries
|
||||
let mut site_id = device.get_site_id().unwrap_or("".to_string());
|
||||
for exception in config.uisp_integration.exception_cpes.iter() {
|
||||
if exception.cpe == device.get_name().unwrap() {
|
||||
site_id = exception.parent.clone();
|
||||
}
|
||||
}
|
||||
|
||||
Self {
|
||||
id: device.get_id(),
|
||||
name: device.get_name().unwrap(),
|
||||
mac,
|
||||
site_id: device.get_site_id().unwrap_or("".to_string()),
|
||||
site_id,
|
||||
upload,
|
||||
download,
|
||||
ipv4,
|
||||
|
Loading…
Reference in New Issue
Block a user