Sha256: 69a4eac85cf6913fe8000a3395e55818755aaf761e16c733d3bcc2ca3e70be94
Contents?: true
Size: 1.36 KB
Versions: 30
Compression:
Stored size: 1.36 KB
Contents
module Actions module Katello module Environment class Destroy < Actions::EntryAction middleware.use ::Actions::Middleware::RemoteAction input_format do param :id param :name end def plan(env, options = {}) fail env.errors.full_messages.join(" ") unless env.deletable? skip_repo_destroy = options.fetch(:skip_repo_destroy, false) organization_destroy = options.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 if organization_destroy env.hostgroups.clear env.hosts.clear end plan_self end end def humanized_name _("Delete Lifecycle Environment") end def humanized_input ["'#{input['kt_environment']['name']}'"] + super end def finalize environment = ::Katello::KTEnvironment.find(input['kt_environment']['id']) environment.destroy! end end end end end
Version data entries
30 entries across 30 versions & 1 rubygems