MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / rollback_gateway_registration

Function rollback_gateway_registration

crates/openshell-cli/src/run.rs:1463–1480  ·  view source on GitHub ↗
(name: &str, previous_active: Option<&str>)

Source from the content-addressed store, hash-verified

1461}
1462
1463fn rollback_gateway_registration(name: &str, previous_active: Option<&str>) {
1464 remove_gateway_registration(name);
1465 if let Some(prev) = previous_active
1466 && let Err(e) = save_active_gateway(prev)
1467 {
1468 tracing::warn!("failed to restore previous active gateway '{prev}': {e}");
1469 eprintln!(
1470 "{} Failed to restore previous active gateway '{}': {e}",
1471 "!".yellow(),
1472 prev,
1473 );
1474 }
1475 eprintln!(
1476 "{} Registration for '{}' removed. Fix the issue and retry gateway add.",
1477 "!".yellow(),
1478 name,
1479 );
1480}
1481
1482fn remove_gateway_registration(name: &str) {
1483 if let Err(err) = openshell_bootstrap::edge_token::remove_edge_token(name) {

Callers 1

gateway_addFunction · 0.85

Calls 2

save_active_gatewayFunction · 0.85

Tested by

no test coverage detected