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

Version Path
katello-3.13.4 app/lib/actions/katello/environment/destroy.rb
katello-3.13.3 app/lib/actions/katello/environment/destroy.rb
katello-3.13.2 app/lib/actions/katello/environment/destroy.rb
katello-3.14.0.rc1 app/lib/actions/katello/environment/destroy.rb
katello-3.13.1 app/lib/actions/katello/environment/destroy.rb
katello-3.13.0 app/lib/actions/katello/environment/destroy.rb
katello-3.13.0.rc2.1 app/lib/actions/katello/environment/destroy.rb
katello-3.13.0.rc2 app/lib/actions/katello/environment/destroy.rb
katello-3.12.3 app/lib/actions/katello/environment/destroy.rb
katello-3.12.2 app/lib/actions/katello/environment/destroy.rb
katello-3.13.0.rc1 app/lib/actions/katello/environment/destroy.rb
katello-3.12.1 app/lib/actions/katello/environment/destroy.rb
katello-3.11.2 app/lib/actions/katello/environment/destroy.rb
katello-3.10.2 app/lib/actions/katello/environment/destroy.rb
katello-3.12.0 app/lib/actions/katello/environment/destroy.rb
katello-3.12.0.rc2 app/lib/actions/katello/environment/destroy.rb
katello-3.10.1.1 app/lib/actions/katello/environment/destroy.rb
katello-3.12.0.rc1 app/lib/actions/katello/environment/destroy.rb
katello-3.10.1 app/lib/actions/katello/environment/destroy.rb
katello-3.11.1 app/lib/actions/katello/environment/destroy.rb