Sha256: 58553f6d55abeff206eeb0665c1ccef80b690e6a0e2c1c62b6cdc35c3b415e1e

Contents?: true

Size: 1.33 KB

Versions: 22

Compression:

Stored size: 1.33 KB

Contents

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

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

        private

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

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

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-2.4.0.rc2 app/lib/actions/katello/repository_set/disable_repository.rb
katello-2.4.0.rc1 app/lib/actions/katello/repository_set/disable_repository.rb