Sha256: d4a271d1faeef97c2d8d96ecdc10c8ffa7f7378b57007da27c17446a8f23e25b

Contents?: true

Size: 435 Bytes

Versions: 3

Compression:

Stored size: 435 Bytes

Contents

class RemoteExecutionProxySelector < ::ForemanTasks::ProxySelector

  INTERNAL_PROXY = 'internal'.freeze

  def available_proxies(host, provider, capability: nil)
    proxies = host.remote_execution_proxies(provider)
    return proxies if capability.nil?

    proxies.reduce({}) do |acc, (strategy, possible_proxies)|
      acc.merge(strategy => possible_proxies.select { |proxy| proxy.has_capability?(capability) })
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_remote_execution-7.1.0 app/services/remote_execution_proxy_selector.rb
foreman_remote_execution-7.0.0 app/services/remote_execution_proxy_selector.rb
foreman_remote_execution-6.2.0 app/services/remote_execution_proxy_selector.rb