Sha256: a7f3812141fd3dc42db005bcde2f9dacea0c4b50d66e7e6ca138bc02ef611dc3

Contents?: true

Size: 1.06 KB

Versions: 51

Compression:

Stored size: 1.06 KB

Contents

module Kafo
  module Puppet
    class ReportWrapper
      attr_reader :transaction, :report

      def initialize(transaction, report)
        @transaction     = transaction
        @report          = report
        @supported       = true
      end

      # Needed to fool Puppet's logging framework
      def self.to_s
        "Puppet::Transaction::Report"
      end

      def add_resource_status(status, *args, &block)
        if @supported && report.respond_to?(:resource_statuses) && report.resource_statuses.is_a?(Hash)
          if transaction.in_main_catalog && report.resource_statuses[status.resource.to_s] && transaction.is_interesting?(status.resource)
            ::Puppet.info "RESOURCE #{status.resource}"
          end
          report.add_resource_status(status, *args, &block)
        else
          ::Puppet.err "Your puppet env is not supported, report does not define resource_statuses"
          @supported = false
        end
      end

      def method_missing(method, *args, &block)
        report.send(method, *args, &block)
      end
    end

  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
kafo-0.7.6 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.7.5 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.7.4 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.8.1 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.8.0 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.7.3 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.7.2 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.7.1 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.7.0 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.12 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.11 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.10 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.9 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.8 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.7 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.6 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.5 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.4 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.3 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.6.2 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb