Sha256: d31ff06dd196e754f82384655e097abdb76809daaf75504fb59e59c564549cc5

Contents?: true

Size: 1.14 KB

Versions: 37

Compression:

Stored size: 1.14 KB

Contents

module Actions
  module Katello
    module ContentViewVersion
      class Destroy < Actions::Base
        def plan(version, options = {})
          version.validate_destroyable!(options[:skip_environment_check])

          destroy_env_content = !options.fetch(:skip_destroy_env_content, false)
          repos = destroy_env_content ? version.repositories : version.archived_repos
          puppet_envs = destroy_env_content ? version.content_view_puppet_environments : [version.archive_puppet_environment]

          sequence do
            concurrence do
              repos.each do |repo|
                repo_options = options.clone
                repo_options[:planned_destroy] = true
                plan_action(Repository::Destroy, repo, repo_options)
              end
              puppet_envs.each do |cvpe|
                plan_action(ContentViewPuppetEnvironment::Destroy, cvpe) unless version.default?
              end
            end
          end

          plan_self(:id => version.id)
        end

        def finalize
          version = ::Katello::ContentViewVersion.find(input[:id])
          version.destroy!
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
katello-3.3.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.3.1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.3.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.3.0.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.3.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.3.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.3.0.rc1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.3.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.2.1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.2.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.2.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.2.0.rc3 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.2.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.2.0.rc1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.2.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.1.0.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.1.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.1.0.rc2.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.0.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-2.4.5 app/lib/actions/katello/content_view_version/destroy.rb