7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/smart_proxy_openscap/foreman_forwarder.rb', line 7
def post_report(cname, policy_id, date, data, timeout)
foreman_api_path = report_upload_path(cname, policy_id, date)
json = parse_report(cname, policy_id, date, data)
response = send_request(foreman_api_path, json, timeout)
response.value
JSON.parse(response.body)
rescue Net::HTTPServerException => e
logger.debug "Received response: #{response.code} #{response.msg}"
logger.debug response.body
raise ReportUploadError, e.message if response.code.to_i == 422
raise e
end
|