MCPcopy
hub / github.com/purpleidea/mgmt / Validate

Method Validate

engine/graph/engine.go:193–205  ·  view source on GitHub ↗

Validate validates the pending graph to ensure it is appropriate for the engine. This should be called before Commit to avoid any surprises there! This prevents an error on Commit which could cause an engine shutdown.

()

Source from the content-addressed store, hash-verified

191// engine. This should be called before Commit to avoid any surprises there!
192// This prevents an error on Commit which could cause an engine shutdown.
193func (obj *Engine) Validate() error {
194 for _, vertex := range obj.nextGraph.Vertices() {
195 res, ok := vertex.(engine.Res)
196 if !ok {
197 return fmt.Errorf("not a Res")
198 }
199
200 if err := engine.Validate(res); err != nil {
201 return fmt.Errorf("%s did not Validate: %v", res, err)
202 }
203 }
204 return nil
205}
206
207// Apply a function to the pending graph. You must pass in a function which will
208// receive this graph as input, and return an error if something does not

Callers 1

TestAstFunc3Function · 0.95

Calls 2

ValidateFunction · 0.92
VerticesMethod · 0.80

Tested by 1

TestAstFunc3Function · 0.76