Sha256: e8b107a81bcaef6f825751f8fbc364fd0b069f0974df595fe9498e1fb220599a

Contents?: true

Size: 734 Bytes

Versions: 7

Compression:

Stored size: 734 Bytes

Contents

module Actions
  module Katello
    module Subscription
      class Subscribe < Actions::Base
        def plan(system_id, cp_id, quantity)
          plan_self(:user_id => ::User.current.id,
                    :quantity => quantity,
                    :cp_id => cp_id,
                    :system_id => system_id)
        end

        def run
          ::User.current = User.find(input[:user_id])
          ::Katello::System.find(input[:system_id]).subscribe(input[:cp_id], input[:quantity])
        end

        def finalize
          ::User.current = User.find(input[:user_id])
          ::Katello::Pool.find_by_cp_id(input[:cp_id]).import_data
        ensure
          ::User.current = nil
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katello-2.4.5 app/lib/actions/katello/subscription/subscribe.rb
katello-2.4.4 app/lib/actions/katello/subscription/subscribe.rb
katello-2.4.3 app/lib/actions/katello/subscription/subscribe.rb
katello-2.4.2 app/lib/actions/katello/subscription/subscribe.rb
katello-2.4.1 app/lib/actions/katello/subscription/subscribe.rb
katello-2.4.0 app/lib/actions/katello/subscription/subscribe.rb
katello-2.4.0.rc3 app/lib/actions/katello/subscription/subscribe.rb