(PUP-8712) Add deprecation warning for --configprint#6851
Conversation
|
CLA signed by all contributors. |
4ff8f2e to
0175591
Compare
lib/puppet/application/master.rb
Outdated
| if !options[:setdest] | ||
| if options[:node] | ||
| if options[:node] || (Puppet[:configprint] !="") | ||
| require 'byebug'; byebug |
There was a problem hiding this comment.
Could write that as if options[:node] || !Puppet[:configprint].empty? Also stray byebug.
There was a problem hiding this comment.
On second thought, many applications override the setup and/or setup_logs methods, and some of those applications are not in puppet. Rather than modify the applications, I think Puppet::Settings#print_config_options should create the console log destination if needed.
0175591 to
1135066
Compare
| # Prints the contents of a config file with the available config settings, or it | ||
| # prints a single value of a config setting. | ||
| def print_config_options | ||
| if Puppet::Util::Log.sendlevel?(:info) |
There was a problem hiding this comment.
I'm thinking you could create the console log destination here, and drop the changes in lib/puppet/application/master.rb. The operation will be a noop if the :console log destination has already been created:
if Puppet::Util::Log.sendlevel?(:info)
Puppet::Util::Log.newdestination(:console)
message = (_("Using --configprint is deprecated. Use 'puppet config <subcommand>' instead."))
Puppet.deprecation_warning(message)
end03eadce to
34c4fec
Compare
| Puppet.deprecation_warning(message) | ||
| end | ||
|
|
||
|
|
There was a problem hiding this comment.
nit, there's some extra white space here. If you run git show --check you'll see it.
Because of feedback received on PUP-8566 about too much output breaking people's workflows, and because master generally runs in the background and generally doesn't output this type of message, the deprecation warning for --configprint will only be visible when using --debug and --verbose
34c4fec to
2153e5c
Compare
No description provided.