Class: Actions::Katello::Environment::Destroy
- Inherits:
-
EntryAction
- Object
- EntryAction
- Actions::Katello::Environment::Destroy
- Defined in:
- app/lib/actions/katello/environment/destroy.rb
Instance Method Summary collapse
- #finalize ⇒ Object
- #humanized_input ⇒ Object
- #humanized_name ⇒ Object
- #plan(env, options = {}) ⇒ Object
Instance Method Details
#finalize ⇒ Object
39 40 41 42 |
# File 'app/lib/actions/katello/environment/destroy.rb', line 39 def finalize environment = ::Katello::KTEnvironment.find(input['kt_environment']['id']) environment.destroy! end |
#humanized_input ⇒ Object
35 36 37 |
# File 'app/lib/actions/katello/environment/destroy.rb', line 35 def humanized_input ["'#{input['kt_environment']['name']}'"] + super end |
#humanized_name ⇒ Object
31 32 33 |
# File 'app/lib/actions/katello/environment/destroy.rb', line 31 def humanized_name _("Delete Lifecycle Environment") end |
#plan(env, options = {}) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/lib/actions/katello/environment/destroy.rb', line 12 def plan(env, = {}) unless env.deletable? fail env.errors..join(" ") end skip_repo_destroy = .fetch(:skip_repo_destroy, false) organization_destroy = .fetch(:organization_destroy, false) sequence do action_subject(env) concurrence do env.content_view_environments.each do |cve| plan_action(ContentView::Remove, cve.content_view, :content_view_environments => [cve], :skip_repo_destroy => skip_repo_destroy, :organization_destroy => organization_destroy) end end plan_self end end |