Sha256: e11a5360b4976e5352ee4e72c2f207f21b4aebc14762ef1be3d0718515e7c54a

Contents?: true

Size: 1.47 KB

Versions: 4

Compression:

Stored size: 1.47 KB

Contents

module Actions
  module Pulp3
    module CapsuleContent
      class GenerateMetadata < Pulp3::AbstractAsyncTask
        middleware.use Actions::Middleware::ExecuteIfContentsChanged
        def plan(repository, smart_proxy, options = {})
          options[:contents_changed] = (options && options.key?(:contents_changed)) ? options[:contents_changed] : true
          sequence do
            if !::Katello::RepositoryTypeManager.find(repository.content_type).pulp3_skip_publication
              action_output = plan_self(:repository_id => repository.id, :smart_proxy_id => smart_proxy.id,
                                 :options => options).output
              plan_action(RefreshDistribution, repository, smart_proxy,
                            :tasks => action_output,
                            :use_repository_version => false,
                            :contents_changed => options[:contents_changed])
            else
              plan_action(RefreshDistribution, repository, smart_proxy,
                            :use_repository_version => true,
                            :contents_changed => options[:contents_changed])
            end
          end
        end

        def invoke_external_task
          repository = ::Katello::Repository.find(input[:repository_id])
          smart_proxy = ::SmartProxy.unscoped.find(input[:smart_proxy_id])
          output[:response] = repository.backend_service(smart_proxy).create_mirror_publication
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
katello-3.14.1 app/lib/actions/pulp3/capsule_content/generate_metadata.rb
katello-3.14.0 app/lib/actions/pulp3/capsule_content/generate_metadata.rb
katello-3.14.0.rc2 app/lib/actions/pulp3/capsule_content/generate_metadata.rb
katello-3.14.0.rc1 app/lib/actions/pulp3/capsule_content/generate_metadata.rb