Sha256: 88d6fc81a26bb36667e2e3e29d89470684371b7ad2a3b4f915eda719a1106cdd

Contents?: true

Size: 1.36 KB

Versions: 115

Compression:

Stored size: 1.36 KB

Contents

# The Errata module contains methods that are common for supporting errata
# in several controllers (e.g. SystemErrataController and HostCollectionErrataController)
module Katello
  module Util
    module Errata
      def filter_by_type(errata_list, filter_type)
        filtered_list = []

        if filter_type != "All"
          pulp_filter_type = get_pulp_filter_type(filter_type)

          errata_list.each do |erratum|
            if erratum.respond_to?(:type)
              if erratum.type == pulp_filter_type
                filtered_list << erratum
              end
            else
              if erratum["type"] == pulp_filter_type
                filtered_list << erratum
              end
            end
          end
        else
          filtered_list = errata_list
        end

        return filtered_list
      end

      def get_pulp_filter_type(type)
        filter_type = type.downcase
        if filter_type == "bugfix"
          return ::Katello::Erratum::BUGZILLA
        elsif filter_type == "enhancement"
          return ::Katello::Erratum::ENHANCEMENT
        elsif filter_type == "security"
          return ::Katello::Erratum::SECURITY
        end
      end

      def filter_by_state(errata_list, errata_state)
        if errata_state == "applied"
          return []
        else
          return errata_list
        end
      end
    end
  end
end

Version data entries

115 entries across 115 versions & 1 rubygems

Version Path
katello-3.15.3.1 app/lib/katello/util/errata.rb
katello-3.15.3 app/lib/katello/util/errata.rb
katello-3.15.2 app/lib/katello/util/errata.rb
katello-3.16.0.rc2 app/lib/katello/util/errata.rb
katello-3.15.1.1 app/lib/katello/util/errata.rb
katello-3.16.0.rc1.1 app/lib/katello/util/errata.rb
katello-3.15.1 app/lib/katello/util/errata.rb
katello-3.16.0.rc1 app/lib/katello/util/errata.rb
katello-3.15.0.1 app/lib/katello/util/errata.rb
katello-3.15.0 app/lib/katello/util/errata.rb
katello-3.15.0.rc2 app/lib/katello/util/errata.rb
katello-3.15.0.rc1.3 app/lib/katello/util/errata.rb
katello-3.15.0.rc1.2 app/lib/katello/util/errata.rb
katello-3.15.0.rc1.1 app/lib/katello/util/errata.rb
katello-3.15.0.rc1 app/lib/katello/util/errata.rb
katello-3.14.1 app/lib/katello/util/errata.rb
katello-3.13.4 app/lib/katello/util/errata.rb
katello-3.14.0 app/lib/katello/util/errata.rb
katello-3.13.3 app/lib/katello/util/errata.rb
katello-3.14.0.rc2 app/lib/katello/util/errata.rb