20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'app/models/concerns/foreman_openscap/openscap_proxy_core_extensions.rb', line 20
def update_client_params(model_match, config)
client_item = config.find_config_item self.public_send(config.all_collection_method)
return unless client_item
lookup_keys = client_item.public_send(config.override_method_name)
server_key = lookup_keys.find { |param| param.key == config.server_param }
port_key = lookup_keys.find { |param| param.key == config.port_param }
return if server_key.nil? || port_key.nil?
pairs = scap_client_lookup_values_for([server_key, port_key], model_match)
if openscap_proxy_id
mapping = { config.server_param => openscap_proxy.hostname, config.port_param => openscap_proxy.port }
update_scap_client_lookup_values(pairs, model_match, mapping)
else
destroy_scap_client_lookup_values pairs
end
end
|