Sha256: cc093f66ad43b2d6a585263ac1a6e3dcb512af1bfccf3231b9085ced85e27e64

Contents?: true

Size: 819 Bytes

Versions: 35

Compression:

Stored size: 819 Bytes

Contents

class DefaultProxyProxySelector < ::RemoteExecutionProxySelector
  def initialize
    # TODO: Remove this once we have a reliable way of determining the internal proxy without katello
    # Tracked as https://projects.theforeman.org/issues/29840
    raise _('Internal proxy selector can only be used if Katello is enabled') unless defined?(::Katello)

    super
  end

  def available_proxies(host, provider)
    # TODO: Once we have a internal proxy marker/feature on the proxy, we can
    # swap the implementation
    raise _('default_capsule method missing from SmartProxy') unless ::SmartProxy.respond_to?(:default_capsule)

    internal_proxy = ::SmartProxy.default_capsule
    super.reduce({}) do |acc, (key, proxies)|
      acc.merge(key => proxies.select { |proxy| proxy == internal_proxy })
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
foreman_remote_execution-5.0.8 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.7 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.6 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.5 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-6.1.0 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.4 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.3 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-6.0.0 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.2 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.1.0 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.1 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-5.0.0 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.8.0 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.5.6 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.5.5 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.5.4 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.7.0 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.5.3 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.5.2 app/services/default_proxy_proxy_selector.rb
foreman_remote_execution-4.5.1 app/services/default_proxy_proxy_selector.rb