Sha256: e0538fe785a1bef2ef2aeabc2f13e907d2dca451bd0d4c86a5e31a1c5a11c63f

Contents?: true

Size: 1.26 KB

Versions: 66

Compression:

Stored size: 1.26 KB

Contents

module Actions
  module Katello
    module Foreman
      class ContentUpdate < Actions::Katello::Foreman::Abstract
        middleware.use ::Actions::Middleware::RemoteAction

        def plan(environment, content_view, repo = nil)
          plan_self(environment_id: environment.id,
                    content_view_id: content_view.id,
                    repository_id: repo.try(:id))
        end

        input_format do
          param :environment_id
          param :content_view_id
        end

        def finalize
          environment  = ::Katello::KTEnvironment.find(input[:environment_id])
          content_view = ::Katello::ContentView.find(input[:content_view_id])
          repository = ::Katello::Repository.find(input[:repository_id]) if input[:repository_id]

          if content_view.default? && repository
            if repository.distribution_bootable?
              os = Redhat.find_or_create_operating_system(repository)
              arch = Architecture.where(:name => repository.distribution_arch).first_or_create!
              os.architectures << arch unless os.architectures.include?(arch)
            end
          else
            ::Katello::Foreman.update_puppet_environment(content_view, environment)
          end
        end
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
katello-3.7.1.1 app/lib/actions/katello/foreman/content_update.rb
katello-3.7.1 app/lib/actions/katello/foreman/content_update.rb
katello-3.8.0 app/lib/actions/katello/foreman/content_update.rb
katello-3.8.0.rc3 app/lib/actions/katello/foreman/content_update.rb
katello-3.8.0.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-3.7.0 app/lib/actions/katello/foreman/content_update.rb
katello-3.8.0.rc1 app/lib/actions/katello/foreman/content_update.rb
katello-3.7.0.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-3.7.0.rc1 app/lib/actions/katello/foreman/content_update.rb
katello-3.5.2 app/lib/actions/katello/foreman/content_update.rb
katello-3.6.0 app/lib/actions/katello/foreman/content_update.rb
katello-3.6.0.1.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-3.6.0.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-3.6.0.rc1 app/lib/actions/katello/foreman/content_update.rb
katello-3.5.1.1 app/lib/actions/katello/foreman/content_update.rb
katello-3.5.1 app/lib/actions/katello/foreman/content_update.rb
katello-3.5.0.1 app/lib/actions/katello/foreman/content_update.rb
katello-3.5.0 app/lib/actions/katello/foreman/content_update.rb
katello-3.5.0.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-3.5.0.rc1 app/lib/actions/katello/foreman/content_update.rb