MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / runCommandWithWait

Function runCommandWithWait

cmd/nvidia-validator/main.go:657–674  ·  view source on GitHub ↗
(command string, args []string, sleepSeconds int, silent bool)

Source from the content-addressed store, hash-verified

655}
656
657func runCommandWithWait(command string, args []string, sleepSeconds int, silent bool) error {
658 for {
659 cmd := exec.Command(command, args...)
660 if !silent {
661 cmd.Stdout = os.Stdout
662 cmd.Stderr = os.Stderr
663 }
664 fmt.Printf("running command %s with args %v\n", command, args)
665 err := cmd.Run()
666 if err != nil {
667 log.Warningf("error running command: %v", err)
668 fmt.Printf("command failed, retrying after %d seconds\n", sleepSeconds)
669 time.Sleep(time.Duration(sleepSeconds) * time.Second)
670 continue
671 }
672 return nil
673 }
674}
675
676// prependPathListEnvvar prepends a specified list of strings to a specified envvar and returns its value.
677func prependPathListEnvvar(envvar string, prepend ...string) string {

Callers 8

runValidationMethod · 0.85
runValidationMethod · 0.85
runValidationMethod · 0.85
validateMethod · 0.85
runValidationMethod · 0.85
runValidationMethod · 0.85

Calls 1

RunMethod · 0.80

Tested by

no test coverage detected