Sha256: 87bbb80e73435b99c9ff1ead8297bbe2161c99901d9e5fcc0349168c56b0534f

Contents?: true

Size: 1.2 KB

Versions: 16

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_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!(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

16 entries across 16 versions & 1 rubygems

Version Path
katello-3.16.2 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.1.2 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.1.1 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.1 app/services/katello/pulp3/ansible_collection.rb
katello-3.17.0.rc1 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc5.1 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc5 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc4.1 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc4 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc3.1 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc3 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc2.1 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc2 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc1.1 app/services/katello/pulp3/ansible_collection.rb
katello-3.16.0.rc1 app/services/katello/pulp3/ansible_collection.rb