Class: Actions::Candlepin::Product::DeletePools

Inherits:
Abstract
  • Object
show all
Defined in:
app/lib/actions/candlepin/product/delete_pools.rb

Instance Method Summary collapse

Instance Method Details

#runObject



10
11
12
13
14
15
# File 'app/lib/actions/candlepin/product/delete_pools.rb', line 10

def run
  output[:response] = ::Katello::Resources::Candlepin::Product.pools(input[:organization_label], input[:cp_id]).each do |pool|
    ::Katello::Pool.where(:cp_id => pool['id']).each(&:destroy)
    ::Katello::Resources::Candlepin::Pool.destroy(pool['id'])
  end
end