MCPcopy Index your code
hub / github.com/cloudfoundry/bosh-agent / Cancel

Method Cancel

agent/script/parallel_script.go:67–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67func (s ParallelScript) Cancel() error {
68 s.logger.Debug(s.logTag, "Canceling a parallel script")
69 existingScripts := s.findExistingScripts(s.allScripts)
70 for _, script := range existingScripts {
71 if script, ok := script.(CancellableScript); ok {
72 err := script.Cancel()
73 if err != nil {
74 return bosherr.WrapErrorf(err, "'%s' script did not cancel", s.name)
75 }
76 } else {
77 return bosherr.Errorf("Script %s is not cancellable", s.name)
78 }
79 }
80 return nil
81}
82
83func (s ParallelScript) findExistingScripts(all []Script) []Script {
84 var existing []Script

Callers 1

RunMethod · 0.95

Calls 3

findExistingScriptsMethod · 0.95
DebugMethod · 0.65
CancelMethod · 0.65

Tested by

no test coverage detected