mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2026-10-25 14:20:05 -05:00
changes
This commit is contained in:
1 parent
0840bb678b
commit
84365b48ca
4 files changed
+23
-9
No files matched your search
@@ -15,7 +15,7 @@ use lqos_config::{
|
||||
TopologyEffectiveNodeState, TopologyEffectiveStateFile, TopologyQueueVisibilityPolicy,
|
||||
TopologyRuntimeStatusFile, TopologyShapingCircuitInput, TopologyShapingDeviceInput,
|
||||
TopologyShapingInputsFile, TopologyShapingResolutionSource, circuit_anchors_path,
|
||||
compute_effective_network_generation, detect_shaping_cpus, plan_top_level_assignments,
|
||||
compute_effective_network_file_generation, detect_shaping_cpus, plan_top_level_assignments,
|
||||
topology_auto_attachment_option, topology_effective_network_path,
|
||||
topology_effective_state_path, topology_runtime_status_path, topology_shaping_inputs_path,
|
||||
};
|
||||
|
||||
@@ -35,11 +35,6 @@ pub fn publish_effective_topology_artifacts(
|
||||
let effective_state_value = serde_json::to_value(&artifacts.effective)?;
|
||||
|
||||
let effective_network_path = topology_effective_network_path(config);
|
||||
let effective_generation = artifacts
|
||||
.effective_network
|
||||
.as_ref()
|
||||
.map(compute_effective_network_generation)
|
||||
.transpose()?;
|
||||
|
||||
let shaping_inputs_path = topology_shaping_inputs_path(config);
|
||||
let shaping_inputs = build_shaping_inputs(config, artifacts)?;
|
||||
@@ -88,6 +83,21 @@ pub fn publish_effective_topology_artifacts(
|
||||
})?;
|
||||
}
|
||||
|
||||
let effective_generation = if artifacts.effective_network.is_some() {
|
||||
Some(
|
||||
compute_effective_network_file_generation(&effective_network_path).with_context(
|
||||
|| {
|
||||
format!(
|
||||
"Unable to compute effective topology generation from {:?}",
|
||||
effective_network_path
|
||||
)
|
||||
},
|
||||
)?,
|
||||
)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
match prepared_shaping_inputs {
|
||||
Some((shaping_inputs, shaping_inputs_value)) => {
|
||||
let current_shaping_inputs = TopologyShapingInputsFile::load(config).ok();
|
||||
|
||||
@@ -565,6 +565,10 @@
|
||||
assert!(ready.ready);
|
||||
assert_eq!(ready.error, None);
|
||||
assert!(!ready.shaping_generation.is_empty());
|
||||
let effective_network_generation =
|
||||
compute_effective_network_file_generation(&topology_effective_network_path(&config))
|
||||
.expect("effective network generation should compute from published file");
|
||||
assert_eq!(ready.effective_generation, effective_network_generation);
|
||||
assert_eq!(
|
||||
ready.effective_state_path,
|
||||
topology_effective_state_path(&config)
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
TopologyCanonicalRateInputSource, TopologyCanonicalStateFile, TopologyEditorNode,
|
||||
TopologyEditorStateFile, TopologyEffectiveAttachmentState, TopologyEffectiveNodeState,
|
||||
TopologyEffectiveStateFile, TopologyQueueVisibilityPolicy, TopologyRuntimeStatusFile,
|
||||
TopologyShapingResolutionSource, topology_auto_attachment_option as auto_attachment_option,
|
||||
topology_effective_network_path, topology_effective_state_path, topology_runtime_status_path,
|
||||
topology_shaping_inputs_path,
|
||||
TopologyShapingResolutionSource, compute_effective_network_file_generation,
|
||||
topology_auto_attachment_option as auto_attachment_option, topology_effective_network_path,
|
||||
topology_effective_state_path, topology_runtime_status_path, topology_shaping_inputs_path,
|
||||
};
|
||||
use lqos_overrides::{TopologyAttachmentMode, TopologyOverridesFile};
|
||||
use serde_json::{Value, json};
|
||||
|
||||
Reference in new issue
Block a user