Sha256: 33fa027401813a76614df468009020fe52a19f2c744a022eff4063a36c23b7f6

Contents?: true

Size: 1.15 KB

Versions: 80

Compression:

Stored size: 1.15 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
          User.as_anonymous_admin do
            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
            end
          end
        end
      end
    end
  end
end

Version data entries

80 entries across 80 versions & 1 rubygems

Version Path
katello-4.13.1 app/lib/actions/katello/foreman/content_update.rb
katello-4.13.0 app/lib/actions/katello/foreman/content_update.rb
katello-4.12.1 app/lib/actions/katello/foreman/content_update.rb
katello-4.13.0.rc1 app/lib/actions/katello/foreman/content_update.rb
katello-4.12.0 app/lib/actions/katello/foreman/content_update.rb
katello-4.12.0.rc3 app/lib/actions/katello/foreman/content_update.rb
katello-4.12.0.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-4.12.0.rc1 app/lib/actions/katello/foreman/content_update.rb
katello-4.11.1 app/lib/actions/katello/foreman/content_update.rb
katello-4.11.0 app/lib/actions/katello/foreman/content_update.rb
katello-4.11.0.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-4.11.0.rc1 app/lib/actions/katello/foreman/content_update.rb
katello-4.10.0 app/lib/actions/katello/foreman/content_update.rb
katello-4.9.2 app/lib/actions/katello/foreman/content_update.rb
katello-4.10.0.rc2 app/lib/actions/katello/foreman/content_update.rb
katello-4.10.0.rc1 app/lib/actions/katello/foreman/content_update.rb
katello-4.8.4 app/lib/actions/katello/foreman/content_update.rb
katello-4.9.1 app/lib/actions/katello/foreman/content_update.rb
katello-4.8.3 app/lib/actions/katello/foreman/content_update.rb
katello-4.9.0 app/lib/actions/katello/foreman/content_update.rb