chef-formatters-simple 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
File without changes
data/Gemfile CHANGED
File without changes
data/LICENSE CHANGED
File without changes
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
 
23
23
  Add below in /etc/chef/client.rb:
24
24
 
25
- ```
25
+ ```ruby
26
26
  require 'chef/formatters/simple'
27
27
  ```
28
28
 
@@ -32,6 +32,63 @@ Use chef-client with -F or --format option
32
32
  chef-client -F simple -W
33
33
  ```
34
34
 
35
+ When you want to use "simple" instead of "doc" for default, then add below in /etc/chef/client.rb:
36
+
37
+ ```ruby
38
+ class Chef::Client
39
+ alias :orig_default_formatter :default_formatter
40
+ def default_formatter
41
+ if (STDOUT.tty? && !Chef::Config[:force_logger]) || Chef::Config[:force_formatter]
42
+ [:simple]
43
+ else
44
+ [:null]
45
+ end
46
+ end
47
+ end
48
+ ```
49
+
50
+ ## Sample Output
51
+
52
+ ```shell
53
+ # chef-client -W
54
+ Starting Chef Client, version 11.16.4
55
+ resolving cookbooks for run list: ["base", "kernel_parameters", "yum", "yum::proxy", "auditd", "timezone", "language", "selinux", "service", "crond", "incron", "sudo", "logging", "sysstat", "local_account", "iptables", "network", "network::interface", "openssh", "ntp", "manage"]
56
+ Synchronizing cookbooks
57
+ ....................................done.
58
+ Compiling cookbooks
59
+ ..............done.
60
+ Converging 173 resources
61
+ ...S......SSSS............................................................S....S.........................S...........U.................................S.........................SS..........S....
62
+ System converged.
63
+
64
+ resources updated this run:
65
+ Recipe: chef::default
66
+ * template[/etc/chef/client.rb]
67
+ - Would update content in file /etc/chef/client.rb from 189d52 to 163298
68
+ --- /etc/chef/client.rb 2015-02-12 07:50:03.505098752 +0900
69
+ +++ /tmp/chef-rendered-template20150212-30944-1cmyzf5 2015-02-12 07:59:20.304103762 +0900
70
+ @@ -7,15 +7,5 @@
71
+ environment 'projct1-testing'
72
+ ssl_verify_mode :verify_peer
73
+ verify_api_cert true
74
+ -require 'chef/formatters/simple'
75
+ -class Chef::Client
76
+ - alias :orig_default_formatter :default_formatter
77
+ - def default_formatter
78
+ - if (STDOUT.tty? && !Chef::Config[:force_logger]) || Chef::Config[:force_formatter]
79
+ - [:simple]
80
+ - else
81
+ - [:null]
82
+ - end
83
+ - end
84
+ -end
85
+ +require File.expand_path('../simple', __FILE__)
86
+ - Would restore selinux security context
87
+ [2015-02-12T07:59:22+09:00] WARN: In whyrun mode, so NOT performing node save.
88
+ chef client finished, 1 resources updated
89
+ #
90
+ ```
91
+
35
92
  ## Contributing
36
93
 
37
94
  1. Fork it ( https://github.com/[my-github-username]/chef-formatters-simple/fork )
data/Rakefile CHANGED
File without changes
File without changes
@@ -34,12 +34,12 @@ class Chef
34
34
 
35
35
  # Called at the end of the Chef run.
36
36
  def run_completed(node)
37
- puts "chef client finished, #{@updated_resources.size} resources updated"
37
+ @output.puts "chef client finished, #{@updated_resources.size} resources updated", :green
38
38
  end
39
39
 
40
40
  # called at the end of a failed run
41
41
  def run_failed(exception)
42
- puts "chef client failed. #{@updated_resources.size} resources updated"
42
+ @output.puts "\nchef client failed. #{@updated_resources.size} resources updated", :red
43
43
  end
44
44
 
45
45
  # Called right after ohai runs.
@@ -67,6 +67,7 @@ class Chef
67
67
 
68
68
  # Failed to load node data from the server
69
69
  def node_load_failed(node_name, exception, config)
70
+ super
70
71
  end
71
72
 
72
73
  # Default and override attrs from roles have been computed, but not yet applied.
@@ -82,6 +83,7 @@ class Chef
82
83
  # Called when there is an error getting the cookbook collection from the
83
84
  # server.
84
85
  def cookbook_resolution_failed(expanded_run_list, exception)
86
+ super
85
87
  end
86
88
 
87
89
  # Called when the cookbook collection is returned from the server.
@@ -201,10 +203,12 @@ class Chef
201
203
 
202
204
  # Called when a resource fails, but will retry.
203
205
  def resource_failed_retriable(resource, action, retry_count, exception)
206
+ super
204
207
  end
205
208
 
206
209
  # Called when a resource fails and will not be retried.
207
210
  def resource_failed(resource, action, exception)
211
+ super
208
212
  end
209
213
 
210
214
  # Called when a resource action has been skipped b/c of a conditional
@@ -1,5 +1,5 @@
1
1
  class Chef
2
2
  module Formatters
3
- Simple_VERSION = "0.0.2"
3
+ Simple_VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,41 +1,46 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-formatters-simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - sakazuki
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-02-12 00:00:00.000000000 Z
12
+ date: 2016-06-15 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - "~>"
19
+ - - ~>
18
20
  - !ruby/object:Gem::Version
19
21
  version: '1.7'
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - "~>"
27
+ - - ~>
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.7'
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: rake
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '10.0'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '10.0'
41
46
  description: chef-client simple formatter outputs that minimal's output plus delta
@@ -45,7 +50,7 @@ executables: []
45
50
  extensions: []
46
51
  extra_rdoc_files: []
47
52
  files:
48
- - ".gitignore"
53
+ - .gitignore
49
54
  - Gemfile
50
55
  - LICENSE
51
56
  - README.md
@@ -56,25 +61,32 @@ files:
56
61
  homepage: ''
57
62
  licenses:
58
63
  - MIT
59
- metadata: {}
60
64
  post_install_message:
61
65
  rdoc_options: []
62
66
  require_paths:
63
67
  - lib
64
68
  required_ruby_version: !ruby/object:Gem::Requirement
69
+ none: false
65
70
  requirements:
66
- - - ">="
71
+ - - ! '>='
67
72
  - !ruby/object:Gem::Version
68
73
  version: '0'
74
+ segments:
75
+ - 0
76
+ hash: -3600743389222552404
69
77
  required_rubygems_version: !ruby/object:Gem::Requirement
78
+ none: false
70
79
  requirements:
71
- - - ">="
80
+ - - ! '>='
72
81
  - !ruby/object:Gem::Version
73
82
  version: '0'
83
+ segments:
84
+ - 0
85
+ hash: -3600743389222552404
74
86
  requirements: []
75
87
  rubyforge_project:
76
- rubygems_version: 2.4.1
88
+ rubygems_version: 1.8.23
77
89
  signing_key:
78
- specification_version: 4
90
+ specification_version: 3
79
91
  summary: chef-client simple formatter
80
92
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: b43a75234cd6d26a9494e8d361ce2c7acb7b6977
4
- data.tar.gz: ff0b31609915548a0110a58717bc46ae87102c72
5
- SHA512:
6
- metadata.gz: 0079cc2b08835358469b8ff252fabbbc7d7b93ae0f187c4c6101339a0f64a94311a27d1476a4619e76d00f77605346dc0b929edcb338edf76a3df8f5dfa9bc91
7
- data.tar.gz: 3e97a32d66fa23f8f1f35b57965f5db1f0eddabd4892e446541fa0eb5f3375f777695da28cb3488d5216662b5b9b3d4c856feadccd0f59e924738f9e615d2be6