chef 12.16.42 → 12.17.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -1
  3. data/README.md +20 -5
  4. data/Rakefile +17 -0
  5. data/VERSION +1 -1
  6. data/acceptance/Gemfile.lock +32 -23
  7. data/distro/common/markdown/man1/knife-configure.mkd +3 -2
  8. data/lib-backcompat/chef/chef_fs/file_system/already_exists_error.rb +1 -1
  9. data/lib-backcompat/chef/chef_fs/file_system/cookbook_frozen_error.rb +1 -1
  10. data/lib-backcompat/chef/chef_fs/file_system/default_environment_cannot_be_modified_error.rb +1 -1
  11. data/lib-backcompat/chef/chef_fs/file_system/file_system_error.rb +1 -1
  12. data/lib-backcompat/chef/chef_fs/file_system/must_delete_recursively_error.rb +1 -1
  13. data/lib-backcompat/chef/chef_fs/file_system/not_found_error.rb +1 -1
  14. data/lib-backcompat/chef/chef_fs/file_system/operation_failed_error.rb +1 -1
  15. data/lib-backcompat/chef/chef_fs/file_system/operation_not_allowed_error.rb +1 -1
  16. data/lib-backcompat/chef/chef_fs/file_system/repository/chef_repository_file_system_entry.rb +1 -1
  17. data/lib-backcompat/chef/chef_fs/file_system/repository/file_system_root_dir.rb +1 -1
  18. data/lib/chef/api_client.rb +1 -1
  19. data/lib/chef/application.rb +1 -1
  20. data/lib/chef/application/exit_code.rb +3 -3
  21. data/lib/chef/chef_class.rb +15 -5
  22. data/lib/chef/chef_fs/file_system/repository/chef_repository_file_system_root_dir.rb +12 -1
  23. data/lib/chef/chef_fs/file_system/repository/nodes_dir.rb +19 -0
  24. data/lib/chef/client.rb +1 -0
  25. data/lib/chef/cookbook/metadata.rb +2 -2
  26. data/lib/chef/cookbook_version.rb +4 -4
  27. data/lib/chef/data_bag.rb +1 -1
  28. data/lib/chef/data_bag_item.rb +1 -1
  29. data/lib/chef/data_collector.rb +20 -13
  30. data/lib/chef/data_collector/messages.rb +0 -1
  31. data/lib/chef/data_collector/messages/helpers.rb +2 -2
  32. data/lib/chef/decorator/unchain.rb +2 -2
  33. data/lib/chef/deprecated.rb +190 -0
  34. data/lib/chef/deprecation/provider/remote_directory.rb +1 -1
  35. data/lib/chef/deprecation/warnings.rb +3 -4
  36. data/lib/chef/dsl/method_missing.rb +2 -2
  37. data/lib/chef/dsl/resources.rb +2 -2
  38. data/lib/chef/environment.rb +1 -1
  39. data/lib/chef/exceptions.rb +1 -1
  40. data/lib/chef/formatters/base.rb +11 -1
  41. data/lib/chef/formatters/doc.rb +13 -4
  42. data/lib/chef/key.rb +1 -1
  43. data/lib/chef/knife/client_delete.rb +12 -9
  44. data/lib/chef/knife/configure.rb +1 -1
  45. data/lib/chef/knife/core/bootstrap_context.rb +25 -1
  46. data/lib/chef/knife/core/subcommand_loader.rb +3 -3
  47. data/lib/chef/knife/core/ui.rb +1 -1
  48. data/lib/chef/knife/node_delete.rb +6 -6
  49. data/lib/chef/log.rb +1 -1
  50. data/lib/chef/mixin/deprecation.rb +4 -10
  51. data/lib/chef/mixin/powershell_type_coercions.rb +19 -19
  52. data/lib/chef/mixin/shell_out.rb +1 -1
  53. data/lib/chef/node.rb +2 -2
  54. data/lib/chef/node/attribute.rb +3 -4
  55. data/lib/chef/node/common_api.rb +1 -1
  56. data/lib/chef/node/mixin/state_tracking.rb +5 -2
  57. data/lib/chef/node_map.rb +2 -2
  58. data/lib/chef/org.rb +1 -1
  59. data/lib/chef/platform/rebooter.rb +3 -1
  60. data/lib/chef/policy_builder/expand_node_object.rb +1 -1
  61. data/lib/chef/property.rb +5 -5
  62. data/lib/chef/provider.rb +4 -4
  63. data/lib/chef/provider/launchd.rb +1 -1
  64. data/lib/chef/provider/link.rb +6 -0
  65. data/lib/chef/provider/mount.rb +2 -0
  66. data/lib/chef/provider/mount/mount.rb +1 -1
  67. data/lib/chef/provider/ohai.rb +5 -3
  68. data/lib/chef/provider/package/cab.rb +1 -1
  69. data/lib/chef/provider/package/chocolatey.rb +2 -2
  70. data/lib/chef/provider/package/easy_install.rb +2 -2
  71. data/lib/chef/provider/package/msu.rb +162 -0
  72. data/lib/chef/provider/package/powershell.rb +114 -0
  73. data/lib/chef/provider/package/yum.rb +1 -1
  74. data/lib/chef/provider/yum_repository.rb +6 -7
  75. data/lib/chef/provider_resolver.rb +2 -2
  76. data/lib/chef/providers.rb +2 -0
  77. data/lib/chef/resource.rb +3 -5
  78. data/lib/chef/resource/apt_update.rb +1 -1
  79. data/lib/chef/resource/chef_gem.rb +2 -3
  80. data/lib/chef/resource/file/verification.rb +1 -1
  81. data/lib/chef/resource/launchd.rb +48 -8
  82. data/lib/chef/resource/mount.rb +1 -1
  83. data/lib/chef/resource/msu_package.rb +47 -0
  84. data/lib/chef/resource/ohai.rb +5 -25
  85. data/lib/chef/resource/powershell_package.rb +41 -0
  86. data/lib/chef/resource/reboot.rb +1 -1
  87. data/lib/chef/resource/user.rb +2 -2
  88. data/lib/chef/resource_builder.rb +4 -4
  89. data/lib/chef/resource_resolver.rb +2 -3
  90. data/lib/chef/resources.rb +2 -0
  91. data/lib/chef/rest.rb +1 -1
  92. data/lib/chef/role.rb +1 -1
  93. data/lib/chef/run_context.rb +3 -3
  94. data/lib/chef/shell/ext.rb +2 -2
  95. data/lib/chef/user.rb +3 -3
  96. data/lib/chef/user_v1.rb +1 -1
  97. data/lib/chef/version.rb +1 -1
  98. data/lib/chef/win32/api/security.rb +12 -12
  99. data/spec/data/sample_msu1.xml +10 -0
  100. data/spec/data/sample_msu2.xml +14 -0
  101. data/spec/data/sample_msu3.xml +16 -0
  102. data/spec/functional/rebooter_spec.rb +3 -3
  103. data/spec/functional/resource/link_spec.rb +62 -1
  104. data/spec/functional/resource/msu_package_spec.rb +84 -0
  105. data/spec/functional/resource/registry_spec.rb +3 -3
  106. data/spec/functional/resource/rpm_spec.rb +7 -10
  107. data/spec/integration/solo/solo_spec.rb +50 -0
  108. data/spec/spec_helper.rb +3 -0
  109. data/spec/support/platform_helpers.rb +16 -8
  110. data/spec/unit/application/exit_code_spec.rb +3 -15
  111. data/spec/unit/data_collector_spec.rb +6 -16
  112. data/spec/unit/deprecated_spec.rb +59 -0
  113. data/spec/unit/deprecation_spec.rb +1 -8
  114. data/spec/unit/handler_spec.rb +2 -2
  115. data/spec/unit/knife/client_delete_spec.rb +16 -0
  116. data/spec/unit/knife/configure_spec.rb +1 -1
  117. data/spec/unit/knife/cookbook_metadata_spec.rb +116 -113
  118. data/spec/unit/knife/core/bootstrap_context_spec.rb +55 -5
  119. data/spec/unit/knife/node_delete_spec.rb +19 -10
  120. data/spec/unit/mixin/shell_out_spec.rb +0 -1
  121. data/spec/unit/node/immutable_collections_spec.rb +5 -0
  122. data/spec/unit/node/vivid_mash_spec.rb +11 -0
  123. data/spec/unit/node_spec.rb +2 -2
  124. data/spec/unit/provider/launchd_spec.rb +81 -3
  125. data/spec/unit/provider/mount/mount_spec.rb +1 -1
  126. data/spec/unit/provider/mount_spec.rb +7 -0
  127. data/spec/unit/provider/package/chocolatey_spec.rb +5 -5
  128. data/spec/unit/provider/package/easy_install_spec.rb +6 -6
  129. data/spec/unit/provider/package/msu_spec.rb +283 -0
  130. data/spec/unit/provider/package/powershell_spec.rb +337 -0
  131. data/spec/unit/provider/service/macosx_spec.rb +1 -1
  132. data/spec/unit/provider/subversion_spec.rb +9 -0
  133. data/spec/unit/provider/user/linux_spec.rb +7 -1
  134. data/spec/unit/recipe_spec.rb +43 -11
  135. data/spec/unit/resource/apt_update_spec.rb +17 -25
  136. data/spec/unit/resource/file/verification_spec.rb +1 -1
  137. data/spec/unit/resource/mount_spec.rb +2 -1
  138. data/spec/unit/resource/msu_package_spec.rb +49 -0
  139. data/spec/unit/resource/ohai_spec.rb +1 -1
  140. data/spec/unit/resource/powershell_package_spec.rb +68 -0
  141. data/spec/unit/resource_reporter_spec.rb +4 -4
  142. data/spec/unit/run_status_spec.rb +1 -1
  143. data/tasks/announce.rb +58 -0
  144. data/tasks/changelog.rb +26 -6
  145. data/tasks/templates/prerelease.md.erb +35 -0
  146. data/tasks/templates/release.md.erb +34 -0
  147. metadata +21 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 340c1cbda2004926c5f046f561e56586829a141c
4
- data.tar.gz: efed35187da59fd2a49ea092312be922d11f90db
3
+ metadata.gz: 65076827aae71a3ffc31e38bcdc57aaa2b3c7d37
4
+ data.tar.gz: a162de1931b62e4e2e21b5a14401b1b527e12cab
5
5
  SHA512:
6
- metadata.gz: 0f0e9083844b5a3553acf79a476daab28277cbd3ef1f4d7da0354d88bf28afbe98e967e3470e5967ccaf5139864d11a9fffd58f3a3d733c07b81e8dbc6c7d11d
7
- data.tar.gz: c97b133f8aa935250e57a66ef73af2288563547dcfec3cc9031531c0f2205ee52fbc8d8091e3b2d57dc9825f852cb7f7ff4e8332b1c733aae8b4ae3d0ecc7a68
6
+ metadata.gz: f461e957499b72c52782e24aac925951f6123577448dc9f3531d6ae2876af1d729e9e09e10fd03ecc85a0a2148eea57d9f66c5e49ae2282434fc23444bac849f
7
+ data.tar.gz: 26d26f72b2fe008b20d095b70a54c9e6c82e3fc0cfaa80108ba71bb5a9e85196fcaadbf82f7613f8353be711e93dbff2ff93dff3a53f96e5a59ab83f10ec9019
data/Gemfile CHANGED
@@ -78,7 +78,8 @@ group(:development, :test) do
78
78
  end
79
79
 
80
80
  group(:changelog) do
81
- gem "github_changelog_generator"
81
+ gem "github_changelog_generator", git: "https://github.com/tduffield/github-changelog-generator", branch: "adjust-tag-section-mapping"
82
+ gem "mixlib-install"
82
83
  end
83
84
 
84
85
  group(:travis) do
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  [![Code Climate](https://codeclimate.com/github/chef/chef.svg)](https://codeclimate.com/github/chef/chef)
3
3
  [![Build Status Master](https://travis-ci.org/chef/chef.svg?branch=master)](https://travis-ci.org/chef/chef)
4
4
  [![Build Status Master](https://ci.appveyor.com/api/projects/status/github/chef/chef?branch=master&svg=true&passingText=master%20-%20Ok&pendingText=master%20-%20Pending&failingText=master%20-%20Failing)](https://ci.appveyor.com/project/Chef/chef/branch/master)
5
+ [![Gem Version](https://badge.fury.io/rb/chef.svg)](https://badge.fury.io/rb/chef)
5
6
 
6
7
  Want to try Chef? Get started with [learnchef](https://learn.chef.io)
7
8
 
@@ -76,7 +77,7 @@ The general development process is:
76
77
  master.
77
78
 
78
79
  Once your repository is set up, you can start working on the code. We do utilize
79
- RSpec for test driven development, so you'll need to get a development
80
+ RSpec for test driven development, so you'll need to get a development
80
81
  environment running. Follow the above procedure ("Installing from Git") to get
81
82
  your local copy of the source running.
82
83
 
@@ -156,18 +157,32 @@ Whenever a change is checked in to `master`, the patch version of `chef` is bump
156
157
 
157
158
  1. Bumps the patch version in `lib/chef/version.rb` (e.g. 0.9.14 -> 0.9.15).
158
159
  2. Runs `rake bundle:install` to update the `Gemfile.lock` to include the new version.
159
- 3. Pushes to `master` and submits a new build to Chef's Jenkins cluster.
160
+ 3. Runs `rake changelog:update` to update the `CHANGELOG.md`.
161
+ 4. Pushes to `master` and submits a new build to Chef's Jenkins cluster.
160
162
 
161
163
  ## Bumping the minor version of Chef
162
164
 
163
165
  After each "official" stable release we need to bump the minor version. To do this:
164
166
 
165
- 1. Manually increment the minor version in the VERSION file that is in the root of this repo. and reset the patch version to 0. Assuming the current version is `12.10.57` you would edit `VERSION` to be `12.11.0`.
166
- 2. Run `bundle exec rake version` which will copy the version to the respective `version.rb` files in chef and chef-config.
167
- 3. Run `bundle exec rake bundle:install` to update the base Gemfile.lock
167
+ 1. Run `bundle exec rake version:bump_minor`
168
168
 
169
169
  Submit a PR with the changes made by the above.
170
170
 
171
+ ## Addressing a Regression
172
+
173
+ Sometimes, regressions split through the cracks. Since new functionality is always being added and the minor version is bumped immediately after release, we can't simply roll forward. In this scenario, we'll need to perform a special regression release process. In the example that follows, the stable release with a regression is `1.10.60` while master is currently sitting at `1.11.30`. *Note:* To perform this process, you must be a Chef employee.
174
+
175
+ 1. If the regression has not already been addressed, open a Pull Request against master with the fix.
176
+ 2. Wait until that Pull Request has been merged and `1.11.31` has passed all the necessary tests and is available in the current channel.
177
+ 3. Inspect the Git history and find the `SHA` associated with the Merge Commit for the Pull Request above.
178
+ 4. Apply the fix for the regression via a cherry-pick:
179
+ 1. Check out the stable release tag: `git checkout v1.10.60`
180
+ 2. Cherry Pick the SHA with the fix: `git cherry-pick SHA`
181
+ 3. Address any conflicts (if necessary)
182
+ 4. Tag the sha with the appropriate version: `git tag -a v1.10.61 -m "Release v1.10.61"`
183
+ 5. Push the new tag to origin: `git push origin --tags`
184
+ 5. Log in to Jenkins and trigger a `chef-trigger-release` job specifying the new tag as the `GIT_REF`.
185
+
171
186
  ## Component Versions
172
187
 
173
188
  Chef has two sorts of component: ruby components like `berkshelf` and `test-kitchen`, and binary components like `openssl` and even `ruby` itself.
data/Rakefile CHANGED
@@ -28,6 +28,7 @@ require_relative "tasks/maintainers"
28
28
  require_relative "tasks/cbgb"
29
29
  require_relative "tasks/dependencies"
30
30
  require_relative "tasks/changelog"
31
+ require_relative "tasks/announce"
31
32
 
32
33
  ChefConfig::PackageTask.new(File.expand_path("..", __FILE__), "Chef", "chef") do |package|
33
34
  package.component_paths = ["chef-config"]
@@ -37,6 +38,22 @@ end
37
38
  task "version:bump" => %w{version:bump_patch version:update}
38
39
  task "version:bump" => %w{version:bump_patch version:update}
39
40
 
41
+ task "version:bump_minor" do
42
+ Rake::Task["changelog:archive"].invoke
43
+ maj, min, _build = Chef::VERSION.split(".")
44
+ File.open("VERSION", "w+") { |f| f.write("#{maj}.#{min.to_i + 1}.0") }
45
+ Rake::Task["version"].invoke
46
+ Rake::Task["bundle:install"].invoke
47
+ end
48
+
49
+ task "version:bump_major" do
50
+ Rake::Task["changelog:archive"].invoke
51
+ maj, _min, _build = Chef::VERSION.split(".")
52
+ File.open("VERSION", "w+") { |f| f.write("#{maj.to_i + 1}.0.0") }
53
+ Rake::Task["version"].invoke
54
+ Rake::Task["bundle:install"].invoke
55
+ end
56
+
40
57
  task :pedant, :chef_zero_spec
41
58
 
42
59
  task :build_eventlog do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 12.16.42
1
+ 12.17.44
@@ -9,14 +9,17 @@ GIT
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- addressable (2.4.0)
13
- artifactory (2.5.0)
14
- aws-sdk (2.6.14)
15
- aws-sdk-resources (= 2.6.14)
16
- aws-sdk-core (2.6.14)
12
+ addressable (2.5.0)
13
+ public_suffix (~> 2.0, >= 2.0.2)
14
+ artifactory (2.5.1)
15
+ aws-sdk (2.6.32)
16
+ aws-sdk-resources (= 2.6.32)
17
+ aws-sdk-core (2.6.32)
18
+ aws-sigv4 (~> 1.0)
17
19
  jmespath (~> 1.0)
18
- aws-sdk-resources (2.6.14)
19
- aws-sdk-core (= 2.6.14)
20
+ aws-sdk-resources (2.6.32)
21
+ aws-sdk-core (= 2.6.32)
22
+ aws-sigv4 (1.0.0)
20
23
  berkshelf (4.3.5)
21
24
  addressable (~> 2.3, >= 2.3.4)
22
25
  berkshelf-api-client (~> 2.0, >= 2.0.2)
@@ -53,7 +56,7 @@ GEM
53
56
  celluloid-io (0.16.2)
54
57
  celluloid (>= 0.16.0)
55
58
  nio4r (>= 1.1.0)
56
- chef-config (12.15.19)
59
+ chef-config (12.16.42)
57
60
  addressable
58
61
  fuzzyurl
59
62
  mixlib-config (~> 2.0)
@@ -61,7 +64,7 @@ GEM
61
64
  cleanroom (1.0.0)
62
65
  coderay (1.1.1)
63
66
  diff-lcs (1.2.5)
64
- docker-api (1.32.1)
67
+ docker-api (1.33.0)
65
68
  excon (>= 0.38.0)
66
69
  json
67
70
  erubis (2.7.0)
@@ -77,7 +80,7 @@ GEM
77
80
  hashie (3.4.6)
78
81
  hitimes (1.2.4)
79
82
  httpclient (2.7.2)
80
- inspec (1.3.0)
83
+ inspec (1.7.0)
81
84
  hashie (~> 3.4)
82
85
  json (>= 1.8, < 3.0)
83
86
  method_source (~> 0.8)
@@ -87,6 +90,7 @@ GEM
87
90
  rainbow (~> 2)
88
91
  rspec (~> 3)
89
92
  rspec-its (~> 1.2)
93
+ rspec_junit_formatter (~> 0.2.3)
90
94
  rubyzip (~> 1.1)
91
95
  sslshake (~> 1)
92
96
  thor (~> 0.19)
@@ -99,10 +103,11 @@ GEM
99
103
  multi_json
100
104
  retryable (~> 2.0)
101
105
  test-kitchen (~> 1.4, >= 1.4.1)
102
- kitchen-inspec (0.15.2)
103
- inspec (>= 0.22.0, < 2.0.0)
106
+ kitchen-inspec (0.16.1)
107
+ hashie (~> 3.4)
108
+ inspec (>= 0.34.0, < 2.0.0)
104
109
  test-kitchen (~> 1.6)
105
- kitchen-vagrant (0.20.0)
110
+ kitchen-vagrant (0.21.0)
106
111
  test-kitchen (~> 1.4)
107
112
  little-plugger (1.1.4)
108
113
  logging (2.1.0)
@@ -132,13 +137,14 @@ GEM
132
137
  net-ssh (>= 2.6.5)
133
138
  nio4r (1.2.1)
134
139
  nori (2.6.0)
135
- octokit (4.4.1)
136
- sawyer (~> 0.7.0, >= 0.5.3)
137
- parallel (1.9.0)
140
+ octokit (4.6.2)
141
+ sawyer (~> 0.8.0, >= 0.5.3)
142
+ parallel (1.10.0)
138
143
  pry (0.10.4)
139
144
  coderay (~> 1.1.0)
140
145
  method_source (~> 0.8.1)
141
146
  slop (~> 3.4)
147
+ public_suffix (2.0.4)
142
148
  rainbow (2.1.0)
143
149
  retryable (2.0.4)
144
150
  ridley (4.6.1)
@@ -175,19 +181,22 @@ GEM
175
181
  diff-lcs (>= 1.2.0, < 2.0)
176
182
  rspec-support (~> 3.5.0)
177
183
  rspec-support (3.5.0)
184
+ rspec_junit_formatter (0.2.3)
185
+ builder (< 4)
186
+ rspec-core (>= 2, < 4, != 2.12.0)
178
187
  rubyntlm (0.6.1)
179
188
  rubyzip (1.2.0)
180
189
  safe_yaml (1.0.4)
181
- sawyer (0.7.0)
182
- addressable (>= 2.3.5, < 2.5)
183
- faraday (~> 0.8, < 0.10)
190
+ sawyer (0.8.1)
191
+ addressable (>= 2.3.5, < 2.6)
192
+ faraday (~> 0.8, < 1.0)
184
193
  semverse (1.2.1)
185
194
  slop (3.6.0)
186
195
  solve (2.0.3)
187
196
  molinillo (~> 0.4.2)
188
197
  semverse (~> 1.1)
189
198
  sslshake (1.0.13)
190
- test-kitchen (1.13.2)
199
+ test-kitchen (1.14.0)
191
200
  mixlib-install (>= 1.2, < 3.0)
192
201
  mixlib-shellout (>= 1.2, < 3.0)
193
202
  net-scp (~> 1.1)
@@ -195,10 +204,10 @@ GEM
195
204
  net-ssh-gateway (~> 1.2.0)
196
205
  safe_yaml (~> 1.0)
197
206
  thor (~> 0.18)
198
- thor (0.19.1)
207
+ thor (0.19.4)
199
208
  timers (4.0.4)
200
209
  hitimes
201
- train (0.20.1)
210
+ train (0.22.0)
202
211
  docker-api (~> 1.26)
203
212
  json (>= 1.8, < 3.0)
204
213
  mixlib-shellout (~> 2.0)
@@ -245,4 +254,4 @@ DEPENDENCIES
245
254
  winrm-elevated
246
255
 
247
256
  BUNDLED WITH
248
- 1.12.5
257
+ 1.13.6
@@ -33,10 +33,11 @@ the specified _directory_.
33
33
  * On a freshly installed Chef Server, use _knife configure -i_ to
34
34
  create an administrator and knife configuration file. Leave the
35
35
  field blank to accept the default value. On most systems, the
36
- default values are acceptable.
36
+ default values are acceptable (except for the chef server URL,
37
+ there you must add your organization name)
37
38
 
38
39
  user@host$ knife configure -i
39
- Please enter the chef server URL: [http://localhost:4000]
40
+ Please enter the chef server URL: [http://localhost/organizations/myorg]
40
41
  Please enter a clientname for the new client: [username]
41
42
  Please enter the existing admin clientname: [chef-webui]
42
43
  Please enter the location of the existing admin client's private key: [/etc/chef/webui.pem]
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -17,4 +17,4 @@
17
17
  #
18
18
 
19
19
  require "chef/chef_fs/file_system/exceptions"
20
- Chef.log_deprecation "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
20
+ Chef.deprecated :internal_api, "Individual ChefFS error files are deprecated. Please require 'chef/chef_fs/file_system/exceptions' rather than 'chef/chef_fs/file_system/#{File.basename(__FILE__, ".rb")}'."
@@ -1,6 +1,6 @@
1
1
  require "chef/chef_fs/file_system/repository/file_system_entry"
2
2
 
3
3
  module Chef::ChefFS::FileSystem::Repository
4
- Chef.log_deprecation "Chef::ChefFS::FileSystem::Repository::ChefRepositoryFileSystemEntry is deprecated. Please use FileSystemEntry directly"
4
+ Chef.deprecated :internal_api, "Chef::ChefFS::FileSystem::Repository::ChefRepositoryFileSystemEntry is deprecated. Please use FileSystemEntry directly"
5
5
  ChefRepositoryFileSystemEntry = FileSystemEntry
6
6
  end
@@ -24,7 +24,7 @@ class Chef
24
24
  module Repository
25
25
  class FileSystemRootDir < FileSystemEntry
26
26
  def initialize(file_path)
27
- Chef.log_deprecation "Chef::ChefFS::FileSystem::Repository::FileSystemRootDir is deprecated."
27
+ Chef.deprecated :internal_api, "Chef::ChefFS::FileSystem::Repository::FileSystemRootDir is deprecated."
28
28
  super("", nil, file_path)
29
29
  end
30
30
  end
@@ -141,7 +141,7 @@ class Chef
141
141
  end
142
142
 
143
143
  def self.json_create(data)
144
- Chef.log_deprecation("Auto inflation of JSON data is deprecated. Please use Chef::ApiClient#from_hash")
144
+ Chef.deprecated(:json_auto_inflate, "Auto inflation of JSON data is deprecated. Please use Chef::ApiClient#from_hash")
145
145
  from_hash(data)
146
146
  end
147
147
 
@@ -333,7 +333,7 @@ class Chef
333
333
 
334
334
  def emit_warnings
335
335
  if Chef::Config[:chef_gem_compile_time]
336
- Chef.log_deprecation "setting chef_gem_compile_time to true is deprecated"
336
+ Chef.deprecated :chef_gem_compile_time, "setting chef_gem_compile_time to true is deprecated"
337
337
  end
338
338
  end
339
339
 
@@ -88,7 +88,7 @@ class Chef
88
88
 
89
89
  def normalize_legacy_exit_code(exit_code)
90
90
  case exit_code
91
- when Fixnum
91
+ when Integer
92
92
  exit_code
93
93
  when Exception
94
94
  lookup_exit_code_by_exception(exit_code)
@@ -199,7 +199,7 @@ class Chef
199
199
 
200
200
  def notify_on_deprecation(message)
201
201
  begin
202
- Chef.log_deprecation(message)
202
+ Chef.deprecated(:exit_code, message)
203
203
  rescue Chef::Exceptions::DeprecatedFeatureError
204
204
  # Have to rescue this, otherwise this unhandled error preempts
205
205
  # the current exit code assignment.
@@ -207,7 +207,7 @@ class Chef
207
207
  end
208
208
 
209
209
  def deprecation_warning
210
- "Chef RFC 062 (https://github.com/chef/chef-rfc/master/rfc062-exit-status.md) defines the" \
210
+ "Chef RFC 062 (https://github.com/chef/chef-rfc/blob/master/rfc062-exit-status.md) defines the" \
211
211
  " exit codes that should be used with Chef. Chef::Application::ExitCode defines valid exit codes" \
212
212
  " In a future release, non-standard exit codes will be redefined as" \
213
213
  " GENERIC_FAILURE unless `exit_status` is set to `:disabled` in your client.rb."
@@ -31,6 +31,7 @@ require "chef/platform/resource_priority_map"
31
31
  require "chef/platform/provider_handler_map"
32
32
  require "chef/platform/resource_handler_map"
33
33
  require "chef/event_dispatch/dsl"
34
+ require "chef/deprecated"
34
35
 
35
36
  class Chef
36
37
  class << self
@@ -198,26 +199,35 @@ class Chef
198
199
  #
199
200
  # Emit a deprecation message.
200
201
  #
201
- # @param message The message to send.
202
+ # @param type The message to send. This should be a symbol, referring to
203
+ # a class defined in Chef::Deprecated
204
+ # @param message An explicit message to display, rather than the generic one
205
+ # associated with the deprecation.
202
206
  # @param location The location. Defaults to the caller who called you (since
203
207
  # generally the person who triggered the check is the one that needs to be
204
208
  # fixed).
205
209
  #
206
210
  # @example
207
- # Chef.deprecation("Deprecated!")
211
+ # Chef.deprecated(:my_deprecation, message: "This is deprecated!")
208
212
  #
209
213
  # @api private this will likely be removed in favor of an as-yet unwritten
210
214
  # `Chef.log`
211
- def log_deprecation(message, location = nil)
215
+ def deprecated(type, message, location = nil)
212
216
  location ||= Chef::Log.caller_location
217
+ deprecation = Chef::Deprecated.create(type, message, location)
213
218
  # `run_context.events` is the primary deprecation target if we're in a
214
219
  # run. If we are not yet in a run, print to `Chef::Log`.
215
220
  if run_context && run_context.events
216
- run_context.events.deprecation(message, location)
221
+ run_context.events.deprecation(deprecation, location)
217
222
  else
218
- Chef::Log.deprecation(message, location)
223
+ Chef::Log.deprecation(deprecation, location)
219
224
  end
220
225
  end
226
+
227
+ def log_deprecation(message, location = nil)
228
+ location ||= Chef::Log.caller_location
229
+ Chef.deprecated(:generic, message, location)
230
+ end
221
231
  end
222
232
 
223
233
  # @api private Only for test dependency injection; not evenly implemented as yet.
@@ -44,6 +44,7 @@ require "chef/chef_fs/data_handler/role_data_handler"
44
44
  require "chef/chef_fs/data_handler/user_data_handler"
45
45
  require "chef/chef_fs/data_handler/group_data_handler"
46
46
  require "chef/chef_fs/data_handler/container_data_handler"
47
+ require "chef/win32/security" if Chef::Platform.windows?
47
48
 
48
49
  class Chef
49
50
  module ChefFS
@@ -109,7 +110,17 @@ class Chef
109
110
  else
110
111
  child_paths[name].each do |path|
111
112
  begin
112
- Dir.mkdir(path)
113
+ Dir.mkdir(path, 0700)
114
+ if Chef::Platform.windows?
115
+ all_mask = Chef::ReservedNames::Win32::API::Security::GENERIC_ALL
116
+ owner = Chef::ReservedNames::Win32::Security::SID.current_user
117
+ dacl = Chef::ReservedNames::Win32::Security::ACL.create([
118
+ Chef::ReservedNames::Win32::Security::ACE.access_allowed(owner, all_mask),
119
+ ])
120
+ so = Chef::ReservedNames::Win32::Security::SecurableObject.new(path)
121
+ so.owner = owner
122
+ so.set_dacl(dacl, false)
123
+ end
113
124
  rescue Errno::EEXIST
114
125
  end
115
126
  end