diff options
Diffstat (limited to 'vendor/supply_drop/lib/supply_drop/writer/batched.rb')
-rw-r--r-- | vendor/supply_drop/lib/supply_drop/writer/batched.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/supply_drop/lib/supply_drop/writer/batched.rb b/vendor/supply_drop/lib/supply_drop/writer/batched.rb new file mode 100644 index 0000000..e5fc826 --- /dev/null +++ b/vendor/supply_drop/lib/supply_drop/writer/batched.rb @@ -0,0 +1,22 @@ +module SupplyDrop + module Writer + class Batched + def initialize(logger) + @outputs = {} + @logger = logger + end + + def collect_output(host, data) + @outputs[host] ||= "" + @outputs[host] << data + end + + def all_output_collected + @outputs.keys.sort.each do |host| + @logger.info "Puppet output for #{host}" + @logger.debug @outputs[host], host + end + end + end + end +end |