Sha256: f1819be73c3ee88b1e745c2f4d9530111e989819565518663b5875a6bb8e15de
Contents?: true
Size: 1.53 KB
Versions: 14
Compression:
Stored size: 1.53 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, false, true) action_subject(repository) plan_self end def run repo = ::Katello::Repository.find(input[:repository][:id]) output[:repository] = { :name => repo.name, :id => repo.id, :content_type => repo.content_type } end private def repository_mapper(product, content, substituions, 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, substituions) end end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems