Sha256: 91d5250352dc1a47555d116ba24a603892550fc712d45959ab345a573433c431

Contents?: true

Size: 1.09 KB

Versions: 182

Compression:

Stored size: 1.09 KB

Contents

module Actions
  module Katello
    module UpstreamSubscriptions
      class UpdateEntitlements < Actions::Base
        def plan(pools = [])
          fail _("No pools were provided.") if pools.blank?
          fail _("Current organization is not set.") unless ::Organization.current

          sequence do
            concurrence do
              pools.each do |p|
                pool = ::Katello::Pool.find(p[:id])

                fail _("Provided pool with id %s has no upstream entitlement" % p[:id]) if pool.upstream_entitlement_id.nil?
                plan_action(::Actions::Katello::UpstreamSubscriptions::UpdateEntitlement,
                            entitlement_id: pool.upstream_entitlement_id,
                            quantity: p[:quantity])
              end
            end

            plan_action(::Actions::Katello::Organization::ManifestRefresh, ::Organization.current)
          end
        end

        def humanized_name
          N_("Update Upstream Subscription")
        end

        def rescue_strategy
          Dynflow::Action::Rescue::Skip
        end
      end
    end
  end
end

Version data entries

182 entries across 182 versions & 1 rubygems

Version Path
katello-4.16.0 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.15.1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.16.0.rc2 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.16.0.rc1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.3 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.2 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.15.0 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.15.0.rc2 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.15.0.rc1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.0 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.0.rc3 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.0.rc2 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.0.rc1.1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.14.0.rc1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.13.1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.13.0 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.12.1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.13.0.rc1 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb
katello-4.12.0 app/lib/actions/katello/upstream_subscriptions/update_entitlements.rb