chef 13.2.20 → 13.3.42
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +2 -8
- data/README.md +6 -2
- data/Rakefile +0 -11
- data/VERSION +1 -1
- data/acceptance/Gemfile.lock +1 -1
- data/acceptance/data-collector/.acceptance/data-collector-test/files/default/api.rb +34 -18
- data/acceptance/data-collector/.acceptance/data-collector-test/recipes/default.rb +6 -0
- data/lib/chef/cookbook/metadata.rb +2 -2
- data/lib/chef/deprecation/warnings.rb +3 -1
- data/lib/chef/exceptions.rb +1 -1
- data/lib/chef/http.rb +9 -10
- data/lib/chef/http/api_versions.rb +2 -0
- data/lib/chef/http/http_request.rb +3 -0
- data/lib/chef/knife/core/bootstrap_context.rb +1 -0
- data/lib/chef/knife/core/status_presenter.rb +1 -1
- data/lib/chef/knife/ssh.rb +4 -0
- data/lib/chef/provider/apt_preference.rb +99 -0
- data/lib/chef/provider/execute.rb +3 -2
- data/lib/chef/provider/http_request.rb +14 -0
- data/lib/chef/provider/mount/aix.rb +49 -8
- data/lib/chef/provider/package/windows/registry_uninstall_entry.rb +1 -1
- data/lib/chef/provider/package/zypper.rb +5 -5
- data/lib/chef/provider/service/systemd.rb +12 -11
- data/lib/chef/provider/support/zypper_repo.erb +17 -0
- data/lib/chef/provider/systemd_unit.rb +3 -2
- data/lib/chef/provider/windows_task.rb +92 -71
- data/lib/chef/provider/zypper_repository.rb +81 -0
- data/lib/chef/providers.rb +2 -0
- data/lib/chef/resource/apt_preference.rb +36 -0
- data/lib/chef/resource/execute.rb +12 -2
- data/lib/chef/resource/http_request.rb +1 -1
- data/lib/chef/resource/zypper_repository.rb +51 -0
- data/lib/chef/resources.rb +2 -0
- data/lib/chef/search/query.rb +6 -1
- data/lib/chef/server_api_versions.rb +21 -2
- data/lib/chef/version.rb +3 -4
- data/lib/chef/win32/api/file.rb +1 -0
- data/lib/chef/win32/file.rb +2 -0
- data/lib/chef/win32/version.rb +6 -0
- data/spec/functional/knife/ssh_spec.rb +1 -1
- data/spec/functional/resource/execute_spec.rb +2 -2
- data/spec/spec_helper.rb +8 -1
- data/spec/unit/cookbook/metadata_spec.rb +3 -3
- data/spec/unit/http/api_versions_spec.rb +6 -3
- data/spec/unit/knife/bootstrap_spec.rb +4 -0
- data/spec/unit/knife/cookbook_show_spec.rb +3 -3
- data/spec/unit/knife/ssh_spec.rb +7 -1
- data/spec/unit/knife/status_spec.rb +2 -0
- data/spec/unit/provider/apt_preference_spec.rb +87 -0
- data/spec/unit/provider/apt_update_spec.rb +7 -7
- data/spec/unit/provider/dsc_resource_spec.rb +2 -2
- data/spec/unit/provider/execute_spec.rb +32 -14
- data/spec/unit/provider/mount/aix_spec.rb +33 -1
- data/spec/unit/provider/package/rubygems_spec.rb +1 -1
- data/spec/unit/provider/package/windows/registry_uninstall_entry_spec.rb +56 -3
- data/spec/unit/provider/package/windows_spec.rb +1 -1
- data/spec/unit/provider/package/zypper_spec.rb +43 -0
- data/spec/unit/provider/script_spec.rb +1 -1
- data/spec/unit/provider/service/systemd_service_spec.rb +23 -21
- data/spec/unit/provider/systemd_unit_spec.rb +42 -41
- data/spec/unit/provider/windows_task_spec.rb +40 -0
- data/spec/unit/resource/apt_preference_spec.rb +41 -0
- data/spec/unit/resource/execute_spec.rb +21 -1
- data/spec/unit/resource/powershell_script_spec.rb +2 -2
- data/spec/unit/resource/zypper_repository_spec.rb +65 -0
- data/spec/unit/search/query_spec.rb +13 -18
- data/spec/unit/server_api_spec.rb +75 -1
- data/spec/unit/server_api_versions_spec.rb +22 -0
- data/spec/unit/win32/link_spec.rb +73 -0
- data/tasks/dependencies.rb +0 -1
- metadata +13 -6
- data/tasks/changelog.rb +0 -37
- data/tasks/version.rb +0 -41
@@ -0,0 +1,73 @@
|
|
1
|
+
#
|
2
|
+
# Copyright:: Copyright 2012-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 "spec_helper"
|
19
|
+
if Chef::Platform.windows?
|
20
|
+
require "chef/win32/api/file"
|
21
|
+
require "chef/win32/file"
|
22
|
+
require "chef/win32/version"
|
23
|
+
end
|
24
|
+
|
25
|
+
describe Chef::ReservedNames::Win32::File, :windows_only do
|
26
|
+
context "#symlink" do
|
27
|
+
let(:with_privilege) { Chef::ReservedNames::Win32::API::File::SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE }
|
28
|
+
let(:without_privilege) { 0x0 }
|
29
|
+
|
30
|
+
context "an invalid parameter is passed" do
|
31
|
+
it "will throw an exception if an invalid parameter is passed" do
|
32
|
+
allow(File).to receive(:directory?).and_return(false)
|
33
|
+
allow(Chef::ReservedNames::Win32::File).to receive(:encode_path) { |a| a }
|
34
|
+
allow_any_instance_of(Chef::ReservedNames::Win32::Version).to receive(:windows_10?).and_return(true)
|
35
|
+
allow_any_instance_of(Chef::ReservedNames::Win32::Version).to receive(:build_number).and_return(1)
|
36
|
+
allow(Chef::ReservedNames::Win32::File).to receive(:CreateSymbolicLinkW).and_return(nil)
|
37
|
+
|
38
|
+
expect { Chef::ReservedNames::Win32::File.symlink("a", "b") }.to raise_error Chef::Exceptions::Win32APIError
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context "a valid parameter is passed" do
|
43
|
+
before(:each) do
|
44
|
+
allow(File).to receive(:directory?).and_return(false)
|
45
|
+
allow(Chef::ReservedNames::Win32::File).to receive(:encode_path) { |a| a }
|
46
|
+
allow(Chef::ReservedNames::Win32::File).to receive(:CreateSymbolicLinkW).with(any_args) { "don't //actually// do this" }
|
47
|
+
end
|
48
|
+
|
49
|
+
it "will not pass the unpirivileged symlink flag if the node is not Windows 10" do
|
50
|
+
allow_any_instance_of(Chef::ReservedNames::Win32::Version).to receive(:windows_10?).and_return(false)
|
51
|
+
|
52
|
+
expect(Chef::ReservedNames::Win32::File).to receive(:CreateSymbolicLinkW).with("b", "a", without_privilege)
|
53
|
+
described_class.symlink("a", "b")
|
54
|
+
end
|
55
|
+
|
56
|
+
it "will not pass the unpirivileged symlink flag if the node is not at least Windows 10 Creators Update" do
|
57
|
+
allow_any_instance_of(Chef::ReservedNames::Win32::Version).to receive(:windows_10?).and_return(true)
|
58
|
+
allow_any_instance_of(Chef::ReservedNames::Win32::Version).to receive(:build_number).and_return(1)
|
59
|
+
|
60
|
+
expect(Chef::ReservedNames::Win32::File).to receive(:CreateSymbolicLinkW).with("b", "a", without_privilege)
|
61
|
+
described_class.symlink("a", "b")
|
62
|
+
end
|
63
|
+
|
64
|
+
it "will pass the unpirivileged symlink flag if the node is Windows 10 Creators Update or higher" do
|
65
|
+
allow_any_instance_of(Chef::ReservedNames::Win32::Version).to receive(:windows_10?).and_return(true)
|
66
|
+
allow_any_instance_of(Chef::ReservedNames::Win32::Version).to receive(:build_number).and_return(15063)
|
67
|
+
|
68
|
+
expect(Chef::ReservedNames::Win32::File).to receive(:CreateSymbolicLinkW).with("b", "a", with_privilege)
|
69
|
+
described_class.symlink("a", "b")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
data/tasks/dependencies.rb
CHANGED
@@ -37,7 +37,6 @@ namespace :dependencies do
|
|
37
37
|
desc "Update all dependencies. dependencies:update to update as little as possible (CI-only)."
|
38
38
|
task :update_ci => %w{
|
39
39
|
dependencies:update_gemfile_lock
|
40
|
-
dependencies:update_omnibus_overrides
|
41
40
|
dependencies:update_omnibus_gemfile_lock
|
42
41
|
dependencies:update_acceptance_gemfile_lock
|
43
42
|
dependencies:update_kitchen_tests_gemfile_lock
|
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.3.42
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Jacob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-11 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.3.42
|
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.3.42
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mixlib-cli
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -1187,6 +1187,7 @@ files:
|
|
1187
1187
|
- lib/chef/policy_builder/policyfile.rb
|
1188
1188
|
- lib/chef/property.rb
|
1189
1189
|
- lib/chef/provider.rb
|
1190
|
+
- lib/chef/provider/apt_preference.rb
|
1190
1191
|
- lib/chef/provider/apt_repository.rb
|
1191
1192
|
- lib/chef/provider/apt_update.rb
|
1192
1193
|
- lib/chef/provider/batch.rb
|
@@ -1310,6 +1311,7 @@ files:
|
|
1310
1311
|
- lib/chef/provider/service/windows.rb
|
1311
1312
|
- lib/chef/provider/subversion.rb
|
1312
1313
|
- lib/chef/provider/support/yum_repo.erb
|
1314
|
+
- lib/chef/provider/support/zypper_repo.erb
|
1313
1315
|
- lib/chef/provider/systemd_unit.rb
|
1314
1316
|
- lib/chef/provider/template.rb
|
1315
1317
|
- lib/chef/provider/template/content.rb
|
@@ -1326,6 +1328,7 @@ files:
|
|
1326
1328
|
- lib/chef/provider/windows_script.rb
|
1327
1329
|
- lib/chef/provider/windows_task.rb
|
1328
1330
|
- lib/chef/provider/yum_repository.rb
|
1331
|
+
- lib/chef/provider/zypper_repository.rb
|
1329
1332
|
- lib/chef/provider_resolver.rb
|
1330
1333
|
- lib/chef/providers.rb
|
1331
1334
|
- lib/chef/recipe.rb
|
@@ -1334,6 +1337,7 @@ files:
|
|
1334
1337
|
- lib/chef/resource.rb
|
1335
1338
|
- lib/chef/resource/action_class.rb
|
1336
1339
|
- lib/chef/resource/apt_package.rb
|
1340
|
+
- lib/chef/resource/apt_preference.rb
|
1337
1341
|
- lib/chef/resource/apt_repository.rb
|
1338
1342
|
- lib/chef/resource/apt_update.rb
|
1339
1343
|
- lib/chef/resource/bash.rb
|
@@ -1423,6 +1427,7 @@ files:
|
|
1423
1427
|
- lib/chef/resource/yum_package.rb
|
1424
1428
|
- lib/chef/resource/yum_repository.rb
|
1425
1429
|
- lib/chef/resource/zypper_package.rb
|
1430
|
+
- lib/chef/resource/zypper_repository.rb
|
1426
1431
|
- lib/chef/resource_builder.rb
|
1427
1432
|
- lib/chef/resource_collection.rb
|
1428
1433
|
- lib/chef/resource_collection/resource_collection_serialization.rb
|
@@ -2344,6 +2349,7 @@ files:
|
|
2344
2349
|
- spec/unit/property/state_spec.rb
|
2345
2350
|
- spec/unit/property/validation_spec.rb
|
2346
2351
|
- spec/unit/property_spec.rb
|
2352
|
+
- spec/unit/provider/apt_preference_spec.rb
|
2347
2353
|
- spec/unit/provider/apt_repository_spec.rb
|
2348
2354
|
- spec/unit/provider/apt_update_spec.rb
|
2349
2355
|
- spec/unit/provider/cookbook_file/content_spec.rb
|
@@ -2470,6 +2476,7 @@ files:
|
|
2470
2476
|
- spec/unit/pure_application_spec.rb
|
2471
2477
|
- spec/unit/recipe_spec.rb
|
2472
2478
|
- spec/unit/resource/apt_package_spec.rb
|
2479
|
+
- spec/unit/resource/apt_preference_spec.rb
|
2473
2480
|
- spec/unit/resource/apt_repository_spec.rb
|
2474
2481
|
- spec/unit/resource/apt_update_spec.rb
|
2475
2482
|
- spec/unit/resource/bash_spec.rb
|
@@ -2545,6 +2552,7 @@ files:
|
|
2545
2552
|
- spec/unit/resource/windows_task_spec.rb
|
2546
2553
|
- spec/unit/resource/yum_package_spec.rb
|
2547
2554
|
- spec/unit/resource/yum_repository_spec.rb
|
2555
|
+
- spec/unit/resource/zypper_repository_spec.rb
|
2548
2556
|
- spec/unit/resource_builder_spec.rb
|
2549
2557
|
- spec/unit/resource_collection/resource_list_spec.rb
|
2550
2558
|
- spec/unit/resource_collection/resource_set_spec.rb
|
@@ -2593,19 +2601,18 @@ files:
|
|
2593
2601
|
- spec/unit/version_constraint_spec.rb
|
2594
2602
|
- spec/unit/version_string_spec.rb
|
2595
2603
|
- spec/unit/win32/error_spec.rb
|
2604
|
+
- spec/unit/win32/link_spec.rb
|
2596
2605
|
- spec/unit/win32/registry_spec.rb
|
2597
2606
|
- spec/unit/win32/security_spec.rb
|
2598
2607
|
- spec/unit/windows_service_spec.rb
|
2599
2608
|
- tasks/announce.rb
|
2600
2609
|
- tasks/bin/run_external_test
|
2601
2610
|
- tasks/cbgb.rb
|
2602
|
-
- tasks/changelog.rb
|
2603
2611
|
- tasks/dependencies.rb
|
2604
2612
|
- tasks/maintainers.rb
|
2605
2613
|
- tasks/rspec.rb
|
2606
2614
|
- tasks/templates/prerelease.md.erb
|
2607
2615
|
- tasks/templates/release.md.erb
|
2608
|
-
- tasks/version.rb
|
2609
2616
|
homepage: https://www.chef.io
|
2610
2617
|
licenses:
|
2611
2618
|
- Apache-2.0
|
data/tasks/changelog.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require "github_changelog_generator/task"
|
3
|
-
require "mixlib/install"
|
4
|
-
|
5
|
-
namespace :changelog do
|
6
|
-
# Fetch the latest version from mixlib-install
|
7
|
-
def latest_stable_version
|
8
|
-
# for 13.1, a 12.20 release was made after 13.0, which is busting the changelog generator. Reset this post 13.1 release
|
9
|
-
"13.0.118"
|
10
|
-
# Mixlib::Install.available_versions("chef", "stable").last
|
11
|
-
end
|
12
|
-
|
13
|
-
# Take the changelog from the latest stable release and put it into history.
|
14
|
-
task :archive do
|
15
|
-
changelog = Net::HTTP.get(URI("https://raw.githubusercontent.com/chef/chef/v#{latest_stable_version}/CHANGELOG.md")).chomp.split("\n")
|
16
|
-
File.open("HISTORY.md", "w+") { |f| f.write(changelog[2..-4].join("\n")) }
|
17
|
-
end
|
18
|
-
|
19
|
-
# Run this to just update the changelog for the current release. This will
|
20
|
-
# take what is in HISTORY and generate a changelog of PRs between the most
|
21
|
-
# recent stable version and HEAD.
|
22
|
-
GitHubChangelogGenerator::RakeTask.new :update do |config|
|
23
|
-
config.future_release = "v#{Chef::VERSION}"
|
24
|
-
config.between_tags = ["v#{latest_stable_version}", "v#{Chef::VERSION}"]
|
25
|
-
config.max_issues = 0
|
26
|
-
config.add_issues_wo_labels = false
|
27
|
-
config.enhancement_labels = "enhancement,Enhancement,New Feature,Feature".split(",")
|
28
|
-
config.bug_labels = "bug,Bug,Improvement,Upstream Bug".split(",")
|
29
|
-
config.exclude_labels = "duplicate,question,invalid,wontfix,no_changelog,Exclude From Changelog,Question,Discussion,Meta: Exclude From Changelog".split(",")
|
30
|
-
config.header = "This changelog reflects the current state of chef's master branch on github and may not reflect the current released version of chef, which is [![Gem Version](https://badge.fury.io/rb/chef.svg)](https://badge.fury.io/rb/chef)."
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
task :changelog => "changelog:update"
|
35
|
-
rescue LoadError
|
36
|
-
puts "github_changelog_generator is not available. gem install github_changelog_generator to generate changelogs"
|
37
|
-
end
|
data/tasks/version.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Copyright:: Copyright 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
|
-
task :ci_version_bump do
|
19
|
-
begin
|
20
|
-
require "rake"
|
21
|
-
|
22
|
-
Rake::Task["version:bump_patch"].invoke
|
23
|
-
Rake::Task["version:update"].invoke
|
24
|
-
|
25
|
-
# We want to log errors that occur in the following tasks, but we don't
|
26
|
-
# want them to stop an otherwise valid version bump from progressing.
|
27
|
-
begin
|
28
|
-
Rake::Task["changelog:update"].invoke
|
29
|
-
rescue Exception => e
|
30
|
-
puts "There was an error updating the CHANGELOG"
|
31
|
-
puts e
|
32
|
-
end
|
33
|
-
|
34
|
-
begin
|
35
|
-
Rake::Task["update_dockerfile"].invoke
|
36
|
-
rescue Exception => e
|
37
|
-
puts "There was an error updating the Dockerfile"
|
38
|
-
puts e
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|