chef 11.18.12-x86-mingw32 → 12.0.0.alpha.0-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (307) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +10 -0
  3. data/README.md +1 -1
  4. data/distro/common/html/_sources/index.txt +5 -2
  5. data/distro/common/html/_sources/knife_serve.txt +19 -0
  6. data/distro/common/html/_sources/knife_ssl_check.txt +2 -2
  7. data/distro/common/html/_sources/knife_ssl_fetch.txt +2 -2
  8. data/distro/common/html/_static/basic.css +1 -1
  9. data/distro/common/html/_static/doctools.js +1 -1
  10. data/distro/common/html/_static/searchtools.js +1 -1
  11. data/distro/common/html/_static/websupport.js +1 -1
  12. data/distro/common/html/ctl_chef_client.html +19 -9
  13. data/distro/common/html/ctl_chef_server.html +7 -1
  14. data/distro/common/html/ctl_chef_shell.html +3 -4
  15. data/distro/common/html/ctl_chef_solo.html +12 -7
  16. data/distro/common/html/index.html +19 -12
  17. data/distro/common/html/knife.html +1 -2
  18. data/distro/common/html/knife_bootstrap.html +16 -5
  19. data/distro/common/html/knife_client.html +8 -5
  20. data/distro/common/html/knife_common_options.html +11 -12
  21. data/distro/common/html/knife_configure.html +2 -3
  22. data/distro/common/html/knife_cookbook.html +16 -17
  23. data/distro/common/html/knife_cookbook_site.html +19 -18
  24. data/distro/common/html/knife_data_bag.html +6 -7
  25. data/distro/common/html/knife_delete.html +2 -3
  26. data/distro/common/html/knife_deps.html +2 -3
  27. data/distro/common/html/knife_diff.html +3 -4
  28. data/distro/common/html/knife_download.html +6 -7
  29. data/distro/common/html/knife_edit.html +0 -1
  30. data/distro/common/html/knife_environment.html +3 -4
  31. data/distro/common/html/knife_exec.html +0 -1
  32. data/distro/common/html/knife_index_rebuild.html +0 -1
  33. data/distro/common/html/knife_list.html +5 -6
  34. data/distro/common/html/knife_node.html +13 -6
  35. data/distro/common/html/knife_raw.html +0 -1
  36. data/distro/common/html/knife_recipe_list.html +0 -1
  37. data/distro/common/html/knife_role.html +1 -2
  38. data/distro/common/html/knife_search.html +2 -3
  39. data/distro/common/html/knife_serve.html +79 -0
  40. data/distro/common/html/knife_show.html +1 -2
  41. data/distro/common/html/knife_ssh.html +2 -3
  42. data/distro/common/html/knife_ssl_check.html +12 -9
  43. data/distro/common/html/knife_ssl_fetch.html +9 -10
  44. data/distro/common/html/knife_status.html +2 -3
  45. data/distro/common/html/knife_tag.html +0 -1
  46. data/distro/common/html/knife_upload.html +3 -4
  47. data/distro/common/html/knife_user.html +2 -3
  48. data/distro/common/html/knife_using.html +0 -1
  49. data/distro/common/html/knife_xargs.html +3 -4
  50. data/distro/common/html/search.html +0 -1
  51. data/distro/common/html/searchindex.js +1 -1
  52. data/lib/chef/api_client.rb +1 -1
  53. data/lib/chef/application.rb +24 -67
  54. data/lib/chef/application/client.rb +1 -1
  55. data/lib/chef/application/knife.rb +1 -1
  56. data/lib/chef/chef_fs/chef_fs_data_store.rb +2 -3
  57. data/lib/chef/chef_fs/command_line.rb +2 -3
  58. data/lib/chef/chef_fs/data_handler/group_data_handler.rb +1 -5
  59. data/lib/chef/chef_fs/file_system/acl_entry.rb +1 -2
  60. data/lib/chef/chef_fs/file_system/chef_repository_file_system_entry.rb +1 -2
  61. data/lib/chef/chef_fs/file_system/cookbooks_dir.rb +2 -2
  62. data/lib/chef/chef_fs/file_system/rest_list_dir.rb +2 -3
  63. data/lib/chef/chef_fs/file_system/rest_list_entry.rb +4 -5
  64. data/lib/chef/config.rb +26 -2
  65. data/lib/chef/config_fetcher.rb +1 -1
  66. data/lib/chef/cookbook/cookbook_version_loader.rb +4 -4
  67. data/lib/chef/cookbook/metadata.rb +1 -1
  68. data/lib/chef/cookbook/synchronizer.rb +50 -8
  69. data/lib/chef/cookbook_uploader.rb +9 -23
  70. data/lib/chef/cookbook_version.rb +3 -2
  71. data/lib/chef/data_bag.rb +1 -1
  72. data/lib/chef/data_bag_item.rb +1 -1
  73. data/lib/chef/dsl/recipe.rb +1 -14
  74. data/lib/chef/encrypted_data_bag_item/decryptor.rb +3 -3
  75. data/lib/chef/environment.rb +1 -1
  76. data/lib/chef/exceptions.rb +2 -24
  77. data/lib/chef/file_content_management/tempfile.rb +8 -1
  78. data/lib/chef/formatters/base.rb +0 -7
  79. data/lib/chef/http.rb +12 -19
  80. data/lib/chef/http/json_input.rb +12 -1
  81. data/lib/chef/json_compat.rb +45 -64
  82. data/lib/chef/knife.rb +2 -5
  83. data/lib/chef/knife/bootstrap.rb +2 -2
  84. data/lib/chef/knife/bootstrap/archlinux-gems.erb +2 -2
  85. data/lib/chef/knife/bootstrap/centos5-gems.erb +2 -2
  86. data/lib/chef/knife/bootstrap/chef-aix.erb +2 -2
  87. data/lib/chef/knife/bootstrap/chef-full.erb +2 -2
  88. data/lib/chef/knife/bootstrap/fedora13-gems.erb +2 -2
  89. data/lib/chef/knife/bootstrap/ubuntu10.04-apt.erb +2 -2
  90. data/lib/chef/knife/bootstrap/ubuntu10.04-gems.erb +2 -2
  91. data/lib/chef/knife/bootstrap/ubuntu12.04-gems.erb +2 -2
  92. data/lib/chef/knife/cookbook_site_download.rb +1 -1
  93. data/lib/chef/knife/cookbook_site_install.rb +10 -34
  94. data/lib/chef/knife/cookbook_site_list.rb +1 -1
  95. data/lib/chef/knife/cookbook_site_search.rb +1 -1
  96. data/lib/chef/knife/cookbook_site_share.rb +3 -3
  97. data/lib/chef/knife/cookbook_site_show.rb +3 -3
  98. data/lib/chef/knife/cookbook_site_unshare.rb +1 -1
  99. data/lib/chef/knife/cookbook_upload.rb +1 -1
  100. data/lib/chef/knife/core/subcommand_loader.rb +0 -24
  101. data/lib/chef/knife/core/ui.rb +8 -7
  102. data/lib/chef/knife/deps.rb +2 -3
  103. data/lib/chef/knife/serve.rb +2 -1
  104. data/lib/chef/local_mode.rb +105 -0
  105. data/lib/chef/mixin/file_class.rb +1 -4
  106. data/lib/chef/mixin/shell_out.rb +15 -0
  107. data/lib/chef/mixin/windows_architecture_helper.rb +0 -16
  108. data/lib/chef/node.rb +1 -1
  109. data/lib/chef/platform/query_helpers.rb +1 -5
  110. data/lib/chef/policy_builder/expand_node_object.rb +3 -0
  111. data/lib/chef/provider.rb +2 -0
  112. data/lib/chef/provider/cookbook_file.rb +0 -1
  113. data/lib/chef/provider/deploy.rb +0 -1
  114. data/lib/chef/provider/deploy/revision.rb +1 -1
  115. data/lib/chef/provider/env.rb +10 -25
  116. data/lib/chef/provider/env/windows.rb +23 -10
  117. data/lib/chef/provider/execute.rb +0 -3
  118. data/lib/chef/provider/file.rb +0 -3
  119. data/lib/chef/provider/git.rb +0 -6
  120. data/lib/chef/provider/group/dscl.rb +9 -27
  121. data/lib/chef/provider/group/gpasswd.rb +0 -3
  122. data/lib/chef/provider/group/groupmod.rb +0 -4
  123. data/lib/chef/provider/group/suse.rb +0 -3
  124. data/lib/chef/provider/group/usermod.rb +0 -3
  125. data/lib/chef/provider/link.rb +22 -5
  126. data/lib/chef/provider/log.rb +15 -4
  127. data/lib/chef/provider/mdadm.rb +0 -3
  128. data/lib/chef/provider/mount/mount.rb +0 -2
  129. data/lib/chef/provider/mount/solaris.rb +0 -2
  130. data/lib/chef/provider/package.rb +0 -1
  131. data/lib/chef/provider/package/apt.rb +0 -3
  132. data/lib/chef/provider/package/dpkg.rb +0 -1
  133. data/lib/chef/provider/package/easy_install.rb +0 -4
  134. data/lib/chef/provider/package/freebsd/base.rb +0 -3
  135. data/lib/chef/provider/package/freebsd/pkgng.rb +0 -2
  136. data/lib/chef/provider/package/freebsd/port.rb +0 -2
  137. data/lib/chef/provider/package/ips.rb +0 -3
  138. data/lib/chef/provider/package/paludis.rb +0 -5
  139. data/lib/chef/provider/package/portage.rb +0 -2
  140. data/lib/chef/provider/package/rpm.rb +2 -4
  141. data/lib/chef/provider/package/rubygems.rb +0 -4
  142. data/lib/chef/provider/package/smartos.rb +0 -3
  143. data/lib/chef/provider/package/windows/msi.rb +0 -2
  144. data/lib/chef/provider/package/yum.rb +0 -4
  145. data/lib/chef/provider/package/zypper.rb +0 -3
  146. data/lib/chef/provider/registry_key.rb +0 -2
  147. data/lib/chef/provider/remote_directory.rb +0 -1
  148. data/lib/chef/provider/remote_file.rb +0 -1
  149. data/lib/chef/provider/remote_file/cache_control_data.rb +1 -3
  150. data/lib/chef/provider/remote_file/content.rb +0 -1
  151. data/lib/chef/provider/remote_file/fetcher.rb +0 -2
  152. data/lib/chef/provider/remote_file/ftp.rb +0 -1
  153. data/lib/chef/provider/resource_update.rb +0 -3
  154. data/lib/chef/provider/service/freebsd.rb +0 -3
  155. data/lib/chef/provider/service/init.rb +0 -3
  156. data/lib/chef/provider/service/macosx.rb +0 -1
  157. data/lib/chef/provider/service/redhat.rb +0 -2
  158. data/lib/chef/provider/service/simple.rb +0 -3
  159. data/lib/chef/provider/service/solaris.rb +0 -3
  160. data/lib/chef/provider/service/systemd.rb +15 -14
  161. data/lib/chef/provider/service/windows.rb +0 -3
  162. data/lib/chef/provider/subversion.rb +0 -2
  163. data/lib/chef/provider/template.rb +0 -2
  164. data/lib/chef/provider/template/content.rb +0 -1
  165. data/lib/chef/provider/user/dscl.rb +156 -549
  166. data/lib/chef/provider/user/solaris.rb +0 -1
  167. data/lib/chef/provider/user/useradd.rb +0 -3
  168. data/lib/chef/provider/whyrun_safe_ruby_block.rb +1 -1
  169. data/lib/chef/providers.rb +0 -1
  170. data/lib/chef/resource.rb +1 -4
  171. data/lib/chef/resource/freebsd_package.rb +2 -10
  172. data/lib/chef/resource/lwrp_base.rb +1 -12
  173. data/lib/chef/resource/user.rb +0 -18
  174. data/lib/chef/resource_collection.rb +1 -1
  175. data/lib/chef/resource_reporter.rb +10 -10
  176. data/lib/chef/resources.rb +0 -1
  177. data/lib/chef/role.rb +3 -3
  178. data/lib/chef/run_list.rb +1 -1
  179. data/lib/chef/tasks/chef_repo.rake +131 -264
  180. data/lib/chef/user.rb +1 -1
  181. data/lib/chef/util/path_helper.rb +2 -2
  182. data/lib/chef/version.rb +9 -1
  183. data/lib/chef/win32/api/system.rb +0 -9
  184. data/spec/data/bootstrap/test-hints.erb +1 -1
  185. data/spec/data/bootstrap/test.erb +1 -1
  186. data/spec/functional/dsl/reboot_pending_spec.rb +53 -58
  187. data/spec/functional/knife/cookbook_delete_spec.rb +3 -3
  188. data/spec/functional/knife/exec_spec.rb +1 -1
  189. data/spec/functional/mixin/shell_out_spec.rb +48 -0
  190. data/spec/functional/resource/base.rb +0 -10
  191. data/spec/functional/resource/group_spec.rb +1 -5
  192. data/spec/functional/resource/link_spec.rb +8 -0
  193. data/spec/functional/resource/{user/useradd_spec.rb → user_spec.rb} +1 -1
  194. data/spec/integration/knife/chef_fs_data_store_spec.rb +3 -3
  195. data/spec/integration/knife/chef_repo_path_spec.rb +1 -6
  196. data/spec/integration/knife/chef_repository_file_system_spec.rb +1 -1
  197. data/spec/integration/knife/chefignore_spec.rb +1 -1
  198. data/spec/integration/knife/common_options_spec.rb +50 -3
  199. data/spec/integration/knife/cookbook_api_ipv6_spec.rb +1 -1
  200. data/spec/integration/knife/delete_spec.rb +1 -1
  201. data/spec/integration/knife/deps_spec.rb +1 -1
  202. data/spec/integration/knife/diff_spec.rb +3 -3
  203. data/spec/integration/knife/download_spec.rb +3 -3
  204. data/spec/integration/knife/list_spec.rb +1 -1
  205. data/spec/integration/knife/raw_spec.rb +1 -11
  206. data/spec/integration/knife/redirection_spec.rb +1 -1
  207. data/spec/integration/knife/serve_spec.rb +2 -2
  208. data/spec/integration/knife/show_spec.rb +1 -1
  209. data/spec/integration/knife/upload_spec.rb +9 -9
  210. data/spec/spec_helper.rb +0 -9
  211. data/spec/support/pedant/pedant_config.rb +2 -1
  212. data/spec/support/pedant/run_pedant.rb +2 -1
  213. data/spec/support/platform_helpers.rb +5 -24
  214. data/spec/support/shared/integration/integration_helper.rb +2 -1
  215. data/spec/support/shared/matchers.rb +17 -0
  216. data/spec/tiny_server.rb +1 -2
  217. data/spec/unit/api_client_spec.rb +3 -3
  218. data/spec/unit/application_spec.rb +9 -32
  219. data/spec/unit/config_fetcher_spec.rb +1 -1
  220. data/spec/unit/cookbook/metadata_spec.rb +3 -7
  221. data/spec/unit/cookbook/synchronizer_spec.rb +441 -226
  222. data/spec/unit/cookbook_loader_spec.rb +1 -1
  223. data/spec/unit/cookbook_uploader_spec.rb +160 -0
  224. data/spec/unit/cookbook_version_spec.rb +0 -4
  225. data/spec/unit/data_bag_item_spec.rb +1 -5
  226. data/spec/unit/data_bag_spec.rb +1 -5
  227. data/spec/unit/deprecation_spec.rb +1 -1
  228. data/spec/unit/dsl/recipe_spec.rb +12 -0
  229. data/spec/unit/encrypted_data_bag_item_spec.rb +7 -14
  230. data/spec/unit/environment_spec.rb +3 -7
  231. data/spec/unit/exceptions_spec.rb +0 -6
  232. data/spec/unit/http/json_input_spec.rb +128 -0
  233. data/spec/unit/json_compat_spec.rb +17 -58
  234. data/spec/unit/knife/client_create_spec.rb +3 -3
  235. data/spec/unit/knife/configure_client_spec.rb +6 -5
  236. data/spec/unit/knife/cookbook_delete_spec.rb +1 -1
  237. data/spec/unit/knife/cookbook_download_spec.rb +5 -5
  238. data/spec/unit/knife/cookbook_metadata_from_file_spec.rb +1 -0
  239. data/spec/unit/knife/cookbook_metadata_spec.rb +1 -1
  240. data/spec/unit/knife/cookbook_site_download_spec.rb +10 -11
  241. data/spec/unit/knife/cookbook_site_install_spec.rb +116 -161
  242. data/spec/unit/knife/cookbook_site_share_spec.rb +8 -8
  243. data/spec/unit/knife/cookbook_upload_spec.rb +3 -2
  244. data/spec/unit/knife/core/bootstrap_context_spec.rb +3 -3
  245. data/spec/unit/knife/core/subcommand_loader_spec.rb +1 -66
  246. data/spec/unit/knife/data_bag_from_file_spec.rb +2 -1
  247. data/spec/unit/knife/tag_create_spec.rb +3 -3
  248. data/spec/unit/knife/tag_delete_spec.rb +3 -3
  249. data/spec/unit/knife/user_create_spec.rb +1 -1
  250. data/spec/unit/knife_spec.rb +14 -14
  251. data/spec/unit/lwrp_spec.rb +1 -21
  252. data/spec/unit/mixin/shell_out_spec.rb +92 -0
  253. data/spec/unit/node_spec.rb +0 -4
  254. data/spec/unit/platform/query_helpers_spec.rb +0 -23
  255. data/spec/unit/provider/env/windows_spec.rb +34 -70
  256. data/spec/unit/provider/env_spec.rb +11 -76
  257. data/spec/unit/provider/group/dscl_spec.rb +1 -38
  258. data/spec/unit/provider/log_spec.rb +18 -0
  259. data/spec/unit/provider/package/rpm_spec.rb +0 -12
  260. data/spec/unit/provider/remote_file/cache_control_data_spec.rb +1 -1
  261. data/spec/unit/provider/service/systemd_service_spec.rb +44 -27
  262. data/spec/unit/provider/user/dscl_spec.rb +264 -660
  263. data/spec/unit/provider/user/useradd_spec.rb +0 -1
  264. data/spec/unit/provider/whyrun_safe_ruby_block_spec.rb +2 -2
  265. data/spec/unit/provider_spec.rb +12 -0
  266. data/spec/unit/recipe_spec.rb +0 -41
  267. data/spec/unit/resource_collection_spec.rb +1 -5
  268. data/spec/unit/resource_reporter_spec.rb +3 -51
  269. data/spec/unit/resource_spec.rb +3 -14
  270. data/spec/unit/rest_spec.rb +1 -4
  271. data/spec/unit/role_spec.rb +0 -10
  272. data/spec/unit/run_list_spec.rb +1 -5
  273. data/spec/unit/user_spec.rb +1 -5
  274. metadata +20 -100
  275. data/lib/chef/mixin/windows_env_helper.rb +0 -56
  276. data/lib/chef/provider/dsc_script.rb +0 -175
  277. data/lib/chef/resource/dsc_script.rb +0 -126
  278. data/lib/chef/streaming_cookbook_uploader.rb +0 -205
  279. data/lib/chef/util/dsc/configuration_generator.rb +0 -115
  280. data/lib/chef/util/dsc/lcm_output_parser.rb +0 -133
  281. data/lib/chef/util/dsc/local_configuration_manager.rb +0 -141
  282. data/lib/chef/util/dsc/resource_info.rb +0 -26
  283. data/lib/chef/util/powershell/cmdlet.rb +0 -136
  284. data/lib/chef/util/powershell/cmdlet_result.rb +0 -46
  285. data/spec/data/mac_users/10.7-8.plist.xml +0 -559
  286. data/spec/data/mac_users/10.7-8.shadow.xml +0 -11
  287. data/spec/data/mac_users/10.7.plist.xml +0 -559
  288. data/spec/data/mac_users/10.7.shadow.xml +0 -11
  289. data/spec/data/mac_users/10.8.plist.xml +0 -559
  290. data/spec/data/mac_users/10.8.shadow.xml +0 -21
  291. data/spec/data/mac_users/10.9.plist.xml +0 -560
  292. data/spec/data/mac_users/10.9.shadow.xml +0 -21
  293. data/spec/functional/provider/whyrun_safe_ruby_block_spec.rb +0 -51
  294. data/spec/functional/resource/dsc_script_spec.rb +0 -382
  295. data/spec/functional/resource/env_spec.rb +0 -182
  296. data/spec/functional/resource/user/dscl_spec.rb +0 -199
  297. data/spec/functional/util/powershell/cmdlet_spec.rb +0 -113
  298. data/spec/support/lib/chef/resource/zen_follower.rb +0 -46
  299. data/spec/support/shared/shared_examples.rb +0 -10
  300. data/spec/unit/chef_fs/data_handler/group_handler_spec.rb +0 -63
  301. data/spec/unit/formatters/base_spec.rb +0 -48
  302. data/spec/unit/provider/dsc_script_spec.rb +0 -174
  303. data/spec/unit/resource/dsc_script_spec.rb +0 -98
  304. data/spec/unit/util/dsc/configuration_generator_spec.rb +0 -171
  305. data/spec/unit/util/dsc/lcm_output_parser_spec.rb +0 -169
  306. data/spec/unit/util/dsc/local_configuration_manager_spec.rb +0 -139
  307. data/spec/unit/util/powershell/cmdlet_spec.rb +0 -106
@@ -17,15 +17,12 @@
17
17
  #
18
18
 
19
19
  require 'chef/provider/group/groupadd'
20
- require 'chef/mixin/shell_out'
21
20
 
22
21
  class Chef
23
22
  class Provider
24
23
  class Group
25
24
  class Usermod < Chef::Provider::Group::Groupadd
26
25
 
27
- include Chef::Mixin::ShellOut
28
-
29
26
  def load_current_resource
30
27
  super
31
28
  end
@@ -18,7 +18,6 @@
18
18
 
19
19
  require 'chef/config'
20
20
  require 'chef/log'
21
- require 'chef/mixin/shell_out'
22
21
  require 'chef/mixin/file_class'
23
22
  require 'chef/resource/link'
24
23
  require 'chef/provider'
@@ -29,7 +28,6 @@ class Chef
29
28
  class Link < Chef::Provider
30
29
 
31
30
  include Chef::Mixin::EnforceOwnershipAndPermissions
32
- include Chef::Mixin::ShellOut
33
31
  include Chef::Mixin::FileClass
34
32
 
35
33
  def negative_complement(big)
@@ -89,11 +87,30 @@ class Chef
89
87
  end
90
88
 
91
89
  def action_create
90
+ # current_resource is the symlink that currently exists
91
+ # new_resource is the symlink we need to create
92
+ # to - the location to link to
93
+ # target_file - the name of the link
94
+
92
95
  if @current_resource.to != canonicalize(@new_resource.to) ||
93
96
  @current_resource.link_type != @new_resource.link_type
94
- if @current_resource.to # nil if target_file does not exist
95
- converge_by("unlink existing file at #{@new_resource.target_file}") do
96
- ::File.unlink(@new_resource.target_file)
97
+ # Handle the case where the symlink already exists and is pointing at a valid to_file
98
+ if @current_resource.to
99
+ # On Windows, to fix a symlink already pointing at a directory we must first
100
+ # ::Dir.unlink the symlink (not the directory), while if we have a symlink
101
+ # pointing at file we must use ::File.unlink on the symlink.
102
+ # However if the new symlink will point to a file and the current symlink is pointing at a
103
+ # directory we want to throw an exception and calling ::File.unlink on the directory symlink
104
+ # will throw the correct ones.
105
+ if Chef::Platform.windows? && ::File.directory?(@new_resource.to) &&
106
+ ::File.directory?(@current_resource.target_file)
107
+ converge_by("unlink existing windows symlink to dir at #{@new_resource.target_file}") do
108
+ ::Dir.unlink(@new_resource.target_file)
109
+ end
110
+ else
111
+ converge_by("unlink existing symlink to file at #{@new_resource.target_file}") do
112
+ ::File.unlink(@new_resource.target_file)
113
+ end
97
114
  end
98
115
  end
99
116
  if @new_resource.link_type == :symbolic
@@ -25,6 +25,9 @@ class Chef
25
25
  # Chef log provider, allows logging to chef's logs from recipes
26
26
  class ChefLog < Chef::Provider
27
27
 
28
+ # ordered array of the log levels
29
+ @@levels = [ :debug, :info, :warn, :error, :fatal ]
30
+
28
31
  # No concept of a 'current' resource for logs, this is a no-op
29
32
  #
30
33
  # === Return
@@ -39,7 +42,18 @@ class Chef
39
42
  # true:: Always return true
40
43
  def action_write
41
44
  Chef::Log.send(@new_resource.level, @new_resource.message)
42
- @new_resource.updated_by_last_action(true)
45
+
46
+ # resolve the integers for the current log levels
47
+ global_level = Mixlib::Log::LEVELS.fetch(Chef::Log.level)
48
+ resource_level = Mixlib::Log::LEVELS.fetch(@new_resource.level)
49
+
50
+ # If the resource level is greater than or the same os the global
51
+ # level, then it should have been written to the log. Mark the
52
+ # resource as updated.
53
+ if resource_level >= global_level
54
+ @new_resource.updated_by_last_action(true)
55
+ end
56
+
43
57
  end
44
58
 
45
59
  end
@@ -49,6 +63,3 @@ class Chef
49
63
  end
50
64
 
51
65
  end
52
-
53
-
54
-
@@ -17,15 +17,12 @@
17
17
  #
18
18
 
19
19
  require 'chef/log'
20
- require 'chef/mixin/shell_out'
21
20
  require 'chef/provider'
22
21
 
23
22
  class Chef
24
23
  class Provider
25
24
  class Mdadm < Chef::Provider
26
25
 
27
- include Chef::Mixin::ShellOut
28
-
29
26
  def popen4
30
27
  raise Exception, "deprecated"
31
28
  end
@@ -18,13 +18,11 @@
18
18
 
19
19
  require 'chef/provider/mount'
20
20
  require 'chef/log'
21
- require 'chef/mixin/shell_out'
22
21
 
23
22
  class Chef
24
23
  class Provider
25
24
  class Mount
26
25
  class Mount < Chef::Provider::Mount
27
- include Chef::Mixin::ShellOut
28
26
 
29
27
  def initialize(new_resource, run_context)
30
28
  super
@@ -20,14 +20,12 @@
20
20
 
21
21
  require 'chef/provider/mount'
22
22
  require 'chef/log'
23
- require 'chef/mixin/shell_out'
24
23
  require 'forwardable'
25
24
 
26
25
  class Chef
27
26
  class Provider
28
27
  class Mount
29
28
  class Solaris < Chef::Provider::Mount
30
- include Chef::Mixin::ShellOut
31
29
  extend Forwardable
32
30
 
33
31
  VFSTAB = "/etc/vfstab".freeze
@@ -198,7 +198,6 @@ class Chef
198
198
 
199
199
  Chef::Log.debug("#{@new_resource} fetching preseed file to #{cache_seed_to}")
200
200
 
201
-
202
201
  if template_available?(@new_resource.response_file)
203
202
  Chef::Log.debug("#{@new_resource} fetching preseed file via Template")
204
203
  remote_file = Chef::Resource::Template.new(cache_seed_to, run_context)
@@ -19,15 +19,12 @@
19
19
  require 'chef/provider/package'
20
20
  require 'chef/mixin/command'
21
21
  require 'chef/resource/package'
22
- require 'chef/mixin/shell_out'
23
-
24
22
 
25
23
  class Chef
26
24
  class Provider
27
25
  class Package
28
26
  class Apt < Chef::Provider::Package
29
27
 
30
- include Chef::Mixin::ShellOut
31
28
  attr_accessor :is_virtual_package
32
29
 
33
30
  def load_current_resource
@@ -31,7 +31,6 @@ class Chef
31
31
  DPKG_VERSION = /^Version: (.+)$/
32
32
 
33
33
  include Chef::Mixin::GetSourceFromPackage
34
- include Chef::Mixin::ShellOut
35
34
 
36
35
  def define_resource_requirements
37
36
  super
@@ -18,17 +18,13 @@
18
18
 
19
19
  require 'chef/provider/package'
20
20
  require 'chef/mixin/command'
21
- require 'chef/mixin/shell_out'
22
21
  require 'chef/resource/package'
23
- require 'chef/mixin/shell_out'
24
22
 
25
23
  class Chef
26
24
  class Provider
27
25
  class Package
28
26
  class EasyInstall < Chef::Provider::Package
29
27
 
30
- include Chef::Mixin::ShellOut
31
-
32
28
  def install_check(name)
33
29
  check = false
34
30
 
@@ -21,7 +21,6 @@
21
21
 
22
22
  require 'chef/resource/package'
23
23
  require 'chef/provider/package'
24
- require 'chef/mixin/shell_out'
25
24
  require 'chef/mixin/get_source_from_package'
26
25
 
27
26
  class Chef
@@ -63,9 +62,7 @@ class Chef
63
62
  end
64
63
  end
65
64
 
66
-
67
65
  class Base < Chef::Provider::Package
68
- include Chef::Mixin::ShellOut
69
66
  include Chef::Mixin::GetSourceFromPackage
70
67
 
71
68
  def initialize(*args)
@@ -52,8 +52,6 @@ class Chef
52
52
  @new_resource.source ? file_candidate_version : repo_candidate_version
53
53
  end
54
54
 
55
-
56
-
57
55
  private
58
56
 
59
57
  def file_candidate_version
@@ -54,8 +54,6 @@ class Chef
54
54
  super(@new_resource.package_name)
55
55
  end
56
56
 
57
-
58
-
59
57
  private
60
58
 
61
59
  def supports_pkgng?
@@ -21,14 +21,12 @@ require 'open3'
21
21
  require 'chef/provider/package'
22
22
  require 'chef/mixin/command'
23
23
  require 'chef/resource/package'
24
- require 'chef/mixin/shell_out'
25
24
 
26
25
  class Chef
27
26
  class Provider
28
27
  class Package
29
28
  class Ips < Chef::Provider::Package
30
29
 
31
- include Chef::Mixin::ShellOut
32
30
  attr_accessor :virtual
33
31
 
34
32
  def define_resource_requirements
@@ -98,4 +96,3 @@ class Chef
98
96
  end
99
97
  end
100
98
  end
101
-
@@ -18,15 +18,12 @@
18
18
 
19
19
  require 'chef/provider/package'
20
20
  require 'chef/resource/package'
21
- require 'chef/mixin/shell_out'
22
21
 
23
22
  class Chef
24
23
  class Provider
25
24
  class Package
26
25
  class Paludis < Chef::Provider::Package
27
26
 
28
- include Chef::Mixin::ShellOut
29
-
30
27
  def load_current_resource
31
28
  @current_resource = Chef::Resource::Package.new(@new_resource.package_name)
32
29
  @current_resource.package_name(@new_resource.package_name)
@@ -87,5 +84,3 @@ class Chef
87
84
  end
88
85
  end
89
86
  end
90
-
91
-
@@ -55,7 +55,6 @@ class Chef
55
55
  @current_resource
56
56
  end
57
57
 
58
-
59
58
  def parse_emerge(package, txt)
60
59
  availables = {}
61
60
  found_package_name = nil
@@ -103,7 +102,6 @@ class Chef
103
102
 
104
103
  end
105
104
 
106
-
107
105
  def install_package(name, version)
108
106
  pkg = "=#{name}-#{version}"
109
107
 
@@ -60,7 +60,7 @@ class Chef
60
60
  status = popen4("rpm -qp --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@new_resource.source}") do |pid, stdin, stdout, stderr|
61
61
  stdout.each do |line|
62
62
  case line
63
- when /^([\w\d+_.-]+)\s([\w\d_.-]+)$/
63
+ when /([\w\d+_.-]+)\s([\w\d_.-]+)/
64
64
  @current_resource.package_name($1)
65
65
  @new_resource.version($2)
66
66
  @candidate_version = $2
@@ -78,14 +78,13 @@ class Chef
78
78
  @rpm_status = popen4("rpm -q --queryformat '%{NAME} %{VERSION}-%{RELEASE}\n' #{@current_resource.package_name}") do |pid, stdin, stdout, stderr|
79
79
  stdout.each do |line|
80
80
  case line
81
- when /^([\w\d+_.-]+)\s([\w\d_.-]+)$/
81
+ when /([\w\d+_.-]+)\s([\w\d_.-]+)/
82
82
  Chef::Log.debug("#{@new_resource} current version is #{$2}")
83
83
  @current_resource.version($2)
84
84
  end
85
85
  end
86
86
  end
87
87
 
88
-
89
88
  @current_resource
90
89
  end
91
90
 
@@ -119,4 +118,3 @@ class Chef
119
118
  end
120
119
  end
121
120
  end
122
-
@@ -273,8 +273,6 @@ class Chef
273
273
  @platform_cache ||= {}
274
274
  end
275
275
 
276
- include Chef::Mixin::ShellOut
277
-
278
276
  attr_reader :gem_binary_location
279
277
 
280
278
  def initialize(gem_binary_location)
@@ -352,8 +350,6 @@ class Chef
352
350
 
353
351
  end
354
352
 
355
- include Chef::Mixin::ShellOut
356
-
357
353
  attr_reader :gem_env
358
354
  attr_reader :cleanup_gem_env
359
355
 
@@ -20,7 +20,6 @@
20
20
  #
21
21
 
22
22
  require 'chef/provider/package'
23
- require 'chef/mixin/shell_out'
24
23
  require 'chef/resource/package'
25
24
  require 'chef/mixin/get_source_from_package'
26
25
 
@@ -28,10 +27,8 @@ class Chef
28
27
  class Provider
29
28
  class Package
30
29
  class SmartOS < Chef::Provider::Package
31
- include Chef::Mixin::ShellOut
32
30
  attr_accessor :is_virtual_package
33
31
 
34
-
35
32
  def load_current_resource
36
33
  Chef::Log.debug("#{@new_resource} loading current resource")
37
34
  @current_resource = Chef::Resource::Package.new(@new_resource.name)
@@ -18,7 +18,6 @@
18
18
 
19
19
  # TODO: Allow @new_resource.source to be a Product Code as a GUID for uninstall / network install
20
20
 
21
- require 'chef/mixin/shell_out'
22
21
  require 'chef/win32/api/installer' if RUBY_PLATFORM =~ /mswin|mingw32|windows/
23
22
 
24
23
  class Chef
@@ -27,7 +26,6 @@ class Chef
27
26
  class Windows
28
27
  class MSI
29
28
  include Chef::ReservedNames::Win32::API::Installer if RUBY_PLATFORM =~ /mswin|mingw32|windows/
30
- include Chef::Mixin::ShellOut
31
29
 
32
30
  def initialize(resource)
33
31
  @new_resource = resource
@@ -19,12 +19,10 @@
19
19
  require 'chef/config'
20
20
  require 'chef/provider/package'
21
21
  require 'chef/mixin/command'
22
- require 'chef/mixin/shell_out'
23
22
  require 'chef/resource/package'
24
23
  require 'singleton'
25
24
  require 'chef/mixin/get_source_from_package'
26
25
 
27
-
28
26
  class Chef
29
27
  class Provider
30
28
  class Package
@@ -647,7 +645,6 @@ class Chef
647
645
  # Cache for our installed and available packages, pulled in from yum-dump.py
648
646
  class YumCache
649
647
  include Chef::Mixin::Command
650
- include Chef::Mixin::ShellOut
651
648
  include Singleton
652
649
 
653
650
  def initialize
@@ -949,7 +946,6 @@ class Chef
949
946
  end # YumCache
950
947
 
951
948
  include Chef::Mixin::GetSourceFromPackage
952
- include Chef::Mixin::ShellOut
953
949
 
954
950
  def initialize(new_resource, run_context)
955
951
  super
@@ -22,7 +22,6 @@
22
22
  require 'chef/provider/package'
23
23
  require 'chef/mixin/command'
24
24
  require 'chef/resource/package'
25
- require 'chef/mixin/shell_out'
26
25
  require 'singleton'
27
26
 
28
27
  class Chef
@@ -30,8 +29,6 @@ class Chef
30
29
  class Package
31
30
  class Zypper < Chef::Provider::Package
32
31
 
33
- include Chef::Mixin::ShellOut
34
-
35
32
  def load_current_resource
36
33
  @current_resource = Chef::Resource::Package.new(@new_resource.name)
37
34
  @current_resource.package_name(@new_resource.package_name)
@@ -25,7 +25,6 @@ require 'chef/provider'
25
25
  require 'etc'
26
26
  require 'fileutils'
27
27
  require 'chef/scan_access_control'
28
- require 'chef/mixin/shell_out'
29
28
  require 'chef/win32/registry'
30
29
 
31
30
  class Chef
@@ -33,7 +32,6 @@ class Chef
33
32
  class Provider
34
33
  class RegistryKey < Chef::Provider
35
34
  include Chef::Mixin::Checksum
36
- include Chef::Mixin::ShellOut
37
35
 
38
36
  def whyrun_supported?
39
37
  true
@@ -40,7 +40,6 @@ class Chef
40
40
  name !~ /(?:^|#{Regexp.escape(::File::SEPARATOR)})\.\.?$/
41
41
  end)
42
42
 
43
-
44
43
  files_to_transfer.each do |cookbook_file_relative_path|
45
44
  create_cookbook_file(cookbook_file_relative_path)
46
45
  # the file is removed from the purge list