chef 13.1.31-universal-mingw32 → 13.2.20-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +68 -134
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/acceptance/.shared/kitchen_acceptance/.kitchen.ec2.yml +1 -0
- data/acceptance/top-cookbooks/.kitchen.docker.yml +4 -0
- data/lib/chef/application/client.rb +27 -18
- data/lib/chef/deprecated.rb +10 -0
- data/lib/chef/dsl/declare_resource.rb +9 -1
- data/lib/chef/knife.rb +5 -1
- data/lib/chef/knife/cookbook_test.rb +1 -1
- data/lib/chef/policy_builder/policyfile.rb +27 -1
- data/lib/chef/provider.rb +2 -2
- data/lib/chef/provider/group/aix.rb +1 -1
- data/lib/chef/provider/group/groupadd.rb +1 -1
- data/lib/chef/provider/package/chocolatey.rb +1 -1
- data/lib/chef/provider/user/pw.rb +1 -1
- data/lib/chef/provider/user/windows.rb +1 -1
- data/lib/chef/resource/breakpoint.rb +1 -1
- data/lib/chef/version.rb +3 -1
- data/lib/chef/version_string.rb +143 -0
- data/spec/functional/mixin/powershell_out_spec.rb +20 -4
- data/spec/functional/resource/group_spec.rb +19 -13
- data/spec/functional/resource/windows_task_spec.rb +2 -9
- data/spec/integration/knife/common_options_spec.rb +29 -11
- data/spec/integration/knife/cookbook_bulk_delete_spec.rb +2 -2
- data/spec/integration/knife/cookbook_show_spec.rb +2 -2
- data/spec/integration/knife/environment_compare_spec.rb +2 -2
- data/spec/integration/knife/environment_show_spec.rb +2 -2
- data/spec/integration/knife/role_show_spec.rb +2 -2
- data/spec/integration/recipes/accumulator_spec.rb +6 -6
- data/spec/integration/recipes/resource_action_spec.rb +18 -7
- data/spec/integration/recipes/resource_load_spec.rb +5 -21
- data/spec/spec_helper.rb +2 -0
- data/spec/support/platform_helpers.rb +5 -0
- data/spec/support/shared/unit/provider/useradd_based_user_provider.rb +1 -1
- data/spec/unit/application/client_spec.rb +2 -0
- data/spec/unit/knife_spec.rb +22 -0
- data/spec/unit/policy_builder/policyfile_spec.rb +50 -0
- data/spec/unit/provider/group/groupadd_spec.rb +1 -1
- data/spec/unit/provider/user/pw_spec.rb +1 -1
- data/spec/unit/version_string_spec.rb +79 -0
- data/tasks/dependencies.rb +1 -42
- metadata +6 -5
- data/tasks/bundle.rb +0 -73
@@ -64,7 +64,7 @@ describe Chef::Provider::Group::Groupadd do
|
|
64
64
|
|
65
65
|
it "should combine all the possible options" do
|
66
66
|
match_array = []
|
67
|
-
field_list.
|
67
|
+
field_list.sort_by { |a| a[0] }.each do |attribute, option|
|
68
68
|
allow(new_resource).to receive(attribute).and_return("hola")
|
69
69
|
match_array << option
|
70
70
|
match_array << "hola"
|
@@ -69,7 +69,7 @@ describe Chef::Provider::User::Pw do
|
|
69
69
|
|
70
70
|
it "should combine all the possible options" do
|
71
71
|
match_array = [ "adam" ]
|
72
|
-
field_list.
|
72
|
+
field_list.sort_by { |a| a[0] }.each do |attribute, option|
|
73
73
|
allow(@new_resource).to receive(attribute).and_return("hola")
|
74
74
|
match_array << option
|
75
75
|
match_array << "hola"
|
@@ -0,0 +1,79 @@
|
|
1
|
+
# Copyright:: Copyright 2017, Noah Kantrowitz
|
2
|
+
# License:: Apache License, Version 2.0
|
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
|
+
require "spec_helper"
|
17
|
+
require "chef/version_string"
|
18
|
+
|
19
|
+
describe Chef::VersionString do
|
20
|
+
let(:input) { "1.2.3" }
|
21
|
+
subject(:described_object) { described_class.new(input) }
|
22
|
+
|
23
|
+
it { is_expected.to eq "1.2.3" }
|
24
|
+
it { is_expected.to eql "1.2.3" }
|
25
|
+
it { is_expected.to be == "1.2.3" }
|
26
|
+
it { is_expected.to be < "abc" }
|
27
|
+
it { is_expected.to be > "0" }
|
28
|
+
it { is_expected.to eq described_class.new("1.2.3") }
|
29
|
+
it { is_expected.to be == described_class.new("1.2.3") }
|
30
|
+
|
31
|
+
context "with !=" do
|
32
|
+
subject { described_object != "1.2.4" }
|
33
|
+
it { is_expected.to be true }
|
34
|
+
end
|
35
|
+
|
36
|
+
context "with +" do
|
37
|
+
subject { described_object + "asdf" }
|
38
|
+
it { is_expected.to eq "1.2.3asdf" }
|
39
|
+
end
|
40
|
+
|
41
|
+
context "with *" do
|
42
|
+
subject { described_object * 3 }
|
43
|
+
it { is_expected.to eq "1.2.31.2.31.2.3" }
|
44
|
+
end
|
45
|
+
|
46
|
+
context "with version-like comparisons" do
|
47
|
+
subject { described_class.new("1.02.3") }
|
48
|
+
|
49
|
+
it { is_expected.to eq "1.2.3" }
|
50
|
+
it { is_expected.to be > "1.2.2" }
|
51
|
+
it { is_expected.to be > "1.2.3a" }
|
52
|
+
it { is_expected.to be < "1.2.4" }
|
53
|
+
end
|
54
|
+
|
55
|
+
context "with =~ Regexp" do
|
56
|
+
subject { described_object =~ /^1/ }
|
57
|
+
it { is_expected.to eq 0 }
|
58
|
+
end
|
59
|
+
|
60
|
+
context "with =~ Requirement" do
|
61
|
+
subject { described_object =~ Gem::Requirement.create("~> 1.0") }
|
62
|
+
it { is_expected.to be true }
|
63
|
+
end
|
64
|
+
|
65
|
+
context "with =~ String" do
|
66
|
+
subject { described_object =~ "~> 1.0" }
|
67
|
+
it { is_expected.to be true }
|
68
|
+
end
|
69
|
+
|
70
|
+
context "with Regexp =~" do
|
71
|
+
subject { /^2/ =~ described_object }
|
72
|
+
it { is_expected.to be nil }
|
73
|
+
end
|
74
|
+
|
75
|
+
context "with String =~" do
|
76
|
+
subject { "~> 1.0" =~ described_object }
|
77
|
+
it { expect { subject }.to raise_error TypeError }
|
78
|
+
end
|
79
|
+
end
|
data/tasks/dependencies.rb
CHANGED
@@ -15,9 +15,6 @@
|
|
15
15
|
# limitations under the License.
|
16
16
|
#
|
17
17
|
|
18
|
-
require_relative "bundle"
|
19
|
-
require_relative "../version_policy"
|
20
|
-
|
21
18
|
desc "Tasks to update and check dependencies"
|
22
19
|
namespace :dependencies do
|
23
20
|
|
@@ -93,47 +90,9 @@ namespace :dependencies do
|
|
93
90
|
berks_update_task :update_kitchen_tests_berksfile_lock, "kitchen-tests"
|
94
91
|
berks_update_task :update_audit_tests_berksfile_lock, "kitchen-tests/cookbooks/audit_test"
|
95
92
|
|
96
|
-
desc "Update omnibus overrides, including versions in version_policy.rb and latest version of gems: #{OMNIBUS_RUBYGEMS_AT_LATEST_VERSION.keys}."
|
97
|
-
task :update_omnibus_overrides do |t, rake_args|
|
98
|
-
puts ""
|
99
|
-
puts "-------------------------------------------------------------------"
|
100
|
-
puts "Updating omnibus_overrides.rb ..."
|
101
|
-
puts "-------------------------------------------------------------------"
|
102
|
-
|
103
|
-
# Generate the new overrides file
|
104
|
-
overrides = "# DO NOT EDIT. Generated by \"rake dependencies\". Edit version_policy.rb instead.\n"
|
105
|
-
|
106
|
-
# Replace the bundler and rubygems versions
|
107
|
-
OMNIBUS_RUBYGEMS_AT_LATEST_VERSION.each do |override_name, gem_name|
|
108
|
-
# Get the latest bundler version
|
109
|
-
puts "Running gem list -r #{gem_name} ..."
|
110
|
-
gem_list = `gem list -r #{gem_name}`
|
111
|
-
unless gem_list =~ /^#{gem_name}\s*\(([^)]*)\)$/
|
112
|
-
raise "gem list -r #{gem_name} failed with output:\n#{gem_list}"
|
113
|
-
end
|
114
|
-
|
115
|
-
# Emit it
|
116
|
-
puts "Latest version of #{gem_name} is #{$1}"
|
117
|
-
overrides << "override #{override_name.inspect}, version: #{$1.inspect}\n"
|
118
|
-
end
|
119
|
-
|
120
|
-
# Add explicit overrides
|
121
|
-
OMNIBUS_OVERRIDES.each do |override_name, version|
|
122
|
-
overrides << "override #{override_name.inspect}, version: #{version.inspect}\n"
|
123
|
-
end
|
124
|
-
|
125
|
-
# Write the file out (if changed)
|
126
|
-
overrides_path = File.expand_path("../../omnibus_overrides.rb", __FILE__)
|
127
|
-
if overrides != IO.read(overrides_path)
|
128
|
-
puts "Overrides changed!"
|
129
|
-
puts `git diff #{overrides_path}`
|
130
|
-
puts "Writing modified #{overrides_path} ..."
|
131
|
-
IO.write(overrides_path, overrides)
|
132
|
-
end
|
133
|
-
end
|
134
93
|
end
|
135
94
|
|
136
95
|
desc "Update all dependencies and check for outdated gems."
|
137
|
-
task :dependencies_ci => [ "dependencies:update_ci"
|
96
|
+
task :dependencies_ci => [ "dependencies:update_ci" ]
|
138
97
|
task :dependencies => [ "dependencies:update" ]
|
139
98
|
task :update => [ "dependencies:update" ]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.
|
4
|
+
version: 13.2.20
|
5
5
|
platform: universal-mingw32
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chef-config
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 13.
|
19
|
+
version: 13.2.20
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 13.
|
26
|
+
version: 13.2.20
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1715,6 +1715,7 @@ files:
|
|
1715
1715
|
- lib/chef/version_class.rb
|
1716
1716
|
- lib/chef/version_constraint.rb
|
1717
1717
|
- lib/chef/version_constraint/platform.rb
|
1718
|
+
- lib/chef/version_string.rb
|
1718
1719
|
- lib/chef/whitelist.rb
|
1719
1720
|
- lib/chef/win32/api.rb
|
1720
1721
|
- lib/chef/win32/api/crypto.rb
|
@@ -2825,13 +2826,13 @@ files:
|
|
2825
2826
|
- spec/unit/version_class_spec.rb
|
2826
2827
|
- spec/unit/version_constraint/platform_spec.rb
|
2827
2828
|
- spec/unit/version_constraint_spec.rb
|
2829
|
+
- spec/unit/version_string_spec.rb
|
2828
2830
|
- spec/unit/win32/error_spec.rb
|
2829
2831
|
- spec/unit/win32/registry_spec.rb
|
2830
2832
|
- spec/unit/win32/security_spec.rb
|
2831
2833
|
- spec/unit/windows_service_spec.rb
|
2832
2834
|
- tasks/announce.rb
|
2833
2835
|
- tasks/bin/run_external_test
|
2834
|
-
- tasks/bundle.rb
|
2835
2836
|
- tasks/cbgb.rb
|
2836
2837
|
- tasks/changelog.rb
|
2837
2838
|
- tasks/dependencies.rb
|
data/tasks/bundle.rb
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright:: Copyright (c) 2016-2017, Chef Software Inc.
|
3
|
-
# License:: Apache License, Version 2.0
|
4
|
-
#
|
5
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
# you may not use this file except in compliance with the License.
|
7
|
-
# You may obtain a copy of the License at
|
8
|
-
#
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
#
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
# See the License for the specific language governing permissions and
|
15
|
-
# limitations under the License.
|
16
|
-
#
|
17
|
-
|
18
|
-
require_relative "../version_policy"
|
19
|
-
require "fileutils"
|
20
|
-
|
21
|
-
desc "Tasks to work with the main Gemfile and Gemfile.<platform>"
|
22
|
-
namespace :bundle do
|
23
|
-
desc "Update Gemfile.lock and all Gemfile.<platform>.locks (or one or more gems via bundle:update gem1 gem2 ...)."
|
24
|
-
task :update, [:args] do |t, rake_args|
|
25
|
-
args = rake_args[:args] || ""
|
26
|
-
Bundler.with_clean_env do
|
27
|
-
sh "bundle update #{args}"
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
desc "Conservatively update Gemfile.lock and all Gemfile.<platform>.locks"
|
32
|
-
task :install, [:args] do |t, rake_args|
|
33
|
-
args = rake_args[:args] || ""
|
34
|
-
args = rake_args[:args] || ""
|
35
|
-
Bundler.with_clean_env do
|
36
|
-
sh "bundle install #{args}"
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def parse_bundle_outdated(bundle_outdated_output)
|
41
|
-
result = []
|
42
|
-
bundle_outdated_output.each_line do |line|
|
43
|
-
if line =~ /^\s*\* (.+) \(newest ([^,]+), installed ([^,)])*/
|
44
|
-
gem_name, newest_version, installed_version = $1, $2, $3
|
45
|
-
result << [ line, gem_name ]
|
46
|
-
end
|
47
|
-
end
|
48
|
-
result
|
49
|
-
end
|
50
|
-
|
51
|
-
# Find out if we're using the latest gems we can (so we don't regress versions)
|
52
|
-
desc "Check for gems that are not at the latest released version, and report if anything not in ACCEPTABLE_OUTDATED_GEMS (version_policy.rb) is out of date."
|
53
|
-
task :outdated do
|
54
|
-
bundle_outdated = ""
|
55
|
-
Bundler.with_clean_env do
|
56
|
-
bundle_outdated = `bundle outdated`
|
57
|
-
puts bundle_outdated
|
58
|
-
end
|
59
|
-
outdated_gems = parse_bundle_outdated(bundle_outdated).map { |line, gem_name| gem_name }
|
60
|
-
outdated_gems = outdated_gems.reject { |gem_name| ACCEPTABLE_OUTDATED_GEMS.include?(gem_name) }
|
61
|
-
unless outdated_gems.empty?
|
62
|
-
raise "ERROR: outdated gems: #{outdated_gems.join(", ")}. Either fix them or add them to ACCEPTABLE_OUTDATED_GEMS in #{__FILE__}."
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
desc "Run bundle with arbitrary args"
|
68
|
-
task :bundle, [:args] do |t, rake_args|
|
69
|
-
args = rake_args[:args] || ""
|
70
|
-
Bundler.with_clean_env do
|
71
|
-
sh "bundle #{args}"
|
72
|
-
end
|
73
|
-
end
|