knife-lastrun 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/knife-lastrun.gemspec +8 -8
- data/lib/chef/knife/lastrun.rb +1 -1
- data/lib/knife-lastrun/version.rb +1 -1
- data/lib/lastrun_update.rb +13 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfe8868c136b847e5284653f89ef537b8b9d0926
|
4
|
+
data.tar.gz: 950b8a56ce0646a1a5129e8a53c793c2cf4b84e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ccef4a02d5452ac38aed4878e6241731da4393b5429e73b6f4a4514b2bfa28b4fbe8b651d5d1675504fdff4a2e196233290282bd1371e7a107d2aa8cc26b8a9
|
7
|
+
data.tar.gz: 416259a2a569180d71aab8d3218a7bf51fb823019664344e7361dabaccc1493b8fa8a2e0e5a94ff646d4dabfd84ae22f7e8c5f920c15759925709e160f183e12
|
data/knife-lastrun.gemspec
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path(
|
3
|
-
require
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'knife-lastrun/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'knife-lastrun'
|
7
7
|
s.version = Knife::NodeLastrun::VERSION
|
8
|
-
s.date = '2017-07-
|
9
|
-
s.summary =
|
8
|
+
s.date = '2017-07-06'
|
9
|
+
s.summary = 'A plugin for Chef::Knife which displays node metadata about the last chef run.'
|
10
10
|
s.description = s.summary
|
11
|
-
s.authors = [
|
12
|
-
s.email = [
|
13
|
-
s.homepage =
|
11
|
+
s.authors = ['John Goulah']
|
12
|
+
s.email = ['jgoulah@gmail.com']
|
13
|
+
s.homepage = 'https://github.com/jgoulah/knife-lastrun'
|
14
14
|
s.files = `git ls-files`.split("\n")
|
15
15
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
-
s.require_paths = [
|
17
|
+
s.require_paths = ['lib']
|
18
18
|
end
|
data/lib/chef/knife/lastrun.rb
CHANGED
data/lib/lastrun_update.rb
CHANGED
@@ -4,26 +4,26 @@ class LastRunUpdateHandler < Chef::Handler
|
|
4
4
|
|
5
5
|
def report
|
6
6
|
_node = Chef::Node.load(node.name)
|
7
|
-
_node.
|
7
|
+
_node.normal[:lastrun] = {}
|
8
8
|
|
9
|
-
_node.
|
9
|
+
_node.normal[:lastrun][:status] = run_status.success? ? 'success' : 'failed'
|
10
10
|
|
11
|
-
_node.
|
12
|
-
_node.
|
13
|
-
_node.
|
14
|
-
_node.
|
11
|
+
_node.normal[:lastrun][:runtimes] = {}
|
12
|
+
_node.normal[:lastrun][:runtimes][:elapsed] = run_status.elapsed_time
|
13
|
+
_node.normal[:lastrun][:runtimes][:start] = run_status.start_time
|
14
|
+
_node.normal[:lastrun][:runtimes][:end] = run_status.end_time
|
15
15
|
|
16
|
-
_node.
|
17
|
-
_node.
|
18
|
-
_node.
|
19
|
-
_node.
|
16
|
+
_node.normal[:lastrun][:debug] = {}
|
17
|
+
_node.normal[:lastrun][:debug][:backtrace] = run_status.backtrace
|
18
|
+
_node.normal[:lastrun][:debug][:exception] = run_status.exception
|
19
|
+
_node.normal[:lastrun][:debug][:formatted_exception] = run_status.formatted_exception
|
20
20
|
|
21
|
-
_node.
|
21
|
+
_node.normal[:lastrun][:updated_resources] = []
|
22
22
|
Array(run_status.updated_resources).each do |resource|
|
23
23
|
m = "recipe[#{resource.cookbook_name}::#{resource.recipe_name}] ran '#{resource.action}' on #{resource.resource_name} '#{resource.name}'"
|
24
24
|
Chef::Log.debug(m)
|
25
25
|
|
26
|
-
_node.
|
26
|
+
_node.normal[:lastrun][:updated_resources].insert(0, {
|
27
27
|
:cookbook_name => resource.cookbook_name,
|
28
28
|
:recipe_name => resource.recipe_name,
|
29
29
|
:action => resource.action,
|
@@ -35,7 +35,7 @@ class LastRunUpdateHandler < Chef::Handler
|
|
35
35
|
|
36
36
|
# Save attributes to node unless overridden runlist has been supplied
|
37
37
|
if Chef::Config.override_runlist
|
38
|
-
Chef::Log.warn(
|
38
|
+
Chef::Log.warn('Skipping final node save because override_runlist was given')
|
39
39
|
else
|
40
40
|
_node.save
|
41
41
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-lastrun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Goulah
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-07-
|
11
|
+
date: 2017-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A plugin for Chef::Knife which displays node metadata about the last
|
14
14
|
chef run.
|