Skip to content

Commit 5e1011e

Browse files
committed
initial review feedback
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
1 parent cd8baca commit 5e1011e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

nexus/src/app/unnumbered.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use nexus_types::external_api::networking::{
88
};
99
use omicron_common::api::external::Error;
1010
use sled_agent_types::early_networking::SwitchSlot;
11+
use strum::IntoEnumIterator;
1112

1213
fn maghemite_interface_name(interface_name: &str) -> String {
1314
format!("tfport{interface_name}_0")
@@ -16,14 +17,14 @@ fn maghemite_interface_name(interface_name: &str) -> String {
1617
impl super::Nexus {
1718
pub async fn bgp_unnumbered_manager_status(
1819
&self,
19-
_optctx: &OpContext,
20+
_opctx: &OpContext,
2021
) -> Result<Vec<SwitchUnnumberedManagerState>, Error> {
2122
// Ask each switch about the BGP unnumbered interfaces it manages.
2223
let mg_clients = self.mg_clients().await.map_err(|err| {
2324
Error::internal_error(&format!("failed to get mg clients: {err}"))
2425
})?;
2526
let mut result = Vec::new();
26-
for switch_slot in [SwitchSlot::Switch0, SwitchSlot::Switch1] {
27+
for switch_slot in SwitchSlot::iter() {
2728
// Log an error if we only have one scrimlet, but keep going.
2829
// We still want to return anything we're able to collect.
2930
let Some(mg_client) = mg_clients.get(&switch_slot) else {
@@ -53,14 +54,14 @@ impl super::Nexus {
5354

5455
pub async fn bgp_unnumbered_interfaces(
5556
&self,
56-
_optctx: &OpContext,
57+
_opctx: &OpContext,
5758
) -> Result<Vec<SwitchUnnumberedInterface>, Error> {
5859
// Ask each switch about the BGP unnumbered interfaces it manages.
5960
let mg_clients = self.mg_clients().await.map_err(|err| {
6061
Error::internal_error(&format!("failed to get mg clients: {err}"))
6162
})?;
6263
let mut result = Vec::new();
63-
for switch_slot in [SwitchSlot::Switch0, SwitchSlot::Switch1] {
64+
for switch_slot in SwitchSlot::iter() {
6465
// Log an error if we only have one scrimlet, but keep going.
6566
// We still want to return anything we're able to collect.
6667
let Some(mg_client) = mg_clients.get(&switch_slot) else {
@@ -92,7 +93,7 @@ impl super::Nexus {
9293

9394
pub async fn bgp_unnumbered_interface(
9495
&self,
95-
_optctx: &OpContext,
96+
_opctx: &OpContext,
9697
switch_slot: SwitchSlot,
9798
interface_name: String,
9899
) -> Result<SwitchUnnumberedInterface, Error> {

0 commit comments

Comments
 (0)