From 3ae3815a11f264a6f809293b42dad93c6378f7ba Mon Sep 17 00:00:00 2001 From: Marty Ewings Date: Fri, 2 Dec 2022 10:59:33 +0000 Subject: [PATCH] (maint) Remove needless check in setting default This line is not sane for the setting of the log_level default loglevel = %x{ #{puppet_path} config --section agent --log_level notice print log_level }.chomp this sets log_level to notice, and then return the output of the log_level setting loglevel = "notice" is the same thing with fewer steps --- ext/windows/service/daemon.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/windows/service/daemon.rb b/ext/windows/service/daemon.rb index ae001d54cfd..7b6d753b459 100755 --- a/ext/windows/service/daemon.rb +++ b/ext/windows/service/daemon.rb @@ -179,7 +179,7 @@ def parse_runinterval(puppet_path) def parse_log_level(puppet_path, cmdline_debug) begin - loglevel = %x(#{puppet_path} config --section agent --log_level notice print log_level).chomp + loglevel = "notice" unless loglevel && respond_to?("log_#{loglevel}") loglevel = :notice log_err("Failed to determine loglevel, defaulting to #{loglevel}")