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.3.6 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.3.5 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.3.4 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.3.3 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.3.2 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.2.2 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.3.1 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.3.0 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.2.1 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.2.0 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb
kafo-0.1.0 modules/kafo_configure/lib/kafo/puppet/report_wrapper.rb