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

Function run_cmd

crates/openshell-driver-vm/src/runtime.rs:550–564  ·  view source on GitHub ↗
(cmd: &str, args: &[&str])

Source from the content-addressed store, hash-verified

548}
549
550fn run_cmd(cmd: &str, args: &[&str]) -> Result<(), String> {
551 let output = StdCommand::new(cmd)
552 .args(args)
553 .stdin(Stdio::null())
554 .stdout(Stdio::piped())
555 .stderr(Stdio::piped())
556 .output()
557 .map_err(|e| format!("failed to run {cmd}: {e}"))?;
558 if output.status.success() {
559 Ok(())
560 } else {
561 let stderr = String::from_utf8_lossy(&output.stderr);
562 Err(format!("{cmd} {} failed: {stderr}", args.join(" ")))
563 }
564}
565
566fn run_nft_stdin(ruleset: &str) -> Result<(), String> {
567 use std::io::Write;

Callers 3

setup_tap_networkingFunction · 0.85
teardown_tap_networkingFunction · 0.85

Calls 1

successMethod · 0.45

Tested by

no test coverage detected