Sha256: bedae9a8418e3447f32d91ee43b508a6fdfee828e71d79c4bb8c17bccea68ba9

Contents?: true

Size: 1.07 KB

Versions: 65

Compression:

Stored size: 1.07 KB

Contents

module Actions
  module Candlepin
    module Consumer
      class Create < Candlepin::Abstract
        input_format do
          param :cp_environment_id
          param :consumer_parameters
          param :activation_keys
        end

        # We need to call this in plan phase as this can lean to error responses
        # when the activation key fails to subscribe to the products
        def plan(input)
          response = ::Katello::Resources::Candlepin::Consumer.create(input[:cp_environment_id],
                     input[:consumer_parameters], input[:activation_keys])
          plan_self(input.merge(response: response.slice(:uuid, :name)))
        end

        def run
          # we still keep the output interface the same for case there is other
          # way how to check the ability to subscribe the system with the activation key
          # or we have better support for rolling back in Dynflow
          output[:response] = input[:response]
        end

        def finalize
          input[:consumer_parameters][:facts] = 'TRIMMED'
        end
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
katello-3.13.0 app/lib/actions/candlepin/consumer/create.rb
katello-3.13.0.rc2.1 app/lib/actions/candlepin/consumer/create.rb
katello-3.13.0.rc2 app/lib/actions/candlepin/consumer/create.rb
katello-3.12.3 app/lib/actions/candlepin/consumer/create.rb
katello-3.12.2 app/lib/actions/candlepin/consumer/create.rb
katello-3.13.0.rc1 app/lib/actions/candlepin/consumer/create.rb
katello-3.12.1 app/lib/actions/candlepin/consumer/create.rb
katello-3.11.2 app/lib/actions/candlepin/consumer/create.rb
katello-3.10.2 app/lib/actions/candlepin/consumer/create.rb
katello-3.12.0 app/lib/actions/candlepin/consumer/create.rb
katello-3.12.0.rc2 app/lib/actions/candlepin/consumer/create.rb
katello-3.10.1.1 app/lib/actions/candlepin/consumer/create.rb
katello-3.12.0.rc1 app/lib/actions/candlepin/consumer/create.rb
katello-3.10.1 app/lib/actions/candlepin/consumer/create.rb
katello-3.11.1 app/lib/actions/candlepin/consumer/create.rb
katello-3.11.0 app/lib/actions/candlepin/consumer/create.rb
katello-3.11.0.rc2 app/lib/actions/candlepin/consumer/create.rb
katello-3.11.0.rc1 app/lib/actions/candlepin/consumer/create.rb
katello-3.10.0 app/lib/actions/candlepin/consumer/create.rb
katello-3.10.0.rc1.1 app/lib/actions/candlepin/consumer/create.rb