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

Function ensure_sandbox_exists

crates/openshell-server/src/grpc/auth_rpc.rs:129–142  ·  view source on GitHub ↗
(state: &Arc<ServerState>, sandbox_id: &str)

Source from the content-addressed store, hash-verified

127}
128
129async fn ensure_sandbox_exists(state: &Arc<ServerState>, sandbox_id: &str) -> Result<(), Status> {
130 if sandbox_id.is_empty() {
131 return Err(Status::invalid_argument("sandbox_id is required"));
132 }
133
134 state
135 .store
136 .get_message::<Sandbox>(sandbox_id)
137 .await
138 .map_err(|e| Status::internal(format!("fetch sandbox failed: {e}")))?
139 .ok_or_else(|| Status::not_found("sandbox not found"))?;
140
141 Ok(())
142}
143
144#[cfg(test)]
145mod tests {

Callers 2

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected