Sha256: ccadbb62614accc71acd0b8b5b7b311cf4db1799a576c169a86e33ed0dafb49d

Contents?: true

Size: 1.34 KB

Versions: 14

Compression:

Stored size: 1.34 KB

Contents

module Actions
  module Katello
    module RepositorySet
      class DisableRepository < Actions::EntryAction
        def humanized_name
          _("Disable")
        end

        def plan(product, content, options)
          repository = repository_mapper(product,
                                         content,
                                         options,
                                         options[:registry_name]).find_repository
          if repository
            action_subject(repository)
            plan_action(Repository::Destroy, repository, :planned_destroy => true)
          else
            fail ::Katello::Errors::NotFound, _('Repository not found')
          end
        end

        private

        def repository_mapper(product, content, substitutions, registry_name)
          if content.content_type == ::Katello::Repository::CANDLEPIN_DOCKER_TYPE
            ::Katello::Candlepin::DockerRepositoryMapper.new(product,
                                                             content,
                                                             registry_name)

          else
            ::Katello::Candlepin::RepositoryMapper.new(product,
                                                       content,
                                                       substitutions)
          end
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
katello-3.8.1 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.7.1.1 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.7.1 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.8.0 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.8.0.rc3 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.8.0.rc2 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.7.0 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.8.0.rc1 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.7.0.rc2 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.7.0.rc1 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.6.0 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.6.0.1.rc2 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.6.0.rc2 app/lib/actions/katello/repository_set/disable_repository.rb
katello-3.6.0.rc1 app/lib/actions/katello/repository_set/disable_repository.rb