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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1d97250deff8ffd5c72037b4d0238fed378c56b8
4
- data.tar.gz: 8e8c8970a1404fec261e69b6bd24526d785f0c4e
3
+ metadata.gz: dfe8868c136b847e5284653f89ef537b8b9d0926
4
+ data.tar.gz: 950b8a56ce0646a1a5129e8a53c793c2cf4b84e7
5
5
  SHA512:
6
- metadata.gz: 436d4e068161db2aadfcb606a4760bc23a223ed653512cd2b902a4a7b06ce8103b570d0b65afb3536f0349463a805a91829632bbb11e1e51c2a84654f6216c24
7
- data.tar.gz: 34389aa362ea2970d6dec370a1b9bc47a26c384783fef524a6bedd60274331bdb704361f7e2f8b1709c0368dacba2dd102da83a642c1e9f310cb6e3d71c06ade
6
+ metadata.gz: 2ccef4a02d5452ac38aed4878e6241731da4393b5429e73b6f4a4514b2bfa28b4fbe8b651d5d1675504fdff4a2e196233290282bd1371e7a107d2aa8cc26b8a9
7
+ data.tar.gz: 416259a2a569180d71aab8d3218a7bf51fb823019664344e7361dabaccc1493b8fa8a2e0e5a94ff646d4dabfd84ae22f7e8c5f920c15759925709e160f183e12
@@ -1,18 +1,18 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "knife-lastrun/version"
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-05'
9
- s.summary = "A plugin for Chef::Knife which displays node metadata about the last chef run."
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 = ["John Goulah"]
12
- s.email = ["jgoulah@gmail.com"]
13
- s.homepage = "https://github.com/jgoulah/knife-lastrun"
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 = ["lib"]
17
+ s.require_paths = ['lib']
18
18
  end
@@ -1,7 +1,7 @@
1
1
  module GoulahPlugins
2
2
  class NodeLastrun < Chef::Knife
3
3
 
4
- banner "knife node lastrun NODE"
4
+ banner 'knife node lastrun NODE'
5
5
 
6
6
  deps do
7
7
  require 'highline'
@@ -1,5 +1,5 @@
1
1
  module Knife
2
2
  module NodeLastrun
3
- VERSION = "0.0.7"
3
+ VERSION = '0.0.8'
4
4
  end
5
5
  end
@@ -4,26 +4,26 @@ class LastRunUpdateHandler < Chef::Handler
4
4
 
5
5
  def report
6
6
  _node = Chef::Node.load(node.name)
7
- _node.override[:lastrun] = {}
7
+ _node.normal[:lastrun] = {}
8
8
 
9
- _node.override[:lastrun][:status] = run_status.success? ? "success" : "failed"
9
+ _node.normal[:lastrun][:status] = run_status.success? ? 'success' : 'failed'
10
10
 
11
- _node.override[:lastrun][:runtimes] = {}
12
- _node.override[:lastrun][:runtimes][:elapsed] = run_status.elapsed_time
13
- _node.override[:lastrun][:runtimes][:start] = run_status.start_time
14
- _node.override[:lastrun][:runtimes][:end] = run_status.end_time
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.override[:lastrun][:debug] = {}
17
- _node.override[:lastrun][:debug][:backtrace] = run_status.backtrace
18
- _node.override[:lastrun][:debug][:exception] = run_status.exception
19
- _node.override[:lastrun][:debug][:formatted_exception] = run_status.formatted_exception
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.override[:lastrun][:updated_resources] = []
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.override[:lastrun][:updated_resources].insert(0, {
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("Skipping final node save because override_runlist was given")
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.7
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-05 00:00:00.000000000 Z
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.