Sha256: d4815133d191bf29ccbf0ec8ab7f382c246445e015e102dfcc557e20d9b3ca42
Contents?: true
Size: 869 Bytes
Versions: 7
Compression:
Stored size: 869 Bytes
Contents
module Katello module Pulp3 module ContentViewVersion class ImportGpgKeys def initialize(organization:, metadata_gpg_keys:) @organization = organization @metadata_gpg_keys = metadata_gpg_keys end def create_or_update_gpg!(params) gpg = @organization.gpg_keys.find_by(:name => params[:name]) if gpg gpg.update!(params.except(:name)) else gpg = @organization.gpg_keys.create!(params) end gpg end def import! @metadata_gpg_keys.each do |gpg| params = { name: gpg.name, content_type: ::Katello::ContentCredential::GPG_KEY_TYPE, content: gpg.content, } create_or_update_gpg!(params) end end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems