Issue #20283 has been reported by Andreas Knifh.

----------------------------------------
Bug #20283: Facts with no output breaks facter 1.7
https://projects.puppetlabs.com/issues/20283

* Author: Andreas Knifh
* Status: Unreviewed
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Keywords: 
* Branch: 
* Affected Facter version: 1.7.0
----------------------------------------
Hi,
When running puppet with facter 1.7 I get the following stacktrace for facts 
with no output.

/usr/lib/ruby/vendor_ruby/facter/util/parser.rb:118:in `results': undefined 
method `each_line' for nil:NilClass (NoMethodError)
        from /usr/lib/ruby/vendor_ruby/facter/util/directory_loader.rb:61:in 
`load'
        from /usr/lib/ruby/vendor_ruby/facter/util/directory_loader.rb:55:in 
`each'
        from /usr/lib/ruby/vendor_ruby/facter/util/directory_loader.rb:55:in 
`load'
        from /usr/lib/ruby/vendor_ruby/facter/util/composite_loader.rb:10:in 
`load'
        from /usr/lib/ruby/vendor_ruby/facter/util/composite_loader.rb:10:in 
`each'
        from /usr/lib/ruby/vendor_ruby/facter/util/composite_loader.rb:10:in 
`load'
        from /usr/lib/ruby/vendor_ruby/facter/util/collection.rb:109:in `load'
        from /usr/lib/ruby/vendor_ruby/facter/util/collection.rb:84:in `fact'
        from /usr/lib/ruby/vendor_ruby/facter.rb:106:in `[]'
        from /usr/lib/ruby/vendor_ruby/puppet/settings.rb:55:in `hostname_fact'
        from /usr/lib/ruby/vendor_ruby/puppet/settings.rb:44:in 
`default_certname'
        from /usr/lib/ruby/vendor_ruby/puppet/defaults.rb:382
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in 
`gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in 
`require'
        from /usr/lib/ruby/vendor_ruby/puppet.rb:105
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in 
`gem_original_require'
        from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:36:in 
`require'
        from /usr/lib/ruby/vendor_ruby/puppet/util/command_line.rb:12
        from /usr/bin/puppet:3:in `require'
        from /usr/bin/puppet:3

The code for the fact causing this is the following:

#!/bin/bash

servicetag=`dmidecode -s system-serial-number`

if [ "$servicetag" != "Not Specified" ]; then
        echo "dell_service_tag=${servicetag}"
fi

And it only occurs if the if statement is false, ie, there is no servicetag to 
report as a fact.

Debian facter version: 1.7.0-1puppetlabs1


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to