Sha256: b9f51d545242c63fef40e7e6cdad0adf95cba48ad5adc3a3ca1fc9b83dd6afe9

Contents?: true

Size: 1.16 KB

Versions: 30

Compression:

Stored size: 1.16 KB

Contents

module Actions
  module Pulp3
    module CapsuleContent
      class ReclaimSpace < Pulp3::AbstractAsyncTask
        def plan(smart_proxy)
          if smart_proxy.pulp_primary?
            repository_hrefs = ::Katello::Pulp3::RepositoryReference.default_cv_repository_hrefs(::Katello::Repository.unscoped.on_demand, ::Organization.all)
            repository_hrefs.flatten!
          else
            if smart_proxy.download_policy != ::Katello::RootRepository::DOWNLOAD_ON_DEMAND
              fail _('Only On Demand smart proxies may have space reclaimed.')
            end
            repository_hrefs = ::Katello::Pulp3::Api::Core.new(smart_proxy).core_repositories_list_all(fields: 'pulp_href').map(&:pulp_href)
          end
          fail _('There is no downloaded content to clean.') if repository_hrefs.empty?
          plan_self(repository_hrefs: repository_hrefs, smart_proxy_id: smart_proxy.id)
        end

        def invoke_external_task
          output[:pulp_tasks] = ::Katello::Pulp3::Api::Core.new(SmartProxy.find(input[:smart_proxy_id])).
            repositories_reclaim_space_api.reclaim(repo_hrefs: input[:repository_hrefs])
        end
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
katello-4.10.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.9.2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.10.0.rc2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.10.0.rc1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.8.4 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.9.1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.8.3 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.9.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.7.6 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.8.2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.9.0.rc2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.9.0.rc1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.8.1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.7.5 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.8.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.8.0.rc2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.7.4 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.8.0.rc1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.7.3 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.7.2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb