Skip to content

(#12404) Reduce redundant code in lib/puppet/application#455

Closed
jeffweiss wants to merge 1 commit intopuppetlabs:masterfrom
jeffweiss:ticket/master/12404_reduce_redundant_code_in_lib/puppet/application
Closed

(#12404) Reduce redundant code in lib/puppet/application#455
jeffweiss wants to merge 1 commit intopuppetlabs:masterfrom
jeffweiss:ticket/master/12404_reduce_redundant_code_in_lib/puppet/application

Conversation

@jeffweiss
Copy link
Copy Markdown
Contributor

Reduce redundant code by defining Puppet::Application.logdest_option,
which can then be called from applications that need a log destination
instead of copying the 9 lines of code specific to creating a log
destination.

Reduce redundant code by defining Puppet::Application.setup_logs
to ease (and standardize) the log setup across the applications.

Reduce redundant code by moving setup_host into Puppet::Application.

Encapsulate logic for exiting if Puppet.settings.print_config?

Encapsulate logic for sorting type providers in Puppet::Application::Describe.

Modify tests to use standard option :setdest.

Modify tests to mock options :setdest, :debug, and :verbose to
handle standardized checked against each option in consolidated
setup_logs method.

Reduce redundant code by defining Puppet::Application.logdest_option,
which can then be called from applications that need a log destination
instead of copying the 9 lines of code specific to creating a log
destination.

Reduce redundant code by defining Puppet::Application.setup_logs
to ease (and standardize) the log setup across the applications.

Reduce redundant code by moving setup_host into Puppet::Application.

Encapsulate logic for exiting if Puppet.settings.print_config?

Encapsulate logic for sorting type providers in
Puppet::Application::Describe.

Modify tests to use standard option :setdest.

Modify tests to mock options :setdest, :debug, and :verbose to
handle standardized checked against each option in consolidated
setup_logs method.
@slippycheeze
Copy link
Copy Markdown
Contributor

@jeffweiss - I am looking at this, but it is a bigger change than I can immediately merge. I like the idea; most complexity is around "should we retain this choice", rather than anything in the code, so takes bigger thinking to answer.

melissa pushed a commit to melissa/puppet that referenced this pull request Mar 30, 2018
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.

2 participants