Sha256: a70bc2943527d7d7d211ea8de49552ef8c01b7693c75b3c49083c2c7f6f35727

Contents?: true

Size: 1.38 KB

Versions: 43

Compression:

Stored size: 1.38 KB

Contents

module Actions
  module Katello
    module CdnConfiguration
      class Update < Actions::EntryAction
        def plan(cdn_configuration, options)
          cdn_configuration.update!(options)

          if cdn_configuration.network_sync?
            resource = ::Katello::Resources::CDN::CdnResource.create(cdn_configuration: cdn_configuration)
            resource.validate!
            keypair = resource.debug_certificate
            cdn_configuration.ssl_cert = OpenSSL::X509::Certificate.new(keypair)
            cdn_configuration.ssl_key = OpenSSL::PKey::RSA.new(keypair)

            cdn_configuration.save!
          end

          org = cdn_configuration.organization
          roots = ::Katello::RootRepository.redhat.in_organization(org)
          roots.each do |root|
            full_path = if cdn_configuration.redhat_cdn? || cdn_configuration.custom_cdn?
                          root.product.repo_url(root.library_instance.generate_content_path)
                        elsif cdn_configuration.network_sync?
                          resource.repository_url(content_label: root.content.label, arch: root.arch, major: root.major, minor: root.minor)
                        end
            plan_action(::Actions::Katello::Repository::Update, root, url: full_path)
          end
        end

        def humanized_name
          _("Update CDN Configuration")
        end
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
katello-4.14.2 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.14.1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.14.0 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.14.0.rc3 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.14.0.rc2 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.14.0.rc1.1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.14.0.rc1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.13.1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.13.0 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.12.1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.13.0.rc1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.12.0 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.12.0.rc3 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.12.0.rc2 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.12.0.rc1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.11.1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.11.0 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.11.0.rc2 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.11.0.rc1 app/lib/actions/katello/cdn_configuration/update.rb
katello-4.10.0 app/lib/actions/katello/cdn_configuration/update.rb