Skip to content

Commit

Permalink
Update cleo delete of network_configuration
Browse files Browse the repository at this point in the history
Only use devices of given peer and not all
  • Loading branch information
voelkera committed Feb 12, 2024
1 parent 1b06194 commit 56877a8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions opendut-cleo/src/commands/network_configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,13 @@ pub mod delete {
.await
.map_err(|error| format!("Failed to get peer with the id '{}'.\n {}", id, error))?;

let devices = carl.peers
.list_devices()
.await
.map_err(|error| format!("Failed to list devices.\n {}", error))?;

let network_interface_names = network_configuration.into_iter()
.map(|name| NetworkInterfaceName::try_from(name))
.collect::<Result<Vec<_>, _>>()
.map_err(|error| error.to_string())?;

let mut device_interfaces_map: HashMap<NetworkInterfaceName,Vec<String>> = HashMap::new();
for device in devices {
for device in peer.topology.devices.clone() {
device_interfaces_map.entry(device.interface).or_default().push(device.name.to_string());
};

Expand Down

0 comments on commit 56877a8

Please sign in to comment.