The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
Add explanation to commands being executed
|Affected Puppet version:||0.24.8||Branch:|
Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com
When Puppet executes a command, the command is visible when debugging is enabled. It would be nice if this debug statement included the reason the command is being executed, at least indicating the method doing the execution (e.g., “latest”).
Nearly all of these executions are called from providers, so they would be the best place to start in terms of adding this information.
This will likely require either changing the prototype for the methods that perform the execution or finding some way to register why an execution is being performed.
execute() in util.rb accepts a hash as a trailing argument for options; we could add support for a ‘label’ option, and then test the command methods in the providers, so that instead of calling:
aptget :install, @resource[:name]
we could call:
aptget :install, @resource[:name], :label => :installing
We just need to check if the last argument is a hash, and if so, pass that hash as options to execute().
The log messages already automatically use the resource as the source of the message, so the logging is contextual; we would just need to add this label to the beginning of the message.