chef-cli 5.6.23 → 6.1.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +20 -12
  3. data/Rakefile +13 -17
  4. data/bin/chef-cli +1 -1
  5. data/chef-cli.gemspec +6 -4
  6. data/lib/chef-cli/authenticated_http.rb +1 -1
  7. data/lib/chef-cli/builtin_commands.rb +7 -6
  8. data/lib/chef-cli/chef_runner.rb +1 -1
  9. data/lib/chef-cli/chef_server_api_multi.rb +1 -1
  10. data/lib/chef-cli/cli.rb +1 -1
  11. data/lib/chef-cli/command/base.rb +1 -1
  12. data/lib/chef-cli/command/clean_policy_cookbooks.rb +1 -1
  13. data/lib/chef-cli/command/clean_policy_revisions.rb +1 -1
  14. data/lib/chef-cli/command/delete_policy.rb +3 -3
  15. data/lib/chef-cli/command/delete_policy_group.rb +3 -3
  16. data/lib/chef-cli/command/describe_cookbook.rb +1 -1
  17. data/lib/chef-cli/command/diff.rb +5 -5
  18. data/lib/chef-cli/command/env.rb +38 -13
  19. data/lib/chef-cli/command/exec.rb +3 -2
  20. data/lib/chef-cli/command/export.rb +1 -1
  21. data/lib/chef-cli/command/gem.rb +2 -2
  22. data/lib/chef-cli/command/generate.rb +1 -1
  23. data/lib/chef-cli/command/generator_commands/attribute.rb +1 -1
  24. data/lib/chef-cli/command/generator_commands/base.rb +1 -1
  25. data/lib/chef-cli/command/generator_commands/chef_exts/generator_desc_resource.rb +1 -1
  26. data/lib/chef-cli/command/generator_commands/chef_exts/quieter_doc_formatter.rb +1 -1
  27. data/lib/chef-cli/command/generator_commands/chef_exts/recipe_dsl_ext.rb +1 -1
  28. data/lib/chef-cli/command/generator_commands/cookbook.rb +1 -1
  29. data/lib/chef-cli/command/generator_commands/cookbook_code_file.rb +1 -1
  30. data/lib/chef-cli/command/generator_commands/cookbook_file.rb +1 -1
  31. data/lib/chef-cli/command/generator_commands/generator_generator.rb +1 -1
  32. data/lib/chef-cli/command/generator_commands/helpers.rb +1 -1
  33. data/lib/chef-cli/command/generator_commands/input.rb +1 -1
  34. data/lib/chef-cli/command/generator_commands/policyfile.rb +1 -1
  35. data/lib/chef-cli/command/generator_commands/profile.rb +1 -1
  36. data/lib/chef-cli/command/generator_commands/recipe.rb +1 -1
  37. data/lib/chef-cli/command/generator_commands/repo.rb +1 -1
  38. data/lib/chef-cli/command/generator_commands/resource.rb +1 -1
  39. data/lib/chef-cli/command/generator_commands/template.rb +1 -1
  40. data/lib/chef-cli/command/generator_commands/waiver.rb +1 -1
  41. data/lib/chef-cli/command/generator_commands.rb +1 -1
  42. data/lib/chef-cli/command/install.rb +1 -1
  43. data/lib/chef-cli/command/license.rb +111 -0
  44. data/lib/chef-cli/command/push.rb +5 -5
  45. data/lib/chef-cli/command/push_archive.rb +1 -1
  46. data/lib/chef-cli/command/shell_init.rb +7 -2
  47. data/lib/chef-cli/command/show_policy.rb +7 -7
  48. data/lib/chef-cli/command/undelete.rb +3 -3
  49. data/lib/chef-cli/command/update.rb +1 -1
  50. data/lib/chef-cli/commands_map.rb +1 -1
  51. data/lib/chef-cli/completions/bash.sh.erb +1 -1
  52. data/lib/chef-cli/completions/chef.fish.erb +1 -1
  53. data/lib/chef-cli/completions/zsh.zsh.erb +1 -1
  54. data/lib/chef-cli/configurable.rb +1 -1
  55. data/lib/chef-cli/cookbook_metadata.rb +1 -1
  56. data/lib/chef-cli/cookbook_omnifetch.rb +3 -3
  57. data/lib/chef-cli/cookbook_profiler/git.rb +1 -1
  58. data/lib/chef-cli/cookbook_profiler/identifiers.rb +1 -1
  59. data/lib/chef-cli/cookbook_profiler/null_scm.rb +1 -1
  60. data/lib/chef-cli/dist.rb +6 -0
  61. data/lib/chef-cli/exceptions.rb +1 -1
  62. data/lib/chef-cli/generator.rb +1 -1
  63. data/lib/chef-cli/helpers.rb +100 -5
  64. data/lib/chef-cli/licensing/base.rb +42 -0
  65. data/lib/chef-cli/licensing/config.rb +26 -0
  66. data/lib/chef-cli/pager.rb +1 -1
  67. data/lib/chef-cli/policyfile/artifactory_cookbook_source.rb +1 -1
  68. data/lib/chef-cli/policyfile/attribute_merge_checker.rb +1 -1
  69. data/lib/chef-cli/policyfile/chef_repo_cookbook_source.rb +1 -1
  70. data/lib/chef-cli/policyfile/chef_server_cookbook_source.rb +1 -1
  71. data/lib/chef-cli/policyfile/chef_server_lock_fetcher.rb +1 -1
  72. data/lib/chef-cli/policyfile/community_cookbook_source.rb +1 -1
  73. data/lib/chef-cli/policyfile/comparison_base.rb +1 -1
  74. data/lib/chef-cli/policyfile/cookbook_location_specification.rb +3 -2
  75. data/lib/chef-cli/policyfile/cookbook_locks.rb +1 -1
  76. data/lib/chef-cli/policyfile/cookbook_sources.rb +1 -1
  77. data/lib/chef-cli/policyfile/delivery_supermarket_source.rb +1 -1
  78. data/lib/chef-cli/policyfile/differ.rb +1 -1
  79. data/lib/chef-cli/policyfile/dsl.rb +7 -5
  80. data/lib/chef-cli/policyfile/git_lock_fetcher.rb +2 -2
  81. data/lib/chef-cli/policyfile/included_policies_cookbook_source.rb +1 -1
  82. data/lib/chef-cli/policyfile/lister.rb +1 -1
  83. data/lib/chef-cli/policyfile/local_lock_fetcher.rb +1 -1
  84. data/lib/chef-cli/policyfile/lock_applier.rb +1 -1
  85. data/lib/chef-cli/policyfile/lock_fetcher_mixin.rb +1 -1
  86. data/lib/chef-cli/policyfile/null_cookbook_source.rb +1 -1
  87. data/lib/chef-cli/policyfile/policyfile_location_specification.rb +1 -1
  88. data/lib/chef-cli/policyfile/read_cookbook_for_compat_mode_upload.rb +1 -1
  89. data/lib/chef-cli/policyfile/remote_lock_fetcher.rb +1 -1
  90. data/lib/chef-cli/policyfile/reports/install.rb +1 -1
  91. data/lib/chef-cli/policyfile/reports/table_printer.rb +1 -1
  92. data/lib/chef-cli/policyfile/reports/upload.rb +1 -1
  93. data/lib/chef-cli/policyfile/solution_dependencies.rb +1 -1
  94. data/lib/chef-cli/policyfile/source_uri.rb +1 -1
  95. data/lib/chef-cli/policyfile/storage_config.rb +1 -1
  96. data/lib/chef-cli/policyfile/undo_record.rb +1 -1
  97. data/lib/chef-cli/policyfile/undo_stack.rb +1 -1
  98. data/lib/chef-cli/policyfile/uploader.rb +1 -1
  99. data/lib/chef-cli/policyfile_compiler.rb +5 -2
  100. data/lib/chef-cli/policyfile_lock.rb +1 -1
  101. data/lib/chef-cli/policyfile_services/clean_policies.rb +1 -1
  102. data/lib/chef-cli/policyfile_services/clean_policy_cookbooks.rb +1 -1
  103. data/lib/chef-cli/policyfile_services/export_repo.rb +1 -1
  104. data/lib/chef-cli/policyfile_services/install.rb +1 -1
  105. data/lib/chef-cli/policyfile_services/push.rb +1 -1
  106. data/lib/chef-cli/policyfile_services/push_archive.rb +1 -1
  107. data/lib/chef-cli/policyfile_services/rm_policy.rb +1 -1
  108. data/lib/chef-cli/policyfile_services/rm_policy_group.rb +1 -1
  109. data/lib/chef-cli/policyfile_services/show_policy.rb +1 -1
  110. data/lib/chef-cli/policyfile_services/undelete.rb +1 -1
  111. data/lib/chef-cli/policyfile_services/update_attributes.rb +1 -1
  112. data/lib/chef-cli/service_exception_inspectors/base.rb +1 -1
  113. data/lib/chef-cli/service_exception_inspectors/http.rb +1 -1
  114. data/lib/chef-cli/service_exception_inspectors.rb +1 -1
  115. data/lib/chef-cli/service_exceptions.rb +1 -1
  116. data/lib/chef-cli/shell_out.rb +1 -1
  117. data/lib/chef-cli/skeletons/code_generator/files/default/cookbook_readmes/README.md +3 -0
  118. data/lib/chef-cli/skeletons/code_generator/recipes/cookbook.rb +5 -5
  119. data/lib/chef-cli/skeletons/code_generator/recipes/profile.rb +1 -1
  120. data/lib/chef-cli/ui.rb +1 -1
  121. data/lib/chef-cli/version.rb +2 -2
  122. data/lib/chef-cli.rb +1 -1
  123. data/lib/kitchen/provisioner/chef_zero_capture.rb +2 -2
  124. data/lib/kitchen/provisioner/policyfile_zero.rb +2 -2
  125. data/spec/shared/fixture_cookbook_checksums.rb +1 -1
  126. data/spec/shared/setup_git_committer_config.rb +1 -1
  127. data/spec/shared/setup_git_cookbooks.rb +1 -1
  128. data/spec/spec_helper.rb +1 -1
  129. data/spec/test_helpers.rb +1 -1
  130. data/spec/unit/chef_runner_spec.rb +1 -1
  131. data/spec/unit/chef_server_api_multi_spec.rb +1 -1
  132. data/spec/unit/cli_spec.rb +3 -1
  133. data/spec/unit/command/base_spec.rb +1 -1
  134. data/spec/unit/command/clean_policy_cookbooks_spec.rb +1 -1
  135. data/spec/unit/command/clean_policy_revisions_spec.rb +1 -1
  136. data/spec/unit/command/delete_policy_group_spec.rb +1 -1
  137. data/spec/unit/command/delete_policy_spec.rb +1 -1
  138. data/spec/unit/command/diff_spec.rb +1 -1
  139. data/spec/unit/command/env_spec.rb +132 -2
  140. data/spec/unit/command/exec_spec.rb +2 -1
  141. data/spec/unit/command/export_spec.rb +1 -1
  142. data/spec/unit/command/generate_spec.rb +1 -1
  143. data/spec/unit/command/generator_commands/attribute_spec.rb +1 -1
  144. data/spec/unit/command/generator_commands/base_spec.rb +1 -1
  145. data/spec/unit/command/generator_commands/chef_exts/generator_desc_resource_spec.rb +1 -1
  146. data/spec/unit/command/generator_commands/chef_exts/recipe_dsl_ext_spec.rb +1 -1
  147. data/spec/unit/command/generator_commands/cookbook_file_spec.rb +1 -1
  148. data/spec/unit/command/generator_commands/cookbook_spec.rb +1 -1
  149. data/spec/unit/command/generator_commands/generator_generator_spec.rb +1 -1
  150. data/spec/unit/command/generator_commands/helpers_spec.rb +1 -1
  151. data/spec/unit/command/generator_commands/input_spec.rb +1 -1
  152. data/spec/unit/command/generator_commands/policyfile_spec.rb +1 -1
  153. data/spec/unit/command/generator_commands/profile_spec.rb +1 -1
  154. data/spec/unit/command/generator_commands/recipe_spec.rb +1 -1
  155. data/spec/unit/command/generator_commands/repo_spec.rb +1 -1
  156. data/spec/unit/command/generator_commands/resource_spec.rb +1 -1
  157. data/spec/unit/command/generator_commands/template_spec.rb +1 -1
  158. data/spec/unit/command/generator_commands/waiver_spec.rb +1 -1
  159. data/spec/unit/command/install_spec.rb +1 -1
  160. data/spec/unit/command/license_spec.rb +162 -0
  161. data/spec/unit/command/push_archive_spec.rb +1 -1
  162. data/spec/unit/command/push_spec.rb +1 -1
  163. data/spec/unit/command/shell_init_spec.rb +99 -1
  164. data/spec/unit/command/show_policy_spec.rb +1 -1
  165. data/spec/unit/command/undelete_spec.rb +1 -1
  166. data/spec/unit/command/update_spec.rb +1 -1
  167. data/spec/unit/commands_map_spec.rb +1 -1
  168. data/spec/unit/configurable_spec.rb +1 -1
  169. data/spec/unit/cookbook_metadata_spec.rb +1 -1
  170. data/spec/unit/cookbook_omnifetch.rb +1 -1
  171. data/spec/unit/cookbook_profiler/git_spec.rb +1 -1
  172. data/spec/unit/cookbook_profiler/identifiers_spec.rb +1 -1
  173. data/spec/unit/generator_spec.rb +1 -1
  174. data/spec/unit/helpers_spec.rb +35 -2
  175. data/spec/unit/kitchen/provisioner/chef_zero_capture_spec.rb +1 -1
  176. data/spec/unit/pager_spec.rb +1 -1
  177. data/spec/unit/policyfile/artifactory_cookbook_source_spec.rb +1 -1
  178. data/spec/unit/policyfile/attribute_merge_checker_spec.rb +1 -1
  179. data/spec/unit/policyfile/chef_repo_cookbook_source_spec.rb +1 -1
  180. data/spec/unit/policyfile/chef_server_cookbook_source_spec.rb +1 -1
  181. data/spec/unit/policyfile/chef_server_lock_fetcher_spec.rb +1 -1
  182. data/spec/unit/policyfile/community_cookbook_source_spec.rb +1 -1
  183. data/spec/unit/policyfile/comparison_base_spec.rb +1 -1
  184. data/spec/unit/policyfile/cookbook_location_specification_spec.rb +1 -1
  185. data/spec/unit/policyfile/cookbook_locks_spec.rb +1 -1
  186. data/spec/unit/policyfile/delivery_supermarket_source_spec.rb +1 -1
  187. data/spec/unit/policyfile/differ_spec.rb +7 -7
  188. data/spec/unit/policyfile/git_lock_fetcher_spec.rb +1 -1
  189. data/spec/unit/policyfile/included_policies_cookbook_source_spec.rb +1 -1
  190. data/spec/unit/policyfile/lister_spec.rb +1 -1
  191. data/spec/unit/policyfile/local_lock_fetcher_spec.rb +1 -1
  192. data/spec/unit/policyfile/lock_applier_spec.rb +1 -1
  193. data/spec/unit/policyfile/lock_fetcher_mixin_spec.rb +1 -1
  194. data/spec/unit/policyfile/null_cookbook_source_spec.rb +1 -1
  195. data/spec/unit/policyfile/read_cookbook_for_compat_mode_upload_spec.rb +1 -1
  196. data/spec/unit/policyfile/remote_lock_fetcher_spec.rb +1 -1
  197. data/spec/unit/policyfile/reports/install_spec.rb +1 -1
  198. data/spec/unit/policyfile/reports/upload_spec.rb +1 -1
  199. data/spec/unit/policyfile/solution_dependencies_spec.rb +1 -1
  200. data/spec/unit/policyfile/source_uri_spec.rb +1 -1
  201. data/spec/unit/policyfile/storage_config_spec.rb +1 -1
  202. data/spec/unit/policyfile/undo_record_spec.rb +1 -1
  203. data/spec/unit/policyfile/undo_stack_spec.rb +1 -1
  204. data/spec/unit/policyfile/uploader_spec.rb +1 -1
  205. data/spec/unit/policyfile_demands_spec.rb +3 -1
  206. data/spec/unit/policyfile_evaluation_spec.rb +1 -1
  207. data/spec/unit/policyfile_includes_dsl_spec.rb +1 -1
  208. data/spec/unit/policyfile_includes_spec.rb +1 -1
  209. data/spec/unit/policyfile_install_with_includes_spec.rb +1 -1
  210. data/spec/unit/policyfile_lock_build_spec.rb +1 -1
  211. data/spec/unit/policyfile_lock_install_spec.rb +1 -1
  212. data/spec/unit/policyfile_lock_serialization_spec.rb +1 -1
  213. data/spec/unit/policyfile_lock_validation_spec.rb +1 -1
  214. data/spec/unit/policyfile_services/clean_policies_spec.rb +3 -3
  215. data/spec/unit/policyfile_services/clean_policy_cookbooks_spec.rb +1 -1
  216. data/spec/unit/policyfile_services/export_repo_spec.rb +1 -1
  217. data/spec/unit/policyfile_services/install_spec.rb +1 -1
  218. data/spec/unit/policyfile_services/push_archive_spec.rb +1 -1
  219. data/spec/unit/policyfile_services/push_spec.rb +1 -1
  220. data/spec/unit/policyfile_services/rm_policy_group_spec.rb +1 -1
  221. data/spec/unit/policyfile_services/rm_policy_spec.rb +1 -1
  222. data/spec/unit/policyfile_services/show_policy_spec.rb +1 -1
  223. data/spec/unit/policyfile_services/undelete_spec.rb +1 -1
  224. data/spec/unit/policyfile_services/update_attributes_spec.rb +1 -1
  225. data/spec/unit/policyfile_services/update_spec.rb +1 -1
  226. data/spec/unit/service_exception_inspectors/base_spec.rb +1 -1
  227. data/spec/unit/service_exception_inspectors/http_spec.rb +1 -1
  228. data/spec/unit/shell_out_spec.rb +1 -1
  229. metadata +53 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0484f407c36de3f4a1f395826238d937aa802d26f188fc6b2a981e53eeee206f'
4
- data.tar.gz: d86fe03440295c206011d2f7d7232341fe99a3d0c7786027bff6920542477c18
3
+ metadata.gz: b70ca4960348d4646b657df09b0b5157f90eb8aeb8c8167f21cdf52837ff63e2
4
+ data.tar.gz: 8c1912808de76efaaada71f2414602b608be6a07365782ada11397e54c69a7d8
5
5
  SHA512:
6
- metadata.gz: 97dd2adb6a8f5faa636b72e60d672017b0bc4fa35e1d18290127c7dc1c003db073ed43234320c6d8c8d16f9656d1dfdc0397e1d765a43c320afd845a91e3af53
7
- data.tar.gz: 52ed991df1bf48b581702d400e605a1a77e1a63e6b6a6c905facf73a6373a9d4819fd67a68f0ca8c2fa325203a156c2018396f6cc5cb83fa97c6e4887351c96a
6
+ metadata.gz: 4dddac447ba3f2e3314be76e6409e6d9d5e31a56dc936001757a549c858feb4793d5b3703c6cef6377452f2ce1d866602c5765d6ac65885d4bd99e288bfdd62f
7
+ data.tar.gz: 3be61bf08bbbe4f900d87a5cc5f7ff56114a8b52c398a7b8416fc2d6236a1ab0d1f26dcdaca00ee3870b0a8c5e4a3578cbc5ae12f75c9a611dbc1c813eda2c60
data/Gemfile CHANGED
@@ -3,29 +3,37 @@ source "https://rubygems.org"
3
3
  gemspec
4
4
 
5
5
  gem "logger", "< 1.6" # 1.6 causes errors with mixlib-log < 3.1.1
6
-
7
- # Pin psych < 5.2 to avoid build issues on Windows Ruby 3.3 where libyaml headers are unavailable
8
- gem "psych", "< 5.2" if RUBY_PLATFORM.match?(/mingw|mswin/) && RUBY_VERSION.start_with?("3.3")
6
+ gem "chefspec"
9
7
 
10
8
  group :test do
11
9
  gem "rake"
12
- gem "rspec", "~> 3.8"
10
+ gem "rspec", "=3.12.0"
13
11
  gem "rspec-expectations", "~> 3.8"
14
12
  gem "rspec-mocks", "~> 3.8"
15
- gem "cookstyle"
16
- gem "chefstyle"
17
- gem "test-kitchen"
13
+ gem "cookstyle", ">= 7.32"
14
+ gem "faraday_middleware"
15
+ gem "chef-test-kitchen-enterprise", git: "https://github.com/chef/chef-test-kitchen-enterprise", branch: "main"
16
+ # kitchen-omnibus-chef requires test-kitchen >= 4.0, so we need to explicitly add the test-kitchen alias gem
17
+ # test-kitchen is an alias gem provided by chef-test-kitchen-enterprise via test-kitchen.gemspec
18
+ gem "test-kitchen", git: "https://github.com/chef/chef-test-kitchen-enterprise", branch: "main", glob: "test-kitchen.gemspec"
19
+ # TODO: Replace kitchen-omnibus-chef with kitchen-chef-enterprise once private repo access is available for public runners
20
+ # kitchen-omnibus-chef is deprecated and won't receive updates, but provides chef-zero provisioner functionality
21
+ # gem "kitchen-chef-enterprise", git: "https://github.com/chef/kitchen-chef-enterprise", branch: "main"
22
+ gem "kitchen-omnibus-chef", "~> 1.1"
18
23
  gem "simplecov", require: false
19
24
  end
20
25
 
21
26
  group :development do
22
27
  gem "pry"
23
- gem "pry-byebug", platforms: :ruby # byebug doesn't work on Windows
28
+ gem "pry-byebug"
24
29
  gem "rb-readline"
30
+ gem "appbundler"
25
31
  end
26
32
 
27
33
  group :profile do
28
- gem "stackprof"
29
- gem "stackprof-webnav"
30
- gem "memory_profiler"
31
- end
34
+ unless RUBY_PLATFORM.match?(/mswin|mingw|windows/)
35
+ gem "stackprof"
36
+ gem "stackprof-webnav"
37
+ gem "memory_profiler"
38
+ end
39
+ end
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -14,6 +14,8 @@
14
14
  # See the License for the specific language governing permissions and
15
15
  # limitations under the License.
16
16
  #
17
+ #
18
+ require "bundler/gem_tasks"
17
19
 
18
20
  namespace :style do
19
21
  begin
@@ -29,26 +31,20 @@ namespace :style do
29
31
  puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV["CI"]
30
32
  end
31
33
 
32
- begin
34
+ desc "Run Chef Ruby style checks"
35
+ task :chefstyle do
33
36
  require "rubocop/rake_task"
37
+ require "cookstyle/chefstyle"
34
38
 
35
- ignore_dirs = Regexp.union(%w{
36
- lib/chef-cli/skeletons/code_generator
37
- spec/unit/fixtures/chef-runner-cookbooks
38
- spec/unit/fixtures/cookbook_cache
39
- spec/unit/fixtures/example_cookbook
40
- spec/unit/fixtures/example_cookbook_metadata_json_only
41
- spec/unit/fixtures/example_cookbook_no_metadata
42
- spec/unit/fixtures/local_path_cookbooks
43
- })
44
-
45
- desc "Run Chef Ruby style checks"
46
- RuboCop::RakeTask.new(:chefstyle) do |t|
47
- t.requires = ["chefstyle"]
48
- t.patterns = `rubocop --list-target-files`.split("\n").reject { |f| f =~ ignore_dirs }
49
- t.options = ["--display-cop-names"]
39
+ if RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
40
+ # Windows-specific command, rubocop erroneously reports the CRLF in each file which is removed when your PR is uploaded to GitHub.
41
+ # This is a workaround to ignore the CRLF from the files before running cookstyle.
42
+ sh "cookstyle --chefstyle -c .rubocop.yml --except Layout/EndOfLine --display-cop-names"
43
+ else
44
+ sh "cookstyle --chefstyle -c .rubocop.yml --display-cop-names"
50
45
  end
51
46
  rescue LoadError => e
52
47
  puts ">>> Gem load error: #{e}, omitting #{task.name}" unless ENV["CI"]
53
48
  end
54
49
  end
50
+
data/bin/chef-cli CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright:: Copyright (c) Chef Software Inc.
3
+ # Copyright:: Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
4
4
  # License:: Apache License, Version 2.0
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
data/chef-cli.gemspec CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) Chef Software Inc.
2
+ # Copyright:: Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -43,11 +43,13 @@ Gem::Specification.new do |gem|
43
43
  gem.add_dependency "mixlib-shellout", ">= 2.0", "< 4.0"
44
44
  gem.add_dependency "ffi-yajl", ">= 1.0", "< 3.0"
45
45
  gem.add_dependency "minitar", "~> 1.0"
46
- gem.add_dependency "chef", "~> 18.0"
47
- gem.add_dependency "solve", "< 5.0", "> 2.0"
46
+ gem.add_dependency "chef", ">= 18.0", "< 20.0"
47
+ gem.add_dependency "solve", "> 2.0", "< 5.0"
48
48
  gem.add_dependency "addressable", ">= 2.3.5", "< 2.9"
49
49
  gem.add_dependency "cookbook-omnifetch", "~> 0.5"
50
- gem.add_dependency "diff-lcs", ">= 1.2.4", "!= 1.4.0", "< 1.6.0" # 1.4 breaks output. Used in lib/chef/util/diff
50
+ gem.add_dependency "diff-lcs", "~> 1.6" # Newer verions of chef-client require diff-lcs ~> 1.6
51
51
  gem.add_dependency "pastel", "~> 0.7" # used for policyfile differ
52
52
  gem.add_dependency "license-acceptance", ">= 1.0.11", "< 3"
53
+ gem.add_dependency "chef-licensing", "~> 1.0"
54
+ gem.add_dependency "syslog", "~> 0.3" # syslog was removed from Ruby's standard library in 3.4; see https://stdgems.org/new-in/3.4
53
55
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,14 +19,13 @@ require_relative "dist"
19
19
 
20
20
  ChefCLI.commands do |c|
21
21
  c.builtin "exec", :Exec, require_path: "chef-cli/command/exec",
22
- desc: "Runs the command in context of the embedded ruby"
22
+ desc: "Runs the command in context of the embedded ruby"
23
23
 
24
24
  c.builtin "env", :Env, require_path: "chef-cli/command/env",
25
- desc: "Prints environment variables used by #{ChefCLI::Dist::PRODUCT}"
25
+ desc: "Prints environment variables used by #{ChefCLI::Dist::PRODUCT}"
26
26
 
27
27
  c.builtin "gem", :GemForwarder, require_path: "chef-cli/command/gem",
28
- desc: "Runs the `gem` command in context of the embedded Ruby"
29
-
28
+ desc: "Runs the `gem` command in context of the embedded Ruby"
30
29
  c.builtin "generate", :Generate, desc: "Generate a new repository, cookbook, or other component"
31
30
 
32
31
  c.builtin "shell-init", :ShellInit, desc: "Initialize your shell to use #{ChefCLI::Dist::PRODUCT} as your primary Ruby"
@@ -56,5 +55,7 @@ ChefCLI.commands do |c|
56
55
  c.builtin "undelete", :Undelete, desc: "Undo a delete command"
57
56
 
58
57
  c.builtin "describe-cookbook", :DescribeCookbook, require_path: "chef-cli/command/describe_cookbook",
59
- desc: "Prints cookbook checksum information used for cookbook identifier"
58
+ desc: "Prints cookbook checksum information used for cookbook identifier"
59
+ c.builtin "license", :License, require_path: "chef-cli/command/license",
60
+ desc: "Create & install a new license on the system or view installed license(s)."
60
61
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
data/lib/chef-cli/cli.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -69,8 +69,8 @@ module ChefCLI
69
69
  def rm_policy_service
70
70
  @rm_policy_service ||=
71
71
  PolicyfileServices::RmPolicy.new(config: chef_config,
72
- ui:,
73
- policy_name:)
72
+ ui:,
73
+ policy_name:)
74
74
  end
75
75
 
76
76
  def debug?
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -69,8 +69,8 @@ module ChefCLI
69
69
  def rm_policy_group_service
70
70
  @rm_policy_group_service ||=
71
71
  PolicyfileServices::RmPolicyGroup.new(config: chef_config,
72
- ui:,
73
- policy_group:)
72
+ ui:,
73
+ policy_group:)
74
74
  end
75
75
 
76
76
  def debug?
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -145,10 +145,10 @@ module ChefCLI
145
145
 
146
146
  def differ(ui = self.ui)
147
147
  Policyfile::Differ.new(old_name: old_base.name,
148
- old_lock:,
149
- new_name: new_base.name,
150
- new_lock:,
151
- ui:)
148
+ old_lock:,
149
+ new_name: new_base.name,
150
+ new_lock:,
151
+ ui:)
152
152
  end
153
153
 
154
154
  def http_client
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,19 +40,35 @@ module ChefCLI
40
40
 
41
41
  def run(params)
42
42
  info = {}
43
- info[ChefCLI::Dist::PRODUCT] = workstation_info
43
+ product_name = get_product_info
44
+ info[product_name] = workstation_info
44
45
  info["Ruby"] = ruby_info
45
46
  info["Path"] = paths
46
47
  ui.msg YAML.dump(info)
47
48
  end
48
49
 
50
+ def get_product_info
51
+ if omnibus_install?
52
+ ChefCLI::Dist::PRODUCT
53
+ elsif habitat_chef_dke?
54
+ ChefCLI::Dist::CHEF_DK_CLI_PACKAGE
55
+ elsif habitat_standalone?
56
+ ChefCLI::Dist::CHEF_CLI_PACKAGE
57
+ else
58
+ ChefCLI::Dist::PRODUCT
59
+ end
60
+ end
61
+
49
62
  def workstation_info
50
- info = {}
63
+ info = { "Version" => ChefCLI::VERSION }
51
64
  if omnibus_install?
52
- info["Version"] = ChefCLI::VERSION
53
65
  info["Home"] = package_home
54
66
  info["Install Directory"] = omnibus_root
55
67
  info["Policyfile Config"] = policyfile_config
68
+ elsif habitat_chef_dke? || habitat_standalone?
69
+ info["Home"] = package_home
70
+ info["Install Directory"] = get_pkg_install_path
71
+ info["Policyfile Config"] = policyfile_config
56
72
  else
57
73
  info["Version"] = "Not running from within Workstation"
58
74
  end
@@ -73,19 +89,28 @@ module ChefCLI
73
89
 
74
90
  def gem_environment
75
91
  h = {}
76
- h["GEM ROOT"] = omnibus_env["GEM_ROOT"]
77
- h["GEM HOME"] = omnibus_env["GEM_HOME"]
78
- h["GEM PATHS"] = omnibus_env["GEM_PATH"].split(File::PATH_SEPARATOR)
79
- rescue OmnibusInstallNotFound
80
- h["GEM_ROOT"] = ENV["GEM_ROOT"] if ENV.key?("GEM_ROOT")
81
- h["GEM_HOME"] = ENV["GEM_HOME"] if ENV.key?("GEM_HOME")
82
- h["GEM PATHS"] = ENV["GEM_PATH"].split(File::PATH_SEPARATOR) if ENV.key?("GEM_PATH") && !ENV.key?("GEM_PATH").nil?
83
- ensure
92
+ if habitat_install?
93
+ # Habitat-specific environment variables
94
+ h["GEM ROOT"] = habitat_env(show_warning: true)["GEM_ROOT"]
95
+ h["GEM HOME"] = habitat_env(show_warning: true)["GEM_HOME"]
96
+ h["GEM PATHS"] = habitat_env(show_warning: true)["GEM_PATH"].split(File::PATH_SEPARATOR)
97
+ elsif omnibus_install?
98
+ # Omnibus-specific environment variables
99
+ h["GEM ROOT"] = omnibus_env["GEM_ROOT"]
100
+ h["GEM HOME"] = omnibus_env["GEM_HOME"]
101
+ h["GEM PATHS"] = omnibus_env["GEM_PATH"].split(File::PATH_SEPARATOR)
102
+ else
103
+ # Fallback to system environment variables if neither Omnibus nor Habitat
104
+ h["GEM_ROOT"] = ENV["GEM_ROOT"] if ENV.key?("GEM_ROOT")
105
+ h["GEM_HOME"] = ENV["GEM_HOME"] if ENV.key?("GEM_HOME")
106
+ h["GEM PATHS"] = ENV["GEM_PATH"].split(File::PATH_SEPARATOR) if ENV.key?("GEM_PATH") && !ENV["GEM_PATH"].nil?
107
+ end
84
108
  h
85
109
  end
86
110
 
87
111
  def paths
88
- omnibus_env["PATH"].split(File::PATH_SEPARATOR)
112
+ env = habitat_install? ? habitat_env(show_warning: true) : omnibus_env
113
+ env["PATH"].split(File::PATH_SEPARATOR)
89
114
  rescue OmnibusInstallNotFound
90
115
  ENV["PATH"].split(File::PATH_SEPARATOR)
91
116
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,7 +30,8 @@ module ChefCLI
30
30
  def run(params)
31
31
  # Set ENV directly on the "parent" process (us) before running #exec to
32
32
  # ensure the custom PATH is honored when finding the command to exec
33
- omnibus_env.each { |var, value| ENV[var] = value }
33
+ env = habitat_install? ? habitat_env : omnibus_env
34
+ env.each { |var, value| ENV[var] = value }
34
35
  exec(*params)
35
36
  raise "Exec failed without an exception, your ruby is buggy" # should never get here
36
37
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Copyright (c) Chef Software Inc.
2
+ # Copyright:: Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,7 +30,7 @@ module ChefCLI
30
30
 
31
31
  def run(params)
32
32
  retval = Gem::GemRunner.new.run( params.clone )
33
- retval.nil? ? true : retval
33
+ retval.nil? || retval
34
34
  rescue Gem::SystemExitException => e
35
35
  exit( e.exit_code )
36
36
  end
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
@@ -1,5 +1,5 @@
1
1
  #
2
- # Copyright:: Chef Software Inc.
2
+ # Copyright (c) 2019-2025 Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
3
3
  # License:: Apache License, Version 2.0
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");