Skip to content

Instantly share code, notes, and snippets.

@igalic
Created October 6, 2013 13:14
Show Gist options
  • Save igalic/6853917 to your computer and use it in GitHub Desktop.
Save igalic/6853917 to your computer and use it in GitHub Desktop.
Error: /Stage[main]/Kvmhost::Config::Cobbler/Cobblersystem[hosting02.esotericsystems.at]: Could not evaluate: no implicit conversion from nil to integer
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:65:in `[]'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:65:in `block (2 levels) in insync?'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:64:in `uniq'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:64:in `block in insync?'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:59:in `each'
/var/lib/puppet/lib/puppet/type/cobblersystem.rb:59:in `insync?'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/property.rb:314:in `safe_insync?'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction/resource_harness.rb:60:in `block in perform_changes'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction/resource_harness.rb:59:in `each'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction/resource_harness.rb:59:in `perform_changes'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction/resource_harness.rb:138:in `evaluate'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction.rb:161:in `apply'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction.rb:174:in `eval_resource'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction.rb:104:in `call'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/transaction.rb:104:in `block (2 levels) in evaluate'
/opt/bw/lib/ruby/gems/1.9.1/gems/puppet-3.3.0/lib/puppet/util.rb:354:in `block in thinmark'
/opt/bw/lib/ruby/1.9.1/benchmark.rb:295:in `realtime'
newproperty(:interfaces) do
desc 'The list of interfaces in system.'
def insync?(is)
# @should is an Array. see lib/puppet/type.rb insync?
should = @should.first
# if members of hashes are not the same, something
# was added or removed from manifest, so return false
return false unless is.class == Hash and should.class == Hash and is.keys.sort == should.keys.sort
# check if something was added or removed on second level
is.each do |l,w|
if w.is_a?(Hash)
# hack for 'management' setting (which is being read all the time)
should[l]['management'] = false unless should[l].has_key?('management')
# check every key in puppet manifest, leave the rest
should[l].keys.uniq do |to, key| # XXX this is line 65
return false unless to[key] != w[key]
end
end
end
# if some setting changed in manifest, return false
should.each do |k, v|
if v.is_a?(Hash)
v.each do |l, w|
unless is[k][l].nil?
return false unless is[k][l].to_s == w.to_s
end
end
end
end
true
end
def should_to_s(newvalue)
newvalue.inspect
end
def is_to_s(currentvalue)
currentvalue.inspect
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment