Sha256: 359e3a2351eaca88851c2a1aa8c4a571d26c475e64e6a5ba447145a1bfec9622

Contents?: true

Size: 1.22 KB

Versions: 76

Compression:

Stored size: 1.22 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
                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

76 entries across 76 versions & 1 rubygems

Version Path
katello-4.0.3 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.18.5 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.2.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.18.4 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.1.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.18.3.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.18.3 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.0 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.0.rc3.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.0.rc3 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.18.2.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.18.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.17.3 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.0.rc2 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.18.1.1 app/lib/actions/katello/content_view_version/destroy.rb
katello-3.17.2 app/lib/actions/katello/content_view_version/destroy.rb
katello-4.0.0.rc1 app/lib/actions/katello/content_view_version/destroy.rb