Sha256: 7661113bc8cbf5fe9a6eb26bf66307c4a6fed7a1de0f48e7b2cf6222f4b10091

Contents?: true

Size: 683 Bytes

Versions: 3

Compression:

Stored size: 683 Bytes

Contents

module KatelloForemanEngine
  module Actions
    class EnvironmentDestroy < Dynflow::Action

      input_format do
        param :foreman_id, String
      end

      def self.subscribe
        Katello::Actions::EnvironmentDestroy
      end

      def plan(env)
        if !env.library? && foreman_env = Bindings.environment_find(env.organization.label, env.label)
          env.content_views.each do |content_view|
            plan_action(ContentViewDemote, content_view, env)
          end
          plan_self 'foreman_id' => foreman_env['environment']['id']
        end
      end

      def run
        Bindings.environment_destroy(input['foreman_id'])
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
katello-foreman-engine-0.0.3 lib/katello_foreman_engine/actions/environment_destroy.rb
katello-foreman-engine-0.0.2 lib/katello_foreman_engine/actions/environment_destroy.rb
katello-foreman-engine-0.0.1 lib/katello_foreman_engine/actions/environment_destroy.rb