lib/helpers/process.rb in puppetdb_rundeck-0.2.3 vs lib/helpers/process.rb in puppetdb_rundeck-0.3.0

- old
+ new

@@ -14,43 +14,25 @@ if fact_name.include?('path') fact_value = fact_value.gsub!('"','') end if collection.instance_of?(Hash) + if collection[host].nil? + collection[host] = {} + end + collection[host][fact_name] = fact_value + elsif collection.instance_of?(Array) collection << "#{fact_name}=\"#{fact_value}\" " else end end } return collection end - def endpoint_processor(output) - file_name = output.tmp_file - content = '' - if File.exist?(file_name) - file = File.new(file_name) - t_now = Time.at(Time.now.to_i) - t_file = Time.at(file.mtime.to_i) - - if t_now < (t_file + 300) - content = File.new(file_name, 'r').read - else - p "#{t_now} #{t_file}" - endpoint = EndPoint.new() - content = endpoint.parse(output) - end - else - endpoint = EndPoint.new() - content = endpoint.parse(output) - end - - return content - end - private def number_to_name(name) lookup = { '1' => 'one', '2' => 'two', '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six', '7' => 'seven', '8' => 'eight', '9' => 'nine', '10' => 'ten', @@ -64,6 +46,6 @@ end } return name end -end \ No newline at end of file +end