Sha256: 37cb33ea2e3f62e47826d85f214344461f1a225de1716f0be4e86292fec07cc8

Contents?: true

Size: 1.04 KB

Versions: 100

Compression:

Stored size: 1.04 KB

Contents

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

        def plan(product, content, options)
          mapper = ::Katello::Candlepin::RepositoryMapper.new(product,
                                                               content,
                                                               options)
          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
      end
    end
  end
end

Version data entries

100 entries across 100 versions & 1 rubygems

Version Path
katello-3.13.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.12.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.11.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.10.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.12.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.12.0.rc2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.10.1.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.12.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.10.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.11.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.11.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.11.0.rc2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.11.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.10.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.10.0.rc1.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.9.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.10.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.9.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.9.0.rc2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-3.9.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb