Issue #12479 has been reported by Nicolas Simonds.
----------------------------------------
Bug #12479: Regression: Regex matching against non-existant facts results in
false-positive
https://projects.puppetlabs.com/issues/12479
Author: Nicolas Simonds
Status: Unreviewed
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords:
Branch:
Non-existant facts are stringify-ing under the hood as something, which causes
them to match regexes, despite returning nil when otherwise asked.
A simple bash script to test:
----
#!/bin/bash
for LOLWUT in {a..z}
do
cat <<- EOF > /tmp/test.pp
case \$wtf {
/$LOLWUT/: {
notice("The fact[\$wtf] matches the regex /$LOLWUT/")
}
default: {
notice("The fact[\$wtf] does NOT match the regex
/$LOLWUT/")
}
}
notice(\$facility)
EOF
puppet apply /tmp/test.pp
done
----
Expected result:
All notices that the non-existant fact doesn't match.
Actual result:
Various and sundry notices that it matched. BAD PUPPET! NO COOKIE!
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.