Sha256: 36b55f36be7211301dae35cae122e7f68966995a05bb3bd9a9ef8204e3caeed3
Contents?: true
Size: 1.57 KB
Versions: 114
Compression:
Stored size: 1.57 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']) # CapsuleLifecycleEnvironment can cause issues when auditing, it will try to associate the audit to the deleted taxonomy ::Katello::CapsuleLifecycleEnvironment.without_auditing do environment.destroy! end end end end end end
Version data entries
114 entries across 114 versions & 1 rubygems