Sha256: f98c1db5eec68706231f1f57a43173a10fcb7693ea6d9939f0f3f9f8a4dba4c6

Contents?: true

Size: 1.29 KB

Versions: 22

Compression:

Stored size: 1.29 KB

Contents

module Actions
  module Katello
    module RepositorySet
      class EnableRepository < Actions::EntryAction
        def humanized_name
          _("Enable")
        end

        def plan(product, content, options)
          mapper = repository_mapper(product, content, options, options[:registry_name])
          mapper.validate!
          if mapper.find_repository
            fail ::Katello::Errors::ConflictException, _("The repository is already enabled")
          end
          repository = mapper.build_repository
          plan_action(Repository::Create, repository)
          action_subject(repository)
        end

        private

        def repository_mapper(product, content, substituions, 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,
                                                                substituions)
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-3.1.0.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.1.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.1.0.rc2.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-2.4.5 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.1.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-2.4.4 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-2.4.3 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.0.rc7 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.0.rc5 app/lib/actions/katello/repository_set/enable_repository.rb
katello-2.4.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.0.rc4 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.0.rc3 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.0.rc2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.0.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-2.4.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-2.4.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-2.4.0.rc3 app/lib/actions/katello/repository_set/enable_repository.rb