Sha256: 6ffb4fcd90928b9befb2f3b3c41167a50d0cd1a5ebe43d13276bd72f6bc247ed

Contents?: true

Size: 1.09 KB

Versions: 24

Compression:

Stored size: 1.09 KB

Contents

module Actions
  module Katello
    module Product
      class Update < Actions::EntryAction
        def plan(product, product_params)
          action_subject product
          product.update_attributes!(product_params)
          if product.previous_changes.key?('gpg_key_id')
            plan_action(::Actions::Katello::Product::RepositoriesGpgReset, product)
          end
          if (product.previous_changes.key?('ssl_ca_cert_id') ||
              product.previous_changes.key?('ssl_client_cert_id') ||
              product.previous_changes.key?('ssl_client_key_id'))
            plan_action(::Actions::Katello::Product::RepositoriesCertsReset, product)
          end

          if product.previous_changes.key?('name')
            plan_action(::Actions::Candlepin::Product::Update, owner: product.organization.label, name: product.name, id: product.cp_id)
            product.subscriptions.each do |subscription|
              plan_action(::Actions::Katello::Subscription::Update, subscription, name: product.name)
            end
          end

          product.reload
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
katello-3.15.3.1 app/lib/actions/katello/product/update.rb
katello-3.15.3 app/lib/actions/katello/product/update.rb
katello-3.15.2 app/lib/actions/katello/product/update.rb
katello-3.15.1.1 app/lib/actions/katello/product/update.rb
katello-3.15.1 app/lib/actions/katello/product/update.rb
katello-3.15.0.1 app/lib/actions/katello/product/update.rb
katello-3.15.0 app/lib/actions/katello/product/update.rb
katello-3.15.0.rc2 app/lib/actions/katello/product/update.rb
katello-3.15.0.rc1.3 app/lib/actions/katello/product/update.rb
katello-3.15.0.rc1.2 app/lib/actions/katello/product/update.rb
katello-3.15.0.rc1.1 app/lib/actions/katello/product/update.rb
katello-3.15.0.rc1 app/lib/actions/katello/product/update.rb
katello-3.14.1 app/lib/actions/katello/product/update.rb
katello-3.13.4 app/lib/actions/katello/product/update.rb
katello-3.14.0 app/lib/actions/katello/product/update.rb
katello-3.13.3 app/lib/actions/katello/product/update.rb
katello-3.14.0.rc2 app/lib/actions/katello/product/update.rb
katello-3.13.2 app/lib/actions/katello/product/update.rb
katello-3.14.0.rc1 app/lib/actions/katello/product/update.rb
katello-3.13.1 app/lib/actions/katello/product/update.rb