On 18/09/14 14:27, jcbollinger wrote:
On Thursday, September 18, 2014 4:36:16 AM UTC-5, Jonathan Gazeley wrote:
Could not retrieve fact='warranty_start',
resolution='<anonymous>': undefined method `[]' for nil:NilClass
Could not retrieve fact='warranty_end', resolution='<anonymous>':
undefined method `[]' for nil:NilClass
Could not retrieve fact='warranty_end', resolution='<anonymous>':
undefined method `[]' for nil:NilClass
Could not retrieve fact='warranty_days_left',
resolution='<anonymous>': can't dup NilClass
That suggests to me that you have moved on to a different issue.
Matching up the code (facter/warranty.rb and facter/util/warranty.rb)
with the error messages you report, it seems likely that function
Facter::Util::Warranty::get_data() is failing on you. That will cause
both Facter::Util::Warranty::purchase_date() and the
Facter::Util::Warranty::warranties() to return nil. The
::warranty_start, ::warranty_end, and ::warranty_days_left facts all
depend on those two functions, assuming without testing that they
never return nil, hence the observed errors.
OK
As to why get_data() may be failing, it looks like there are several
possibilities:
1) The function relies on calling an HTTP API at Dell to retrieve data
(lines 6-12 and 60-72). It may be that that API has been modified or
removed, or that it no longer serves data for the particular machines
in question.
A quick test using a web browser suggests that the API is still present,
working, and returning valid data
2) The get_data() function relies on the ::serialnumber fact. I am
uncertain how that fact is computed, but maybe something changed that
affected its result.
On Dell machines, the ::serialnumber fact returns the service tag of the
hardware. I have no idea how it retrieves that data, but it only prints
out the fact when run as root. Perhaps this is breaking it, if this fact
can't read other facts.
3) The get_data() function uses a local cache to avoid calling the
Dell API every time. If that cache has been corrupted but not
altogether removed then perhaps get_data() would fail.
It's a possibility that I will investigate. In the meantime, thanks for
your suggestions.
Cheers,
Jonathan
--
You received this message because you are subscribed to the Google Groups "Puppet
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/541AEB73.4080201%40bristol.ac.uk.
For more options, visit https://groups.google.com/d/optout.