chef-sugar 3.4.0 → 3.5.0

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: e302495d54fd2ab9c684d7f14aa9cbd1a4fec669
4
- data.tar.gz: 74531fd32eb4b31afb0dd12f7490c7d2a25526ab
3
+ metadata.gz: b5c2bcc53914b4dfa467833f774600428d3120a8
4
+ data.tar.gz: c114d8423104080333d2a8d2f1d9dabaa465b4fc
5
5
  SHA512:
6
- metadata.gz: 2a68af78673536af03376c879442090b269319b16dc79a0bdd12fa768db20d83fcd14bc151ef794bb44b1b28e1654582c3c484944fac48fb22d615731455b1de
7
- data.tar.gz: dec8f58a0fac8e97867673f9122fae92e0cd7ddd9b1386fc099446476c56e597618789f79c2f361521fb2df45f040742c06b16e5d378df671df439e771f2fad8
6
+ metadata.gz: 8023ee95ec201759a0cfd025c6bc40b7e614864119710e970389a0b7e16948b0442727082e0849393c258b1284a4051bc8f3532e3a03ae9d0177619ea3b46e34
7
+ data.tar.gz: 8f727b0ba3e4bfb884ca82a921bb3956e95e252b79b1d355fb4e2ed7fc51b6ca25c9063e7226801f65a604871e98e0be41d8fb10e5ab268443dbf498a7c10d6f
@@ -3,11 +3,13 @@ driver:
3
3
 
4
4
  provisioner:
5
5
  name: chef_zero
6
- require_chef_omnibus: 11.8.0
6
+ deprecations_as_errors: true
7
7
 
8
8
  platforms:
9
- - name: ubuntu-12.04
10
- - name: centos-6.4
9
+ - name: centos-6.8
10
+ - name: centos-7.3
11
+ - name: ubuntu-14.04
12
+ - name: ubuntu-16.04
11
13
 
12
14
  suites:
13
15
  - name: default
@@ -1,8 +1,10 @@
1
1
  sudo: false
2
2
 
3
3
  rvm:
4
- - 2.1
5
- - 2.2
4
+ - 2.1.9
5
+ - 2.2.6
6
+ - 2.3.1
7
+ - 2.4.0
6
8
 
7
9
  branches:
8
10
  only:
@@ -1,28 +1,37 @@
1
- Chef Sugar Changelog
2
- =========================
1
+ # Chef Sugar Changelog
2
+
3
3
  This file is used to list changes made in each version of the chef-sugar cookbook and gem.
4
4
 
5
- v3.4.0 (2016-07-18)
6
- -------------------
5
+ ## v3.5.0 (2016-07-12)
6
+
7
+ - Improve the systemd check to not fail on older kernels or Windows hosts
8
+ - Add detection of macOS 10.11 and 10.12
9
+
10
+ ## v3.4.0 (2016-07-18)
11
+
7
12
  ### Improvements
13
+
8
14
  - Add `virtual?` and `physical?` methods
9
15
  - Add Scaleway C1 server (arm arch) support
10
16
  - Add IMB s390x support
11
17
  - Add missing Ubuntu release names
12
18
 
13
19
  ### Bug Fixes
20
+
14
21
  - Drop Ruby 2.0.0 support from Travis test matrix
15
22
  - Pin to Rack 1.6 (dev dep)
16
23
 
17
- v3.3.0 (2016-01-11)
18
- -------------------
24
+ ## v3.3.0 (2016-01-11)
25
+
19
26
  ### Improvements
27
+
20
28
  - Break up `Chef::Sugar::Constraints` into a class and a dsl file
21
29
  - Add `platform_version` method with full constraints comparison support
22
30
 
23
- v3.2.0 (2015-12-10)
24
- -------------------
31
+ ## v3.2.0 (2015-12-10)
32
+
25
33
  ### Improvements
34
+
26
35
  - Add platform matchers for `debian` and `fedora`
27
36
  - Add `openvz` support under virtualization
28
37
  - Add init system detection support
@@ -30,41 +39,47 @@ v3.2.0 (2015-12-10)
30
39
  - Add additional `aix` helpers
31
40
 
32
41
  ### Bug Fixes
42
+
33
43
  - Properly expose `Architecture#i386?` in the DSL
34
44
 
35
- v3.1.1 (2015-06-23)
36
- -------------------
45
+ ## v3.1.1 (2015-06-23)
46
+
37
47
  ### Improvements
48
+
38
49
  - Update Intel CPU types based on existing Fauxhai data
39
50
  - Update SPARC logic and 32/64-bit logic for x86 and i386
40
51
 
41
52
  ### Bug Fixes
53
+
42
54
  - Fix 32-bit logic
43
55
  - Fix default behavior to include chef-sugar at compile time
44
56
  - Fix Chef 12.1.0 warnings for chef_gem compile time install
45
57
  - Fix `redhat_enterprise_linux?` matcher
46
58
 
47
- v3.0.2 (2015-03-26)
48
- -------------------
59
+ ## v3.0.2 (2015-03-26)
60
+
49
61
  ### Improvements
62
+
50
63
  - Add helpers for `ppc64` and `ppc64le` architecture
51
64
 
52
65
  ### Bug Fixes
66
+
53
67
  - Adjustments to error message
54
68
 
55
- v3.0.1 (2015-03-20)
56
- -------------------
69
+ ## v3.0.1 (2015-03-20)
70
+
57
71
  ### Breaking Changes
58
- - Rename `compile_time` `to at_compile_time` - if your recipes are affected by
59
- this breaking change, your Chef Client run will produce a verbose error
60
- message with details on how to fix the error.
61
72
 
62
- v3.0.0 (2015-03-17)
63
- -------------------
73
+ - Rename `compile_time` `to at_compile_time` - if your recipes are affected by this breaking change, your Chef Client run will produce a verbose error message with details on how to fix the error.
74
+
75
+ ## v3.0.0 (2015-03-17)
76
+
64
77
  ### Breaking Changes
78
+
65
79
  - Drop support for Ruby 1.9 (it might still work, but it is no longer officially supported)
66
80
 
67
81
  ### Improvements
82
+
68
83
  - Remove accidentially committed gem source
69
84
  - Bump development dependencies
70
85
  - Add `digitalocean?` matcher
@@ -75,74 +90,87 @@ v3.0.0 (2015-03-17)
75
90
  - Add dynamic platform/version matchers for Solaris
76
91
 
77
92
  ### Bug Fixes
93
+
78
94
  - Reset namespace_options when reaching top-level resources
79
95
 
80
- v2.5.0 (2015-01-05)
81
- -------------------
96
+ ## v2.5.0 (2015-01-05)
97
+
82
98
  ### Improvements
99
+
83
100
  - Add `data_bag_item_for_environment` function
84
101
  - Add `kvm?` matcher
85
102
  - Add `virtualbox?` matcher
86
103
 
87
104
  ### Bug Fixes
88
- - Use `.key?` to check for hash key presence, raising an `AttributeDoesNotExist`
89
- error sooner
90
105
 
91
- v2.4.1 (2014-10-12)
92
- -------------------
106
+ - Use `.key?` to check for hash key presence, raising an `AttributeDoesNotExist` error sooner
107
+
108
+ ## v2.4.1 (2014-10-12)
109
+
93
110
  - No changes from v2.4.0 - forced a new version upload to the Chef Supermarket
94
111
 
95
- v2.4.0 (2014-10-12)
96
- -------------------
112
+ ## v2.4.0 (2014-10-12)
113
+
97
114
  ### Improvements
115
+
98
116
  - Add `docker?` matcher
99
117
 
100
- v2.3.2 (2014-10-07)
101
- -------------------
118
+ ## v2.3.2 (2014-10-07)
119
+
102
120
  ### Big Fixues
121
+
103
122
  - Include `amd64` in `_64_bit?` check
104
123
 
105
- v2.3.1 (2014-10-07)
106
- -------------------
124
+ ## v2.3.1 (2014-10-07)
125
+
107
126
  ### Improvements
127
+
108
128
  - Check all 64-bit architectures that may be reported by Ohai
109
129
 
110
130
  ### Bug Fixes
131
+
111
132
  - Be more tolerant of `nil` values return from sub functions
112
133
  - Check to make sure `node['domain']` is not `nil` before calling `#include?`
113
134
 
114
- v2.3.0 (2014-09-24)
115
- -------------------
135
+ ## v2.3.0 (2014-09-24)
136
+
116
137
  ### Improvements
138
+
117
139
  - Add `vmware?` matcher
118
140
  - Allow the attribute DSL to access parent attributes
119
141
 
120
142
  ### Bug Fixes
143
+
121
144
  - Return `true` or `false` from all Boolean methods (instead of `nil` or truthy values)
122
145
 
123
- v2.2.0 (2014-08-20)
124
- -------------------
146
+ ## v2.2.0 (2014-08-20)
147
+
125
148
  ### Improvements
149
+
126
150
  - Add `smartos?` matcher
127
151
  - Add `omnios?` matcher
128
152
 
129
- v2.1.0 (2014-06-26)
130
- -------------------
153
+ ## v2.1.0 (2014-06-26)
154
+
131
155
  ### Improvements
156
+
132
157
  - Add `solaris2?` matcher
133
158
  - Add `aix?` matcher
134
159
  - Add 'lxc?' matcher
135
160
 
136
161
  ### Bug Fixes
162
+
137
163
  - Fix a bug in namespace memoization during attribute initialization
138
164
 
139
- v2.0.0 (2014-06-16)
140
- -------------------
165
+ ## v2.0.0 (2014-06-16)
166
+
141
167
  ### Breaking
168
+
142
169
  - Remove `not_linux?` method
143
170
  - Remove `not_windows?` method
144
171
 
145
172
  ### Improvements
173
+
146
174
  - Miscellaneous spelling fixes
147
175
  - Update a failing unit test for `installed?`
148
176
  - Add Mac OS X to the list of platforms (Yosemite)
@@ -150,8 +178,8 @@ v2.0.0 (2014-06-16)
150
178
  - Fix `which` (and `installed?` and `installed_at_version?`) when given an absolute path
151
179
  - Fix `linux?` check to only return true on real linuxes
152
180
 
153
- v1.3.0 (2014-05-05)
154
- -------------------
181
+ ## v1.3.0 (2014-05-05)
182
+
155
183
  - Check both `$stdout` and `$stderr` in `version_for`
156
184
  - Add additional platform versions
157
185
  - Make `includes_recipe?` a top-level API (instead of just Node)
@@ -160,21 +188,21 @@ v1.3.0 (2014-05-05)
160
188
  - Define `String#flush` as a core extension
161
189
  - Remove Stove
162
190
 
163
- v1.2.6 (2014-03-16)
164
- -------------------
191
+ ## v1.2.6 (2014-03-16)
192
+
165
193
  - Fix a bug in `vagrant?` returning false on newer Vagrant versions
166
194
  - Remove Coveralls
167
195
 
168
- v1.2.4 (2014-03-13)
169
- -------------------
196
+ ## v1.2.4 (2014-03-13)
197
+
170
198
  - See (1.2.2), but I botched the release
171
199
 
172
- v1.2.2 (2014-03-13)
173
- -------------------
200
+ ## v1.2.2 (2014-03-13)
201
+
174
202
  - Fix a critical bug with `encrypted_data_bag_item` using the wrong key
175
203
 
176
- v1.2.0 (2014-03-09)
177
- -------------------
204
+ ## v1.2.0 (2014-03-09)
205
+
178
206
  - Add `namespace` functionality for specifying attributes in a DSL
179
207
  - Add constraints helpers for comparing version strings
180
208
  - Add `require_chef_gem` to safely require and degrade if a gem is not installed
@@ -183,19 +211,19 @@ v1.2.0 (2014-03-09)
183
211
  - Add Stove for releasing
184
212
  - Updated copyrights for 2014
185
213
 
186
- v1.1.0 (2013-12-10)
187
- -------------------
214
+ ## v1.1.0 (2013-12-10)
215
+
188
216
  - Add `cloudstack?` helper
189
217
  - Add data bag helpers
190
218
  - Remove foodcritic checks
191
219
  - Upgrade development gem versions
192
220
  - Randomize spec order
193
221
 
194
- v1.0.1 (2013-10-15)
195
- -------------------
222
+ ## v1.0.1 (2013-10-15)
223
+
196
224
  - Add development recipe
197
225
  - Add `compile_time`, `before`, and `after` filters
198
226
 
199
- v1.0.0 (2013-10-15)
200
- -------------------
227
+ ## v1.0.0 (2013-10-15)
228
+
201
229
  - First public release
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.homepage = 'https://github.com/sethvargo/chef-sugar'
18
18
  spec.license = 'Apache 2.0'
19
19
 
20
- spec.required_ruby_version = '>= 1.9'
20
+ spec.required_ruby_version = '>= 2.1'
21
21
 
22
22
  spec.files = `git ls-files`.split($/)
23
23
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -30,6 +30,7 @@ class Chef
30
30
  require_relative 'sugar/init'
31
31
  require_relative 'sugar/ip'
32
32
  require_relative 'sugar/kernel'
33
+ require_relative 'sugar/kitchen'
33
34
  require_relative 'sugar/node'
34
35
  require_relative 'sugar/platform'
35
36
  require_relative 'sugar/platform_family'
@@ -25,7 +25,8 @@ class Chef
25
25
  # @return [Boolean]
26
26
  #
27
27
  def systemd?(node)
28
- IO.read('/proc/1/comm').chomp == 'systemd'
28
+ file = '/proc/1/comm'
29
+ File.exist?(file) && IO.read(file).chomp == 'systemd'
29
30
  end
30
31
 
31
32
  #
@@ -0,0 +1,40 @@
1
+ #
2
+ # Copyright 2013-2015, Seth Vargo <sethvargo@gmail.com>
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+
17
+ class Chef
18
+ module Sugar
19
+ module Kitchen
20
+ extend self
21
+
22
+ #
23
+ # Returns true if the current node is provisioned by Test Kitchen.
24
+ #
25
+ # @param [Chef::Node] node
26
+ # the node to check
27
+ #
28
+ # @return [Boolean]
29
+ #
30
+ def kitchen?(node)
31
+ !ENV['TEST_KITCHEN'].nil?
32
+ end
33
+ end
34
+
35
+ module DSL
36
+ # @see Chef::Sugar::Kitchen#kitchen?
37
+ def kitchen?; Chef::Sugar::Kitchen.kitchen?(node); end
38
+ end
39
+ end
40
+ end
@@ -40,6 +40,8 @@ class Chef
40
40
  'mountain_lion' => '10.8',
41
41
  'mavericks' => '10.9',
42
42
  'yosemite' => '10.10',
43
+ 'el_capitan' => '10.11',
44
+ 'sierra' => '10.12',
43
45
  },
44
46
  'solaris' => {
45
47
  '7' => '5.7',
@@ -16,6 +16,6 @@
16
16
 
17
17
  class Chef
18
18
  module Sugar
19
- VERSION = '3.4.0'
19
+ VERSION = '3.5.0'
20
20
  end
21
21
  end
@@ -22,13 +22,22 @@ describe Chef::Sugar::Init do
22
22
  .and_return("systemd")
23
23
 
24
24
  node = {}
25
- expect(described_class.systemd?(node)).to be true
25
+ expect(described_class.systemd?(node)).to be true
26
26
  end
27
27
 
28
28
  it 'is false when /proc/1/comm is not systemd' do
29
29
  node = {}
30
30
  expect(described_class.systemd?(node)).to be false
31
31
  end
32
+
33
+ it 'is false when /proc/1/comm does not exist' do
34
+ allow(File).to receive(:exist?)
35
+ .with("/proc/1/comm")
36
+ .and_return(false)
37
+
38
+ node = {}
39
+ expect(described_class.systemd?(node)).to be false
40
+ end
32
41
  end
33
42
 
34
43
  describe '#upstart?' do
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+
3
+ describe Chef::Sugar::Kitchen do
4
+ it_behaves_like 'a chef sugar'
5
+
6
+ describe '#kitchen?' do
7
+ it 'is true when the TEST_KITCHEN environment variable is set' do
8
+ allow(ENV).to receive(:[]).with('TEST_KITCHEN').and_return('1')
9
+ node = {}
10
+ expect(described_class.kitchen?(node)).to be true
11
+ end
12
+
13
+ it 'is false when the TEST_KITCHEN environment variable is unset' do
14
+ node = {}
15
+ expect(described_class.kitchen?(node)).to be false
16
+ end
17
+ end
18
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-sugar
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seth Vargo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-18 00:00:00.000000000 Z
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,6 +128,7 @@ files:
128
128
  - lib/chef/sugar/init.rb
129
129
  - lib/chef/sugar/ip.rb
130
130
  - lib/chef/sugar/kernel.rb
131
+ - lib/chef/sugar/kitchen.rb
131
132
  - lib/chef/sugar/node.rb
132
133
  - lib/chef/sugar/platform.rb
133
134
  - lib/chef/sugar/platform_family.rb
@@ -152,6 +153,7 @@ files:
152
153
  - spec/unit/chef/sugar/init_spec.rb
153
154
  - spec/unit/chef/sugar/ip_spec.rb
154
155
  - spec/unit/chef/sugar/kernel_spec.rb
156
+ - spec/unit/chef/sugar/kitchen_spec.rb
155
157
  - spec/unit/chef/sugar/node_spec.rb
156
158
  - spec/unit/chef/sugar/platform_family_spec.rb
157
159
  - spec/unit/chef/sugar/platform_spec.rb
@@ -173,7 +175,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
173
175
  requirements:
174
176
  - - ">="
175
177
  - !ruby/object:Gem::Version
176
- version: '1.9'
178
+ version: '2.1'
177
179
  required_rubygems_version: !ruby/object:Gem::Requirement
178
180
  requirements:
179
181
  - - ">="
@@ -181,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
183
  version: '0'
182
184
  requirements: []
183
185
  rubyforge_project:
184
- rubygems_version: 2.4.5.1
186
+ rubygems_version: 2.6.12
185
187
  signing_key:
186
188
  specification_version: 4
187
189
  summary: A collection of helper methods and modules that make working with Chef recipes
@@ -200,6 +202,7 @@ test_files:
200
202
  - spec/unit/chef/sugar/init_spec.rb
201
203
  - spec/unit/chef/sugar/ip_spec.rb
202
204
  - spec/unit/chef/sugar/kernel_spec.rb
205
+ - spec/unit/chef/sugar/kitchen_spec.rb
203
206
  - spec/unit/chef/sugar/node_spec.rb
204
207
  - spec/unit/chef/sugar/platform_family_spec.rb
205
208
  - spec/unit/chef/sugar/platform_spec.rb