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

Function read_gateway_name

crates/openshell-bootstrap/src/metadata.rs:242–251  ·  view source on GitHub ↗
(path: &Path)

Source from the content-addressed store, hash-verified

240}
241
242fn read_gateway_name(path: &Path) -> Option<String> {
243 let value = read_nonempty_trimmed(path)?;
244 match validated_gateway_name(&value) {
245 Ok(_) => Some(value),
246 Err(err) => {
247 tracing::warn!(path = %path.display(), error = %err, "ignoring invalid active gateway name");
248 None
249 }
250 }
251}
252fn read_nonempty_trimmed(path: &Path) -> Option<String> {
253 let contents = std::fs::read_to_string(path).ok()?;
254 let value = contents.trim();

Callers 1

load_active_gatewayFunction · 0.85

Calls 2

read_nonempty_trimmedFunction · 0.85
validated_gateway_nameFunction · 0.85

Tested by

no test coverage detected