Issue #12479 has been updated by Nicolas Simonds.

A look over the results of the test script shows it matching on the letters D, 
E, F, N, and U.  I'm no expert, but I'm pretty sure those letters spell "undef".
----------------------------------------
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.

Reply via email to