Sha256: 83eb0f53f26d78500981416824a49c15dbef9e2b5fb2c91c8ae93296f269fc23

Contents?: true

Size: 889 Bytes

Versions: 88

Compression:

Stored size: 889 Bytes

Contents

module Actions
  module Katello
    module ActivationKey
      class Create < Actions::EntryAction
        def plan(activation_key)
          activation_key.save!
          if ::SETTINGS[:katello][:use_cp]
            cp_create = plan_action(Candlepin::ActivationKey::Create,
                                    organization_label: activation_key.organization.label,
                                    auto_attach: activation_key.auto_attach)
            cp_id = cp_create.output[:response][:id]
          end
          action_subject(activation_key, :cp_id => cp_id)
          plan_self
        end

        def humanized_name
          _("Create")
        end

        def finalize
          activation_key = ::Katello::ActivationKey.find(input[:activation_key][:id])
          activation_key.cp_id = input[:cp_id]
          activation_key.save!
        end
      end
    end
  end
end

Version data entries

88 entries across 88 versions & 1 rubygems

Version Path
katello-3.12.3 app/lib/actions/katello/activation_key/create.rb
katello-3.12.2 app/lib/actions/katello/activation_key/create.rb
katello-3.12.1 app/lib/actions/katello/activation_key/create.rb
katello-3.11.2 app/lib/actions/katello/activation_key/create.rb
katello-3.10.2 app/lib/actions/katello/activation_key/create.rb
katello-3.12.0 app/lib/actions/katello/activation_key/create.rb
katello-3.12.0.rc2 app/lib/actions/katello/activation_key/create.rb
katello-3.10.1.1 app/lib/actions/katello/activation_key/create.rb
katello-3.12.0.rc1 app/lib/actions/katello/activation_key/create.rb
katello-3.10.1 app/lib/actions/katello/activation_key/create.rb
katello-3.11.1 app/lib/actions/katello/activation_key/create.rb
katello-3.11.0 app/lib/actions/katello/activation_key/create.rb
katello-3.11.0.rc2 app/lib/actions/katello/activation_key/create.rb
katello-3.11.0.rc1 app/lib/actions/katello/activation_key/create.rb
katello-3.10.0 app/lib/actions/katello/activation_key/create.rb
katello-3.10.0.rc1.1 app/lib/actions/katello/activation_key/create.rb
katello-3.9.1 app/lib/actions/katello/activation_key/create.rb
katello-3.10.0.rc1 app/lib/actions/katello/activation_key/create.rb
katello-3.9.0 app/lib/actions/katello/activation_key/create.rb
katello-3.8.1 app/lib/actions/katello/activation_key/create.rb