Skip to content

Commit

Permalink
Merge pull request #7478 from jhelwig/PUP-9565-multiple-log-destinations
Browse files Browse the repository at this point in the history
(PUP-9565) Allow specifying --logdest multiple times on the command line
  • Loading branch information
joshcooper committed Apr 12, 2019
2 parents e48d026 + a656b82 commit 00dcdf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ def setup
end

def setup_logs
handle_logdest_arg(Puppet[:logdest])
handle_logdest_arg(Puppet[:logdest]) if !options[:setdest]

unless options[:setdest]
if options[:debug] || options[:verbose]
Expand All @@ -411,7 +411,7 @@ def set_log_level(opts = nil)
end

def handle_logdest_arg(arg)
return if options[:setdest] || arg.nil?
return if arg.nil?

begin
Puppet[:logdest] = arg
Expand Down
9 changes: 0 additions & 9 deletions spec/unit/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
require 'timeout'

describe Puppet::Application do

before(:each) do
@app = Class.new(Puppet::Application).new
@appclass = @app.class
Expand Down Expand Up @@ -326,7 +325,6 @@ def run_command
end

describe "when parsing command-line options" do

before :each do
allow(@app.command_line).to receive(:args).and_return([])

Expand Down Expand Up @@ -652,13 +650,6 @@ def run_command
expect(@app.options[:setdest]).to be_truthy
end

it "does not set the log destination if setdest is true" do
expect(Puppet::Util::Log).not_to receive(:newdestination)
@app.options[:setdest] = true

@app.handle_logdest_arg(test_arg)
end

it "does not set the log destination if arg is nil" do
expect(Puppet::Util::Log).not_to receive(:newdestination)

Expand Down

0 comments on commit 00dcdf2

Please sign in to comment.