templates/scripts/lookup.rb in opskeleton-0.3.0 vs templates/scripts/lookup.rb in opskeleton-0.3.1
- old
+ new
@@ -4,13 +4,12 @@
require 'net/http'
# this is used for external node lookup in celestial puppet std provider
node = ARGV[0]
-host = node.split('.').first
-if(File.exists?("#{host}.yml"))
- File.open("#{host}.yml").lines.each {|l| puts l}
+if(File.exists?("#{node}.yml"))
+ File.open("#{node}.yml").lines.each {|l| puts l}
else
ip = ENV['SSH_CONNECTION'].split(' ').first
httpcall = Net::HTTP.new(ip, 8082)
resp, data = httpcall.get2("/registry/host/type/#{node}", 'Accept' => 'application/x-yaml')
puts resp.body