Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
karencfv committed May 2, 2024
1 parent a5d4dc1 commit ac5bbbb
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion sled-agent/src/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2398,6 +2398,7 @@ impl ServiceManager {
for service in services {
match service {
SwitchService::ManagementGatewayService => {
info!(self.inner.log, "Setting up MGS service");
let mut mgs_config =
PropertyGroupBuilder::new("config")
// Always tell MGS to listen on localhost so wicketd
Expand Down Expand Up @@ -2441,6 +2442,7 @@ impl ServiceManager {
);
}
SwitchService::Wicketd { baseboard } => {
info!(self.inner.log, "Setting up wicketd service");
// If we're launching the switch zone, we'll have a
// bootstrap_address based on our call to
// `self.bootstrap_address_needed` (which always
Expand Down Expand Up @@ -2515,6 +2517,10 @@ impl ServiceManager {
);
}
SwitchService::Dendrite { asic } => {
info!(
self.inner.log,
"Setting up dendrite service"
);
let mut dendrite_config =
PropertyGroupBuilder::new("config")
.add_property(
Expand Down Expand Up @@ -2558,7 +2564,11 @@ impl ServiceManager {
let dev_cnt = device_names.len();
if dev_cnt == 1 {
dendrite_config = dendrite_config
.add_property("", "astring", "");
.add_property(
"dev_path",
"astring",
&device_names[0].clone(),
);
} else {
return Err(Error::SledLocalZone(
anyhow::anyhow!(
Expand Down Expand Up @@ -2646,6 +2656,7 @@ impl ServiceManager {
);
}
SwitchService::Tfport { pkt_source, asic } => {
info!(self.inner.log, "Setting up tfport service");
let mut tfport_config =
PropertyGroupBuilder::new("config")
.add_property(
Expand Down Expand Up @@ -2720,6 +2731,8 @@ impl ServiceManager {
);
}
SwitchService::Lldpd { baseboard } => {
info!(self.inner.log, "Setting up lldpd service");

let mut lldpd_config =
PropertyGroupBuilder::new("config")
// Always tell MGS to listen on localhost so wicketd
Expand Down Expand Up @@ -2768,6 +2781,10 @@ impl ServiceManager {
// The pumpkin daemon is only needed when running on
// with real sidecar.
if asic == &DendriteAsic::TofinoAsic {
info!(
self.inner.log,
"Setting up pumpkind service"
);
let pumpkind_config =
PropertyGroupBuilder::new("config")
.add_property(
Expand Down Expand Up @@ -2795,6 +2812,8 @@ impl ServiceManager {
// `ensure_switch_zone_uplinks_configured`
}
SwitchService::Mgd => {
info!(self.inner.log, "Setting up mgd service");

let mut mgd_config =
PropertyGroupBuilder::new("config")
.add_property(
Expand All @@ -2821,6 +2840,7 @@ impl ServiceManager {
&format!("{addr}"),
);
}
break;
}
}

Expand All @@ -2830,6 +2850,8 @@ impl ServiceManager {
);
}
SwitchService::MgDdm { mode } => {
info!(self.inner.log, "Setting up mg-ddm service");

let mut mg_ddm_config =
PropertyGroupBuilder::new("config")
.add_property("mode", "astring", mode)
Expand Down Expand Up @@ -2859,6 +2881,7 @@ impl ServiceManager {
&format!("{addr}"),
);
}
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion zone-setup/src/bin/zone-setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ async fn switch_zone_setup(
// Clap only checks if a flag is present or not. In this case, an
// empty list could sneak through if the flag is set without a value
// like `-l ""`.
if links.len() > 0 {
if !links.is_empty() {
return Err(CmdError::Failure(anyhow!(
"At least one link local link must be provided"
)));
Expand Down

0 comments on commit ac5bbbb

Please sign in to comment.