Remove the commented-out IP range validation in `DhcpConfig` and simplify the `DnsConfig` constructor by removing an unnecessary parameter, addressing several compiler warnings.
32 lines
765 B
Rust
32 lines
765 B
Rust
use derive_new::new;
|
|
use log::info;
|
|
|
|
|
|
use super::{
|
|
interpret::{Interpret, InterpretError, Outcome},
|
|
inventory::Inventory,
|
|
score::Score,
|
|
topology::HAClusterTopology,
|
|
};
|
|
|
|
#[derive(new)]
|
|
pub struct Maestro {
|
|
inventory: Inventory,
|
|
topology: HAClusterTopology,
|
|
}
|
|
|
|
impl Maestro {
|
|
pub fn start(&mut self) {
|
|
info!("Starting Maestro");
|
|
}
|
|
|
|
pub async fn interpret<S: Score>(&self, score: S) -> Result<Outcome, InterpretError> {
|
|
info!("Running score {score:?}");
|
|
let interpret: S::InterpretType = score.create_interpret();
|
|
info!("Launching interpret {interpret:?}");
|
|
let result = interpret.execute(&self.inventory, &self.topology).await;
|
|
info!("Got result {result:?}");
|
|
result
|
|
}
|
|
}
|