Sha256: 099699a93089bb3a5866259a38752f73e001d099833ad67d35980e0597763b87

Contents?: true

Size: 1.04 KB

Versions: 34

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, clone: false)
          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

34 entries across 34 versions & 1 rubygems

Version Path
katello-4.6.2.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.6.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.6.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.2.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.2.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.5.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.6.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.6.0.rc2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.6.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.5.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.5.0.rc2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.5.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.0.2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.0.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.3.1 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.0 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.0.rc2 app/lib/actions/katello/repository_set/enable_repository.rb
katello-4.4.0.rc1 app/lib/actions/katello/repository_set/enable_repository.rb