puppetlabs / puppet-resource_api

This library provides a simple way to write new native resources for https://puppet.com.
Apache License 2.0
27 stars 41 forks source link

(CAT-761) Add custom_generate as a feature #316

Closed david22swan closed 1 year ago

david22swan commented 1 year ago

Allows the generate function to be utilized in order to manually create an array of types to be enforced. The generate method is called prior to the resource being managed. There is a second eval_generate method that is called after it has been, which may be good to add at a later date.

david22swan commented 1 year ago

@joshcooper Have updated the PR to add a custom_eval_generate feature as well. It's pretty much just a clone of the custom_generate method as they both just exist as wrappers to call a method defined within the users local provider. nvm: thought I could simply clone the wrapper but look's like eval_generate can't be made to return a nil value