Skip to content

Commit 93fcd76

Browse files
Merge pull request #162 from MartyEwings/SUP-3676
(sup-3676) Handle Nill Value in S0038
2 parents 1f08ad5 + 7efdca8 commit 93fcd76

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/facter/pe_status_check.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,15 @@
449449
response = PEStatusCheck.http_get('/puppet/v3/environments', 8140)
450450
if response
451451
envs_count = response.dig('environments').length
452-
{ S0038: (envs_count < 100) }
452+
{
453+
S0038: if envs_count.nil?
454+
true
455+
elsif envs_count.is_a?(String)
456+
true
457+
else
458+
(envs_count < 100)
459+
end
460+
}
453461
else
454462
{ S0038: false }
455463
end

0 commit comments

Comments
 (0)