Skip to content

Commit

Permalink
Approval Condition added early
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaronoftheages committed Jun 26, 2024
1 parent e886d9b commit dbf2707
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/facter/pe_status_check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,21 @@
# Is there a valid license present, which does not expire in 90 days
# Also takes into account if the license type is Perpetual
next unless ['primary'].include?(Facter.value('pe_status_check_role'))

Check failure on line 239 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)

Check failure on line 239 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
# Check for suite license file
suite_license_file = '/etc/puppetlabs/suite-license.lic'

Check failure on line 242 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)

Check failure on line 242 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
# Check for license key file
license_file = '/etc/puppetlabs/license.key'

Check failure on line 245 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)

Check failure on line 245 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
# Initialize validity as false
validity = false

Check failure on line 248 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)

Check failure on line 248 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
if File.exist?(suite_license_file)
# Presence of file satisfy check
validity = true
# Approve with only suite-license.liu
{ S0022: validity }
elsif File.exist?(license_file)
begin
license_type = File.readlines(license_file).grep(%r{license_type:}).first
Expand Down Expand Up @@ -281,9 +283,10 @@
# Neither suite-license.lic nor license.key exist
validity = false
end

Check failure on line 286 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)

Check failure on line 286 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
{ S0022: validity }
end

Check failure on line 289 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)

Check failure on line 289 in lib/facter/pe_status_check.rb

View workflow job for this annotation

GitHub Actions / Spec testing / Spec Tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)

chunk(:S0023) do
# Is the CA_CRL expiring in the next 90 days
Expand Down

0 comments on commit dbf2707

Please sign in to comment.