Sha256: 674855bf1ac1ef5602e7c94874cd5bd1d8f558765b23e4cc4fb2227d65884c0c

Contents?: true

Size: 1.37 KB

Versions: 189

Compression:

Stored size: 1.37 KB

Contents

module Actions
  module Pulp
    module RepositoryGroup
      class Export < Pulp::AbstractAsyncTask
        include Helpers::Presenter

        input_format do
          param :id
          param :export_to_iso
          param :export_directory # NB: this param is only used when not exporting to ISO
          param :start_date
          param :iso_size
        end

        def invoke_external_task
          override_config = { :incremental_export_repomd => true }

          if input[:start_date]
            override_config[:start_date] = input[:start_date]
          end

          if input[:iso_size]
            override_config[:iso_size] = input[:iso_size]
          end

          unless input[:export_to_iso]
            override_config[:export_dir] = input[:export_directory]
          end

          optional = {:override_config => override_config}

          pulp_resources.
            repository_group.publish(input[:id], distributor_id(input[:id]), optional)
        end

        private

        def distributor_id(pulp_id)
          distributor = repo_group_distributors(pulp_id).find do |dist|
            dist["distributor_type_id"] == 'group_export_distributor'
          end
          distributor['id']
        end

        def repo_group_distributors(pulp_id)
          pulp_resources.repository_group.retrieve_distributors(pulp_id)
        end
      end
    end
  end
end

Version data entries

189 entries across 189 versions & 1 rubygems

Version Path
katello-4.7.6 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.5 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.4 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.3 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.2 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.1 app/lib/actions/pulp/repository_group/export.rb
katello-4.6.2.1 app/lib/actions/pulp/repository_group/export.rb
katello-4.6.2 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.0 app/lib/actions/pulp/repository_group/export.rb
katello-4.6.1 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.0.rc2 app/lib/actions/pulp/repository_group/export.rb
katello-4.7.0.rc1 app/lib/actions/pulp/repository_group/export.rb
katello-4.4.2.2 app/lib/actions/pulp/repository_group/export.rb
katello-4.4.2.1 app/lib/actions/pulp/repository_group/export.rb
katello-4.4.2 app/lib/actions/pulp/repository_group/export.rb
katello-4.5.1 app/lib/actions/pulp/repository_group/export.rb
katello-4.6.0 app/lib/actions/pulp/repository_group/export.rb
katello-4.6.0.rc2 app/lib/actions/pulp/repository_group/export.rb
katello-4.6.0.rc1 app/lib/actions/pulp/repository_group/export.rb
katello-4.5.0 app/lib/actions/pulp/repository_group/export.rb