Project

General

Profile

« Previous | Next » 

Revision cf2f7656

Added by Ohad Levy about 14 years ago

  • ID cf2f76565425ee835f354e6240511ae9dd9d2050

fixes #181 - External node import prints 'nil' instead of 'class foo missing'

View differences:

lib/tasks/puppet.rake
counter = 0
Host.find_each do |host|
if host.fact_values.size == 0
$stderr.puts "#{host.hostname} has no facts, skipping"
$stdout.puts "#{host.hostname} has no facts, skipping"
next
end
if host.populateFieldsFromFacts
counter += 1
else
$stderr.puts "#{host.hostname}: #{host.errors.full_messages.join(", ")}"
$stdout.puts "#{host.hostname}: #{host.errors.full_messages.join(", ")}"
end
end
puts "Imported #{counter} hosts out of #{Host.count} Hosts" unless counter == 0
......
if nodeinfo.is_a?(Hash)
$stdout.puts "DONE" if host.importNode nodeinfo
else
$stderr.puts "ERROR: invalid output from external nodes"
$stdout.puts "ERROR: invalid output from external nodes"
end
$stdout.flush
$stderr.flush
end
end

Also available in: Unified diff