knife-lastrun 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/knife-lastrun/version.rb +1 -1
- data/lib/lastrun_update.rb +12 -12
- metadata +2 -2
data/lib/lastrun_update.rb
CHANGED
@@ -3,26 +3,26 @@ require 'chef/log'
|
|
3
3
|
class LastRunUpdateHandler < Chef::Handler
|
4
4
|
|
5
5
|
def report
|
6
|
-
node[:lastrun] = {}
|
6
|
+
node.set[:lastrun] = {}
|
7
7
|
|
8
|
-
node[:lastrun][:status] = run_status.success? ? "success" : "failed"
|
8
|
+
node.set[:lastrun][:status] = run_status.success? ? "success" : "failed"
|
9
9
|
|
10
|
-
node[:lastrun][:runtimes] = {}
|
11
|
-
node[:lastrun][:runtimes][:elapsed] = run_status.elapsed_time
|
12
|
-
node[:lastrun][:runtimes][:start] = run_status.start_time
|
13
|
-
node[:lastrun][:runtimes][:end] = run_status.end_time
|
10
|
+
node.set[:lastrun][:runtimes] = {}
|
11
|
+
node.set[:lastrun][:runtimes][:elapsed] = run_status.elapsed_time
|
12
|
+
node.set[:lastrun][:runtimes][:start] = run_status.start_time
|
13
|
+
node.set[:lastrun][:runtimes][:end] = run_status.end_time
|
14
14
|
|
15
|
-
node[:lastrun][:debug] = {}
|
16
|
-
node[:lastrun][:debug][:backtrace] = run_status.backtrace
|
17
|
-
node[:lastrun][:debug][:exception] = run_status.exception
|
18
|
-
node[:lastrun][:debug][:formatted_exception] = run_status.formatted_exception
|
15
|
+
node.set[:lastrun][:debug] = {}
|
16
|
+
node.set[:lastrun][:debug][:backtrace] = run_status.backtrace
|
17
|
+
node.set[:lastrun][:debug][:exception] = run_status.exception
|
18
|
+
node.set[:lastrun][:debug][:formatted_exception] = run_status.formatted_exception
|
19
19
|
|
20
|
-
node[:lastrun][:updated_resources] = []
|
20
|
+
node.set[:lastrun][:updated_resources] = []
|
21
21
|
run_status.updated_resources.each do |resource|
|
22
22
|
m = "recipe[#{resource.cookbook_name}::#{resource.recipe_name}] ran '#{resource.action}' on #{resource.resource_name} '#{resource.name}'"
|
23
23
|
Chef::Log.debug(m)
|
24
24
|
|
25
|
-
node[:lastrun][:updated_resources].insert(0, {
|
25
|
+
node.set[:lastrun][:updated_resources].insert(0, {
|
26
26
|
:cookbook_name => resource.cookbook_name,
|
27
27
|
:recipe_name => resource.recipe_name,
|
28
28
|
:action => resource.action,
|