Sha256: 405ab2d81908edb1a03e2b83323a2b86ccd9b0bd7e108fd45f6b3db75cd53897

Contents?: true

Size: 1.28 KB

Versions: 22

Compression:

Stored size: 1.28 KB

Contents

module Actions
  module Pulp3
    module CapsuleContent
      class ReclaimSpace < Pulp3::AbstractAsyncTask
        def plan(smart_proxy)
          action_subject(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

        def rescue_strategy
          Dynflow::Action::Rescue::Skip
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
katello-4.14.2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.15.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.15.0.rc2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.15.0.rc1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.14.1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.14.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.14.0.rc3 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.14.0.rc2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.14.0.rc1.1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.14.0.rc1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.13.1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.13.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.12.1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.13.0.rc1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.12.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.12.0.rc3 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.12.0.rc2 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.12.0.rc1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.11.1 app/lib/actions/pulp3/capsule_content/reclaim_space.rb
katello-4.11.0 app/lib/actions/pulp3/capsule_content/reclaim_space.rb