-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a puppet_execution_environment hook method #284
base: master
Are you sure you want to change the base?
Conversation
This makes running a command in an execution environment easier.
This makes it easy to run Puppet code in hooks.
@@ -42,6 +42,13 @@ def configure_puppet(settings = {}) | |||
PuppetConfigurer.new(puppet_conf, settings) | |||
end | |||
|
|||
def build_command(code, options: [], settings: {}, use_answers: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative: would command
make sense? You would get execution_env.command(code)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.