Actions
Feature #17909
closedAdd pending states to app/services/foreman_salt/report_importer.rb
Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Description
In import_log_messages in app/services/foreman_salt/report_importer.rb the following code is used to categorise the level of the log message :
level = if result['changes'].blank? && result['result']
:info
elsif !result['result']
:err
else
:notice
end
I would like to modify this to include a pending state. Looking at the json that is send to foreman and is processed by the Actions::ForemanSalt::ReportImport it seems that "result"=>nil is used for pending tasks (reported by highstate test=True).
"file_|-/etc/apt/apt.conf.d/99proxy_|-/etc/apt/apt.conf.d/99proxy_|-managed"=>
{"comment"=>"The file /etc/apt/apt.conf.d/99proxy is set to be changed",
"name"=>"/etc/apt/apt.conf.d/99proxy",
"start_time"=>"15:49:36.956739",
"result"=>nil,
"duration"=>98.197,
"__run_num__"=>99,
"changes"=>
{"diff"=>
"--- \n+++ \n@@ -2,4 +2,4 @@\n new content;\n"}},
Am a complete newbie in ruby, could someone help me out adding this elsif ?
Actions