Sha256: d64fa85a6f4a545c1c0eb69875ad4d3364db612db6dd1364a16bf936ab57fc7a

Contents?: true

Size: 794 Bytes

Versions: 53

Compression:

Stored size: 794 Bytes

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_primary!)
          plan_self(:repository_id => repository.id, :capsule_id => smart_proxy.id)
        end

        def run
          if input[:repository_id]
            repo = ::Katello::Repository.find(input[:repository_id])
          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

53 entries across 53 versions & 1 rubygems

Version Path
katello-4.7.6 app/lib/actions/pulp/repository/create.rb
katello-4.7.5 app/lib/actions/pulp/repository/create.rb
katello-4.7.4 app/lib/actions/pulp/repository/create.rb
katello-4.7.3 app/lib/actions/pulp/repository/create.rb
katello-4.7.2 app/lib/actions/pulp/repository/create.rb
katello-4.7.1 app/lib/actions/pulp/repository/create.rb
katello-4.6.2.1 app/lib/actions/pulp/repository/create.rb
katello-4.6.2 app/lib/actions/pulp/repository/create.rb
katello-4.7.0 app/lib/actions/pulp/repository/create.rb
katello-4.6.1 app/lib/actions/pulp/repository/create.rb
katello-4.7.0.rc2 app/lib/actions/pulp/repository/create.rb
katello-4.7.0.rc1 app/lib/actions/pulp/repository/create.rb
katello-4.4.2.2 app/lib/actions/pulp/repository/create.rb
katello-4.4.2.1 app/lib/actions/pulp/repository/create.rb
katello-4.4.2 app/lib/actions/pulp/repository/create.rb
katello-4.5.1 app/lib/actions/pulp/repository/create.rb
katello-4.6.0 app/lib/actions/pulp/repository/create.rb
katello-4.6.0.rc2 app/lib/actions/pulp/repository/create.rb
katello-4.6.0.rc1 app/lib/actions/pulp/repository/create.rb
katello-4.5.0 app/lib/actions/pulp/repository/create.rb