Sha256: 78c01fb2f7904cbe2afcf269523dbe4b575160976a1a86f2c49eb25535dcc19c

Contents?: true

Size: 861 Bytes

Versions: 53

Compression:

Stored size: 861 Bytes

Contents

module ForemanOpenscap::PolicyDashboard
  class Data
    attr_reader :report

    def initialize(policy, filter = "")
      @policy = policy
      @filter = filter
      @report = {}
      fetch_data
    end

    private

    attr_writer :report

    def hosts
      @hosts ||= Host.authorized(:view_hosts, Host)
    end

    def fetch_data
      report.update(
        { :compliant_hosts => Host::Managed.comply_with(@policy).count,
          :incompliant_hosts => Host::Managed.not_comply_with(@policy).count,
          :inconclusive_hosts => Host::Managed.inconclusive_with(@policy).count,
          :report_missing => Host::Managed.policy_reports_missing(@policy).count,
          :assigned_hosts => Host::Managed.assigned_to_policy(@policy).count,
          :unassigned_hosts => Host::Managed.removed_from_policy(@policy).count }
      )
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
foreman_openscap-10.0.3 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-10.0.2 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-10.0.1 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-10.0.0 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-9.0.4 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-9.0.3 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-9.0.2 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-9.0.1 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-9.0.0 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-8.0.0 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-7.1.1 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-7.1.0 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-7.0.0 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-6.0.0 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-5.2.3 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-5.2.2 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-5.1.1 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-5.2.1 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-5.2.0 app/services/foreman_openscap/policy_dashboard/data.rb
foreman_openscap-5.1.0 app/services/foreman_openscap/policy_dashboard/data.rb