From 14b3a7791de14abafd43a6519296e08d1e398c57 Mon Sep 17 00:00:00 2001 From: Georgi Georgiev Date: Wed, 19 Apr 2023 10:07:35 +0900 Subject: [PATCH] Do not crash when referring to a fact key without quoting it Fixes #118 --- lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb b/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb index dd63656a..3e937bf0 100644 --- a/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb +++ b/lib/puppet-lint/plugins/legacy_facts/legacy_facts.rb @@ -117,7 +117,7 @@ def check # This matches legacy facts defined in the fact hash that use the top scope # fact assignment. - if token.value.start_with?('::facts[') + if token.value.start_with?("::facts['") fact_name = token.value.match(%r{::facts\['(.*)'\]})[1] # This matches legacy facts defined in the fact hash.