Sha256: f1ea76ee9ef7080897214bb8d5863ec2e1ffbf5277c33e80408446461e37181e

Contents?: true

Size: 1.08 KB

Versions: 141

Compression:

Stored size: 1.08 KB

Contents

module Actions
  module Katello
    module Product
      class Update < Actions::EntryAction
        def plan(product, product_params)
          action_subject product
          product.update!(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

141 entries across 141 versions & 1 rubygems

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