Sha256: 1c3e1bea1427d29a3d2e69404976f069bb5c0794482edd13b462dfdb5c28198e

Contents?: true

Size: 1.27 KB

Versions: 45

Compression:

Stored size: 1.27 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 = []
          if destroy_env_content
            puppet_envs = version.content_view_puppet_environments
          elsif version.archive_puppet_environment
            puppet_envs = [version.archive_puppet_environment]
          end

          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

45 entries across 45 versions & 1 rubygems

Version Path
katello-3.8.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.7.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.8.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.7.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.7.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.5.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.6.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.6.0.1.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.6.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.6.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.5.1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.5.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.5.0.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.5.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.5.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.5.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.4.5 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.4.4 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.4.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.4.1 app/lib/actions/katello/content_view_version/destroy.rb