Sha256: 232a571ed67c213942c7da32f7cd13d623d29a9b90871f0f5e655d2244dc71f2

Contents?: true

Size: 1.12 KB

Versions: 40

Compression:

Stored size: 1.12 KB

Contents

module Actions
  module Pulp
    module Repository
      class Create < Pulp::Abstract
        include Helpers::Presenter

        input_format do
          param :repository_id
          param :capsule_id
        end

        def plan(repository, smart_proxy = SmartProxy.pulp_master!)
          if repository.is_a?(::Katello::ContentViewPuppetEnvironment)
            plan_self(:content_view_puppet_environment_id => repository.id, :capsule_id => smart_proxy.id)
          else
            plan_self(:repository_id => repository.id, :capsule_id => smart_proxy.id)
          end
        end

        def run
          if input[:repository_id]
            repo = ::Katello::Repository.find(input[:repository_id])
          else
            repo = ::Katello::ContentViewPuppetEnvironment.find(input[:content_view_puppet_environment_id]).nonpersisted_repository
          end
          output[:response] = repo.backend_service(smart_proxy(input[:capsule_id])).create
        rescue RestClient::Conflict
          Rails.logger.warn("Tried to add repository #{input[:pulp_id]} that already exists.")
          []
        end
      end
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
katello-3.16.2 app/lib/actions/pulp/repository/create.rb
katello-3.16.1.2 app/lib/actions/pulp/repository/create.rb
katello-3.16.1.1 app/lib/actions/pulp/repository/create.rb
katello-3.16.1 app/lib/actions/pulp/repository/create.rb
katello-3.17.0.rc1 app/lib/actions/pulp/repository/create.rb
katello-3.16.0 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc5.1 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc5 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc4.1 app/lib/actions/pulp/repository/create.rb
katello-3.15.3.1 app/lib/actions/pulp/repository/create.rb
katello-3.15.3 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc4 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc3.1 app/lib/actions/pulp/repository/create.rb
katello-3.15.2 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc3 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc2.1 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc2 app/lib/actions/pulp/repository/create.rb
katello-3.15.1.1 app/lib/actions/pulp/repository/create.rb
katello-3.16.0.rc1.1 app/lib/actions/pulp/repository/create.rb
katello-3.15.1 app/lib/actions/pulp/repository/create.rb