Skip to content

(PUP-8712) Add deprecation warning for --configprint#6851

Merged
joshcooper merged 1 commit intopuppetlabs:5.5.xfrom
jtappa:PUP-8712-deprecation-warning-puppet-master-configprint
Jun 6, 2018
Merged

(PUP-8712) Add deprecation warning for --configprint#6851
joshcooper merged 1 commit intopuppetlabs:5.5.xfrom
jtappa:PUP-8712-deprecation-warning-puppet-master-configprint

Conversation

@jtappa
Copy link
Copy Markdown
Contributor

@jtappa jtappa commented May 22, 2018

No description provided.

@jtappa jtappa changed the base branch from master to 5.5.x May 22, 2018 15:19
@puppetcla
Copy link
Copy Markdown

CLA signed by all contributors.

@jtappa jtappa force-pushed the PUP-8712-deprecation-warning-puppet-master-configprint branch 3 times, most recently from 4ff8f2e to 0175591 Compare May 31, 2018 21:03
if !options[:setdest]
if options[:node]
if options[:node] || (Puppet[:configprint] !="")
require 'byebug'; byebug
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could write that as if options[:node] || !Puppet[:configprint].empty? Also stray byebug.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@jtappa jtappa force-pushed the PUP-8712-deprecation-warning-puppet-master-configprint branch from 0175591 to 1135066 Compare June 5, 2018 17:20
# 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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
end

@jtappa jtappa force-pushed the PUP-8712-deprecation-warning-puppet-master-configprint branch 3 times, most recently from 03eadce to 34c4fec Compare June 6, 2018 16:39
Puppet.deprecation_warning(message)
end


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@jtappa jtappa force-pushed the PUP-8712-deprecation-warning-puppet-master-configprint branch from 34c4fec to 2153e5c Compare June 6, 2018 17:36
@joshcooper joshcooper merged commit 047fde5 into puppetlabs:5.5.x Jun 6, 2018
@jtappa jtappa deleted the PUP-8712-deprecation-warning-puppet-master-configprint branch June 6, 2018 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants