Skip to content

Commit 6c68090

Browse files
authored
Merge pull request #214 from Aaronoftheages/SUP-4714_Cannot_Compute_pe_status_check_hash_when_log_files_do_not_exist
(SUP-4714) Check if logfile exists during runtime of S0039
2 parents 44acabd + 0b971d8 commit 6c68090

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/facter/pe_status_check.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@
478478
next unless ['primary', 'legacy_primary', 'replica', 'pe_compiler', 'legacy_compiler'].include?(Facter.value('pe_status_check_role'))
479479

480480
logfile = File.dirname(Puppet.settings['logdir'].to_s) + '/puppetserver/puppetserver-access.log'
481+
next unless File.exist?(logfile)
481482
apache_regex = %r{^(\S+) \S+ (\S+) (?<time>\[([^\]]+)\]) "([A-Z]+) ([^ "]+)? HTTP/[0-9.]+" (?<status>[0-9]{3})}
482483

483484
has_503 = File.foreach(logfile).any? do |line|

0 commit comments

Comments
 (0)