Sha256: 2b37f73a0575f80962ced4ce4192f551c81c4be1f12a1d69fceb925d79e94272

Contents?: true

Size: 1 KB

Versions: 64

Compression:

Stored size: 1 KB

Contents

module Actions
  module Katello
    module Provider
      class Update < Actions::EntryAction
        def plan(provider, params)
          action_subject(provider)

          update_url(provider, params[:redhat_repository_url]) if params[:redhat_repository_url]
        end

        def humanized_name
          _("Update")
        end

        private

        def update_url(provider, base_url)
          provider.update!(:repository_url => base_url)

          if provider.redhat_provider?
            provider.products.enabled.each do |product|
              update_repository_urls(product)
            end
          end
        end

        def update_repository_urls(product)
          product.repositories.where(:library_instance_id => nil).each do |repository|
            next unless repository.url
            root = repository.root
            url = root.repo_mapper.feed_url
            plan_action(::Actions::Katello::Repository::Update, root, :url => url)
          end
        end
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
katello-4.2.2 app/lib/actions/katello/provider/update.rb
katello-4.2.1 app/lib/actions/katello/provider/update.rb
katello-4.2.0.1 app/lib/actions/katello/provider/update.rb
katello-4.1.4 app/lib/actions/katello/provider/update.rb
katello-4.0.3 app/lib/actions/katello/provider/update.rb
katello-4.2.0.1.rc3 app/lib/actions/katello/provider/update.rb
katello-3.18.5 app/lib/actions/katello/provider/update.rb
katello-4.2.0.1.rc2 app/lib/actions/katello/provider/update.rb
katello-4.2.0.rc2 app/lib/actions/katello/provider/update.rb
katello-4.1.3 app/lib/actions/katello/provider/update.rb
katello-4.2.0.rc1 app/lib/actions/katello/provider/update.rb
katello-4.0.2.1 app/lib/actions/katello/provider/update.rb
katello-4.1.2.1 app/lib/actions/katello/provider/update.rb
katello-4.0.2 app/lib/actions/katello/provider/update.rb
katello-4.1.2 app/lib/actions/katello/provider/update.rb
katello-3.18.4 app/lib/actions/katello/provider/update.rb
katello-4.1.1 app/lib/actions/katello/provider/update.rb
katello-4.1.0 app/lib/actions/katello/provider/update.rb
katello-4.0.1.2 app/lib/actions/katello/provider/update.rb
katello-3.18.3.1 app/lib/actions/katello/provider/update.rb