Class: Actions::Katello::Product::ContentDestroy

Inherits:
Base
  • Object
show all
Defined in:
app/lib/actions/katello/product/content_destroy.rb

Instance Method Summary collapse

Instance Method Details

#plan(repository) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/lib/actions/katello/product/content_destroy.rb', line 5

def plan(repository)
  if !repository.product.provider.redhat_provider? &&
       repository.other_repos_with_same_product_and_content.empty?
    sequence do
      plan_action(Candlepin::Product::ContentRemove,
                  product_id: repository.product.cp_id,
                  content_id: repository.content_id)
      if repository.other_repos_with_same_content.empty?
        plan_action(Candlepin::Product::ContentDestroy,
                    content_id: repository.content_id)
      end
    end
  end
end