Class: Actions::Katello::OrphanCleanup::RemoveOrphans

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

Instance Method Summary collapse

Instance Method Details

#finalizeObject



23
24
25
26
27
28
# File 'app/lib/actions/katello/orphan_cleanup/remove_orphans.rb', line 23

def finalize
  smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
  if smart_proxy.pulp_mirror?
    ::ForemanTasks.async_task(::Actions::Katello::CapsuleContent::UpdateContentCounts, smart_proxy)
  end
end

#plan(proxy) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/lib/actions/katello/orphan_cleanup/remove_orphans.rb', line 8

def plan(proxy)
  sequence do
    if proxy.pulp_primary?
      ::Katello::RootRepository.orphaned.destroy_all
      plan_action(RemoveOrphanedContentUnits)
    end
    if proxy.pulp3_enabled?
      plan_action(
        Actions::Pulp3::Orchestration::OrphanCleanup::RemoveOrphans,
        proxy)
      plan_self(:smart_proxy_id => proxy.id)
    end
  end
end