-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #32802 - Sync/Index Python repo with remote options
- Loading branch information
Showing
20 changed files
with
2,832 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Katello | ||
class GenericContentUnit < Katello::Model | ||
self.table_name = 'katello_generic_content_units' | ||
include Concerns::PulpDatabaseUnit | ||
|
||
CONTENT_TYPE = 'generic_content_unit'.freeze | ||
|
||
def self.default_sort | ||
order(:name) | ||
end | ||
|
||
def self.total_for_repositories(repos) | ||
self.in_repositories(repos).count | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module Katello | ||
class RepositoryGenericContentUnit < Katello::Model | ||
# Do not use active record callbacks in this join model. Direct INSERTs and DELETEs are done | ||
belongs_to :repository, :inverse_of => :repository_generic_content_units, :class_name => 'Katello::Repository' | ||
belongs_to :generic_content_unit, :inverse_of => :repository_generic_content_units, :class_name => 'Katello::GenericContentUnit' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module Katello | ||
module Pulp3 | ||
class GenericContentUnit < PulpContentUnit | ||
include LazyAccessor | ||
CONTENT_TYPE = "generic_content_unit".freeze | ||
|
||
def self.fetch_content_list(page_opts, repository_type, content_type) | ||
content_unit_list page_opts, repository_type, content_type | ||
end | ||
|
||
def self.content_unit_list(page_opts, repository_type, content_type) | ||
self.content_api(repository_type, content_type).list page_opts | ||
end | ||
|
||
def self.content_api(repository_type, content_type) | ||
repository_type.content_types.find { |type| type.content_type == content_type }.pulp3_api.new(repository_type.pulp3_api_class.new(SmartProxy.pulp_primary!, repository_type).api_client) | ||
end | ||
|
||
def update_model(model, repository_type, content_type) | ||
custom_json = {} | ||
custom_json['pulp_id'] = backend_data['pulp_href'] | ||
custom_json['name'] = repository_type.model_name.call(backend_data) | ||
custom_json['version'] = repository_type.model_version.call(backend_data) | ||
custom_json['content_type'] = content_type | ||
model.update!(custom_json) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.