Sha256: 8ef825222302699872cc7548327460fe30b7ae518ccd6415bd7bd8b52b67557a

Contents?: true

Size: 1.27 KB

Versions: 34

Compression:

Stored size: 1.27 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 = {})
          unless env.deletable?
            fail env.errors.full_messages.join(" ")
          end
          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

            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

34 entries across 34 versions & 1 rubygems

Version Path
katello-3.3.0.1 app/lib/actions/katello/environment/destroy.rb
katello-3.3.0 app/lib/actions/katello/environment/destroy.rb
katello-3.3.0.rc2 app/lib/actions/katello/environment/destroy.rb
katello-3.3.0.rc1.1 app/lib/actions/katello/environment/destroy.rb
katello-3.3.0.rc1 app/lib/actions/katello/environment/destroy.rb
katello-3.2.1.1 app/lib/actions/katello/environment/destroy.rb
katello-3.2.1 app/lib/actions/katello/environment/destroy.rb
katello-3.2.0 app/lib/actions/katello/environment/destroy.rb
katello-3.2.0.rc3 app/lib/actions/katello/environment/destroy.rb
katello-3.2.0.rc2 app/lib/actions/katello/environment/destroy.rb
katello-3.2.0.rc1.1 app/lib/actions/katello/environment/destroy.rb
katello-3.2.0.rc1 app/lib/actions/katello/environment/destroy.rb
katello-3.1.0.1 app/lib/actions/katello/environment/destroy.rb
katello-3.1.0 app/lib/actions/katello/environment/destroy.rb
katello-3.1.0.rc2.1 app/lib/actions/katello/environment/destroy.rb
katello-3.0.2 app/lib/actions/katello/environment/destroy.rb
katello-2.4.5 app/lib/actions/katello/environment/destroy.rb
katello-3.1.0.rc1 app/lib/actions/katello/environment/destroy.rb
katello-3.0.1 app/lib/actions/katello/environment/destroy.rb
katello-2.4.4 app/lib/actions/katello/environment/destroy.rb