Add a puppet_execution_environment hook method#284
Conversation
This makes running a command in an execution environment easier.
This makes it easy to run Puppet code in hooks.
| PuppetConfigurer.new(puppet_conf, settings) | ||
| end | ||
|
|
||
| def build_command(code, options: [], settings: {}, use_answers: false) |
There was a problem hiding this comment.
I think I might like build_puppet_command to make it clearer to understand what sort of command is being built up. This method signature has the side affect of being able to be read as "build command" a noun rather than build as a verb.
There was a problem hiding this comment.
Alternative: would command make sense? You would get execution_env.command(code).
There was a problem hiding this comment.
Can the command be anything I want? or is it specific to Puppet?
|
Additional context: I had this in my mind when I wrote ExecutionEnvironment but couldn't find the right API so I left it out. I am thinking about dropping For example, |
|
This would be another good one to get in. |
This makes it easy to run Puppet code in hooks. To achieve this, ExecutionEnvironment also gains
build_command. Existing code is refactored to make use of this.