Compare commits

..

2 Commits

Author SHA1 Message Date
734c9704ab feat: provide an unmanaged switch 2025-11-11 13:30:03 -05:00
83c1cc82b6 fix(host_network): remove extra fields from bond config to prevent clashes (#186)
Also alias `port` to support both `port` and `ports` as per the nmstate spec.

Reviewed-on: NationTech/harmony#186
2025-11-11 14:12:56 +00:00

View File

@@ -113,6 +113,37 @@ impl SwitchClient for BrocadeSwitchClient {
}
}
#[derive(Debug)]
pub struct UnmanagedSwitch;
impl UnmanagedSwitch {
pub async fn init( ) -> Result<Self, ()> {
Ok(Self)
}
}
#[async_trait]
impl SwitchClient for UnmanagedSwitch {
async fn setup(&self) -> Result<(), SwitchError> {
todo!("unmanaged switch. Nothing to do.")
}
async fn find_port(
&self,
mac_address: &MacAddress,
) -> Result<Option<PortLocation>, SwitchError> {
todo!("unmanaged switch. Nothing to do.")
}
async fn configure_port_channel(
&self,
channel_name: &str,
switch_ports: Vec<PortLocation>,
) -> Result<u8, SwitchError> {
todo!("unmanaged switch. Nothing to do.")
}
}
#[cfg(test)]
mod tests {
use std::sync::{Arc, Mutex};