Skip to content

Commit

Permalink
[PR] Fixes #36765 - add ability to export and import debian content
Browse files Browse the repository at this point in the history
  • Loading branch information
hstct authored and nadjaheitmann committed Mar 4, 2024
1 parent 0cd695c commit 20f0ebc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/katello/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Repository < Katello::Model
ANSIBLE_COLLECTION_TYPE = 'ansible_collection'.freeze
GENERIC_TYPE = 'generic'.freeze

EXPORTABLE_TYPES = [YUM_TYPE, FILE_TYPE, ANSIBLE_COLLECTION_TYPE, DOCKER_TYPE].freeze
EXPORTABLE_TYPES = [YUM_TYPE, FILE_TYPE, ANSIBLE_COLLECTION_TYPE, DOCKER_TYPE, DEB_TYPE].freeze

define_model_callbacks :sync, :only => :after

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def generate!
def generate_repository_metadata(repo)
repo.slice(:name, :label, :description, :arch, :content_type, :unprotected,
:checksum_type, :os_versions, :major, :minor,
:deb_releases, :deb_components, :deb_architectures,
:download_policy, :mirroring_policy).
merge(product: generate_product_metadata(repo.product),
gpg_key: generate_gpg_metadata(repo.gpg_key),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ def parse_repositories(repositories)
download_policy: repo[:download_policy],
mirroring_policy: repo[:mirroring_policy],
redhat: repo[:redhat],
deb_releases: repo[:deb_releases],
deb_components: repo[:deb_components],
deb_architectures: repo[:deb_architectures],
product: product_for_repo(repo),
gpg_key: gpg_key_for_repo(repo),
content: content
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class ExportTest < ActiveSupport::TestCase
assert_includes export.repositories(fetch_all: true).all.map(&:content_type), 'ansible_collection'
assert_includes export.repositories(fetch_all: true).all.map(&:content_type), 'file'
assert_includes export.repositories(fetch_all: true).all.map(&:content_type), 'yum'
refute_includes export.repositories(fetch_all: true).all.map(&:content_type), 'deb'
assert_includes export.repositories(fetch_all: true).all.map(&:content_type), 'deb'
end

it "Generates Exporter path correctly" do
Expand Down

0 comments on commit 20f0ebc

Please sign in to comment.