Class: Actions::Katello::AlternateContentSource::Destroy

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/katello/alternate_content_source/destroy.rb

Instance Method Summary collapse

Instance Method Details

#finalizeObject



15
16
17
18
# File 'app/lib/actions/katello/alternate_content_source/destroy.rb', line 15

def finalize
  acs = ::Katello::AlternateContentSource.find_by(id: input[:acs_id])
  acs.destroy
end

#humanized_nameObject



20
21
22
# File 'app/lib/actions/katello/alternate_content_source/destroy.rb', line 20

def humanized_name
  _("Destroy Alternate Content Source")
end

#plan(acs) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'app/lib/actions/katello/alternate_content_source/destroy.rb', line 5

def plan(acs)
  action_subject(acs)
  sequence do
    acs.smart_proxy_alternate_content_sources.each do |smart_proxy_acs|
      plan_action(Pulp3::Orchestration::AlternateContentSource::Delete, smart_proxy_acs)
    end
    plan_self(acs_id: acs.id)
  end
end