Skip to content

Commit f40026a

Browse files
fix(admin-cli): show effective NMX-C state (#5800)
`switch show` currently prints only the persisted legacy NMX-C flag. When RMS selects a primary switch, that can report `false` even though hardware health treats NMX-C as enabled. This change labels the persisted value as configured and displays the effective value using the same `config.enable_nmxc || switch.is_primary` expression as hardware health. ## Related issues Fixes #5799 ## Type of Change - [ ] **Add** - New feature or capability - [ ] **Change** - Changes in existing functionality - [x] **Fix** - Bug fixes - [ ] **Remove** - Removed features or deprecated functionality - [ ] **Internal** - Internal changes (refactoring, tests, docs, etc.) ## Breaking Changes - [ ] **This PR contains breaking changes** ## Testing - [x] Unit tests added/updated - [ ] Integration tests added/updated - [ ] Manual testing performed - [ ] No testing required (docs, internal refactor, etc.) `PROTOC=/data/NICo/.tools/protoc-28.3/bin/protoc cargo test -p nico-admin-cli` (255 passed) ## Additional Notes The implementation and regression assertion are contained in the existing switch-show source file; no API or database change is required. Signed-off-by: Joseph Shifflett <jshifflett@nvidia.com>
1 parent 4858dd7 commit f40026a

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • crates/admin-cli/src/switch/show

crates/admin-cli/src/switch/show/cmd.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,12 @@ fn switch_details_text(switch: &Switch) -> CarbideCliResult<String> {
275275
writeln!(&mut lines, "\nConfig:")?;
276276
if let Some(config) = &switch.config {
277277
writeln!(&mut lines, "\tName : {}", config.name)?;
278-
writeln!(&mut lines, "\tEnable NMX-C : {}", config.enable_nmxc)?;
278+
writeln!(&mut lines, "\tNMX-C Configured : {}", config.enable_nmxc)?;
279+
writeln!(
280+
&mut lines,
281+
"\tNMX-C Effective : {}",
282+
config.enable_nmxc || switch.is_primary
283+
)?;
279284
if let Some(fm_config) = &config.fabric_manager_config
280285
&& !fm_config.config_map.is_empty()
281286
{
@@ -490,7 +495,7 @@ mod tests {
490495
slot_number: Some(13),
491496
tray_index: Some(8),
492497
}),
493-
is_primary: false,
498+
is_primary: true,
494499
controller_state:
495500
r#"{"state":"reprovisioning","reprovisioning_state":"WaitingForNVOSUpgrade"}"#
496501
.to_string(),
@@ -513,7 +518,10 @@ mod tests {
513518

514519
for expected in [
515520
"ID : sw100nsner0op5osl6n85t7772j010jmhafm934n7oej4mlome3okrn9b60",
521+
"Primary : Yes",
516522
"\tName : MT2519600UD6",
523+
"\tNMX-C Configured : false",
524+
"\tNMX-C Effective : true",
517525
"\tPower State : on",
518526
"\tFirmware Version : 1.3.5-GA",
519527
"\tNAME: sw100nsner0op5osl6n85t7772j010jmhafm934n7oej4mlome3okrn9b60",

0 commit comments

Comments
 (0)