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

Function system_config_dir_override

crates/openshell-bootstrap/src/paths.rs:21–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19
20const DEFAULT_SYSTEM_CONFIG_DIR: &str = "/etc/openshell";
21fn system_config_dir_override() -> Option<PathBuf> {
22 let path = PathBuf::from(std::env::var_os(SYSTEM_GATEWAY_DIR_ENV)?);
23 if path.as_os_str().is_empty() {
24 tracing::warn!(
25 env = SYSTEM_GATEWAY_DIR_ENV,
26 "ignoring empty system gateway dir override"
27 );
28 return None;
29 }
30 if !path.is_absolute() {
31 tracing::warn!(
32 env = SYSTEM_GATEWAY_DIR_ENV,
33 path = %path.display(),
34 "ignoring relative system gateway dir override"
35 );
36 return None;
37 }
38 Some(path)
39}
40
41pub fn validated_gateway_name(name: &str) -> Result<&str> {
42 let mut components = Path::new(name).components();

Callers 1

system_config_dirFunction · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected