Sha256: 1572d8cda1c99a8d6a619fa6d71618124a0cf9f6d964fda7597be8a35ce9f57f
Contents?: true
Size: 1.21 KB
Versions: 12
Compression:
Stored size: 1.21 KB
Contents
module Katello module Pulp3 class AnsibleCollection < PulpContentUnit include LazyAccessor def self.content_api PulpAnsibleClient::ContentCollectionVersionsApi.new(Katello::Pulp3::Api::AnsibleCollection.new(SmartProxy.pulp_master!).api_client) end def self.ids_for_repository(repo_id) repo = Katello::Pulp3::Repository::AnsibleCollection.new(Katello::Repository.find(repo_id), SmartProxy.pulp_master) repo_content_list = repo.content_list repo_content_list.map { |content| content.try(:pulp_href) } end def self.pulp_data(_pulp_href) #No content read method fail NotImplementedError end def update_model(model) custom_json = {} custom_json['checksum'] = backend_data['sha256'] custom_json['namespace'] = backend_data['namespace'] custom_json['version'] = backend_data['version'] custom_json['name'] = backend_data['name'] custom_json['description'] = backend_data['description'] model.update_attributes!(custom_json) tags = backend_data['tags'].map { |tag| Katello::AnsibleTag.find_or_create_by(name: tag['name']) } model.tags = tags end end end end
Version data entries
12 entries across 12 versions & 1 rubygems