With that change I get an error

> No signature of method: chef.Cookbook.sh() is applicable for argument 
types…

meaning that the DSL methods are not accessible from your class. That is 
because when you define a standalone class, it has no access to the main 
‘groovy.lang.Script’, on which DSL methods (and some miscellaneous stuff 
like ‘env’) are defined.

If I delete the ‘class Cookbook {}’ wrapper then it works fine—once I wrap 
the ‘sh’ sequence of both functions in ‘node {}’.

Basically, you did not need to rewrite the class structure to add the 
‘_validated’ variable.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/13813457-19b5-4be2-ab12-30ba5ab10249%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to