Sha256: 94a22492b29308e6815ce3549367621d0f8297a43c90b600d889a95ca3989d3f

Contents?: true

Size: 1.2 KB

Versions: 55

Compression:

Stored size: 1.2 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_primary!).api_client)
      end

      def self.ids_for_repository(repo_id)
        repo = Katello::Pulp3::Repository::AnsibleCollection.new(Katello::Repository.find(repo_id), SmartProxy.pulp_primary)
        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!(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

55 entries across 55 versions & 1 rubygems

Version Path
katello-4.3.1 app/services/katello/pulp3/ansible_collection.rb
katello-4.2.2 app/services/katello/pulp3/ansible_collection.rb
katello-4.3.0 app/services/katello/pulp3/ansible_collection.rb
katello-4.3.0.rc4 app/services/katello/pulp3/ansible_collection.rb
katello-4.3.0.rc3 app/services/katello/pulp3/ansible_collection.rb
katello-4.3.0.rc2.1 app/services/katello/pulp3/ansible_collection.rb
katello-4.3.0.rc2 app/services/katello/pulp3/ansible_collection.rb
katello-4.3.0.rc1 app/services/katello/pulp3/ansible_collection.rb
katello-4.2.1 app/services/katello/pulp3/ansible_collection.rb
katello-4.2.0.1 app/services/katello/pulp3/ansible_collection.rb
katello-4.1.4 app/services/katello/pulp3/ansible_collection.rb
katello-4.0.3 app/services/katello/pulp3/ansible_collection.rb
katello-4.2.0.1.rc3 app/services/katello/pulp3/ansible_collection.rb
katello-3.18.5 app/services/katello/pulp3/ansible_collection.rb
katello-4.2.0.1.rc2 app/services/katello/pulp3/ansible_collection.rb
katello-4.2.0.rc2 app/services/katello/pulp3/ansible_collection.rb
katello-4.1.3 app/services/katello/pulp3/ansible_collection.rb
katello-4.2.0.rc1 app/services/katello/pulp3/ansible_collection.rb
katello-4.0.2.1 app/services/katello/pulp3/ansible_collection.rb
katello-4.1.2.1 app/services/katello/pulp3/ansible_collection.rb