vagrant-clone 0.0.1 → 0.0.3

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 (306) hide show
  1. checksums.yaml +4 -4
  2. data/.idea/.rakeTasks +7 -0
  3. data/.idea/inspectionProfiles/Project_Default.xml +6 -0
  4. data/.idea/misc.xml +4 -0
  5. data/.idea/modules.xml +8 -0
  6. data/.idea/runConfigurations/clone.xml +21 -0
  7. data/.idea/runConfigurations/libvirt.xml +21 -0
  8. data/.idea/vagrant-clone.iml +114 -0
  9. data/.idea/vcs.xml +6 -0
  10. data/.idea/workspace.xml +948 -0
  11. data/Gemfile +9 -3
  12. data/Gemfile.lock +123 -37
  13. data/Rakefile +2 -1
  14. data/Vagrantfile +9 -0
  15. data/cookbooks/apt/CHANGELOG.md +321 -0
  16. data/cookbooks/apt/CONTRIBUTING.md +2 -0
  17. data/cookbooks/apt/MAINTAINERS.md +15 -0
  18. data/cookbooks/apt/README.md +250 -0
  19. data/cookbooks/apt/attributes/default.rb +57 -0
  20. data/cookbooks/apt/files/15update-stamp +1 -0
  21. data/cookbooks/apt/files/apt-proxy-v2.conf +50 -0
  22. data/cookbooks/apt/libraries/helpers.rb +49 -0
  23. data/cookbooks/apt/libraries/matchers.rb +16 -0
  24. data/cookbooks/apt/metadata.json +1 -0
  25. data/cookbooks/apt/recipes/cacher-client.rb +52 -0
  26. data/cookbooks/apt/recipes/cacher-ng.rb +39 -0
  27. data/cookbooks/apt/recipes/default.rb +93 -0
  28. data/cookbooks/apt/recipes/unattended-upgrades.rb +47 -0
  29. data/cookbooks/apt/resources/preference.rb +90 -0
  30. data/cookbooks/apt/templates/01proxy.erb +11 -0
  31. data/cookbooks/apt/templates/10dpkg-options.erb +8 -0
  32. data/cookbooks/apt/templates/10recommends.erb +3 -0
  33. data/cookbooks/apt/templates/20auto-upgrades.erb +5 -0
  34. data/cookbooks/apt/templates/50unattended-upgrades.erb +75 -0
  35. data/cookbooks/apt/templates/acng.conf.erb +275 -0
  36. data/cookbooks/apt/templates/unattended-upgrades.seed.erb +1 -0
  37. data/cookbooks/build-essential/.foodcritic +1 -0
  38. data/cookbooks/build-essential/CHANGELOG.md +257 -0
  39. data/cookbooks/build-essential/CONTRIBUTING.md +2 -0
  40. data/cookbooks/build-essential/MAINTAINERS.md +15 -0
  41. data/cookbooks/build-essential/README.md +134 -0
  42. data/cookbooks/build-essential/attributes/default.rb +21 -0
  43. data/cookbooks/build-essential/libraries/matchers.rb +9 -0
  44. data/cookbooks/build-essential/metadata.json +1 -0
  45. data/cookbooks/build-essential/recipes/_windows.rb +53 -0
  46. data/cookbooks/build-essential/recipes/default.rb +24 -0
  47. data/cookbooks/build-essential/resources/build_essential.rb +106 -0
  48. data/cookbooks/build-essential/resources/xcode_command_line_tools.rb +61 -0
  49. data/cookbooks/compat_resource/CHANGELOG.md +53 -0
  50. data/cookbooks/compat_resource/CONTRIBUTING.md +2 -0
  51. data/cookbooks/compat_resource/MAINTAINERS.md +16 -0
  52. data/cookbooks/compat_resource/README.md +60 -0
  53. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/constants.rb +47 -0
  54. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/delayed_evaluator.rb +40 -0
  55. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/core.rb +73 -0
  56. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/declare_resource.rb +315 -0
  57. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/platform_introspection.rb +292 -0
  58. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/recipe.rb +37 -0
  59. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/dsl/universal.rb +70 -0
  60. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/lazy_module_include.rb +98 -0
  61. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/notifying_block.rb +74 -0
  62. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/params_validate.rb +510 -0
  63. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/powershell_out.rb +117 -0
  64. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/mixin/properties.rb +328 -0
  65. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/property.rb +713 -0
  66. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_repository.rb +269 -0
  67. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/apt_update.rb +105 -0
  68. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/noop.rb +56 -0
  69. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/support/yum_repo.erb +132 -0
  70. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/systemd_unit.rb +253 -0
  71. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider/yum_repository.rb +136 -0
  72. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/provider.rb +164 -0
  73. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/action_class.rb +114 -0
  74. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_repository.rb +65 -0
  75. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/apt_update.rb +52 -0
  76. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/systemd_unit.rb +81 -0
  77. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource/yum_repository.rb +97 -0
  78. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource.rb +214 -0
  79. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef/chef/resource_builder.rb +174 -0
  80. data/cookbooks/compat_resource/files/lib/chef_compat/copied_from_chef.rb +29 -0
  81. data/cookbooks/compat_resource/files/lib/chef_compat/mixin/properties.rb +8 -0
  82. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/exceptions.rb +10 -0
  83. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/log.rb +30 -0
  84. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/mixin/params_validate.rb +17 -0
  85. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/node.rb +9 -0
  86. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/property.rb +15 -0
  87. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/provider.rb +65 -0
  88. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe.rb +118 -0
  89. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/recipe_hook.rb +20 -0
  90. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource/lwrp_base.rb +60 -0
  91. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource.rb +156 -0
  92. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_builder.rb +167 -0
  93. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_list.rb +49 -0
  94. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection/resource_set.rb +49 -0
  95. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/resource_collection.rb +103 -0
  96. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/run_context.rb +691 -0
  97. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb +153 -0
  98. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef.rb +33 -0
  99. data/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches.rb +41 -0
  100. data/cookbooks/compat_resource/files/lib/chef_compat/property.rb +6 -0
  101. data/cookbooks/compat_resource/files/lib/chef_compat/recipe.rb +8 -0
  102. data/cookbooks/compat_resource/files/lib/chef_compat/resource/lwrp_base.rb +44 -0
  103. data/cookbooks/compat_resource/files/lib/chef_compat/resource.rb +56 -0
  104. data/cookbooks/compat_resource/files/lib/chef_upstream_version.rb +3 -0
  105. data/cookbooks/compat_resource/files/lib/compat_resource.rb +35 -0
  106. data/cookbooks/compat_resource/libraries/autoload.rb +31 -0
  107. data/cookbooks/compat_resource/metadata.json +1 -0
  108. data/cookbooks/inifile_chef_gem/CHANGELOG.md +11 -0
  109. data/cookbooks/inifile_chef_gem/README.md +46 -0
  110. data/cookbooks/inifile_chef_gem/metadata.json +51 -0
  111. data/cookbooks/inifile_chef_gem/metadata.rb +11 -0
  112. data/cookbooks/inifile_chef_gem/resources/default.rb +28 -0
  113. data/cookbooks/mariadb/CHANGELOG.md +332 -0
  114. data/cookbooks/mariadb/README.md +225 -0
  115. data/cookbooks/mariadb/attributes/default.rb +199 -0
  116. data/cookbooks/mariadb/libraries/mariadb_conn_helper.rb +53 -0
  117. data/cookbooks/mariadb/libraries/mariadb_helper.rb +216 -0
  118. data/cookbooks/mariadb/libraries/matchers.rb +21 -0
  119. data/cookbooks/mariadb/metadata.json +1 -0
  120. data/cookbooks/mariadb/providers/configuration.rb +39 -0
  121. data/cookbooks/mariadb/recipes/_audit_plugin.rb +63 -0
  122. data/cookbooks/mariadb/recipes/_debian_galera.rb +62 -0
  123. data/cookbooks/mariadb/recipes/_debian_server.rb +78 -0
  124. data/cookbooks/mariadb/recipes/_mariadb_repository.rb +29 -0
  125. data/cookbooks/mariadb/recipes/_redhat_client.rb +27 -0
  126. data/cookbooks/mariadb/recipes/_redhat_galera.rb +55 -0
  127. data/cookbooks/mariadb/recipes/_redhat_server.rb +58 -0
  128. data/cookbooks/mariadb/recipes/client.rb +47 -0
  129. data/cookbooks/mariadb/recipes/config.rb +115 -0
  130. data/cookbooks/mariadb/recipes/default.rb +46 -0
  131. data/cookbooks/mariadb/recipes/devel.rb +41 -0
  132. data/cookbooks/mariadb/recipes/galera.rb +324 -0
  133. data/cookbooks/mariadb/recipes/plugins.rb +3 -0
  134. data/cookbooks/mariadb/recipes/repository.rb +45 -0
  135. data/cookbooks/mariadb/recipes/server.rb +157 -0
  136. data/cookbooks/mariadb/resources/configuration.rb +13 -0
  137. data/cookbooks/mariadb/resources/mysql2_gem.rb +25 -0
  138. data/cookbooks/mariadb/resources/replication.rb +192 -0
  139. data/cookbooks/mariadb/templates/default/conf.d.generic.erb +19 -0
  140. data/cookbooks/mariadb/templates/default/debian.cnf.erb +12 -0
  141. data/cookbooks/mariadb/templates/default/mariadb-server.seed.erb +13 -0
  142. data/cookbooks/mariadb/templates/default/mariadb_grants.erb +42 -0
  143. data/cookbooks/mariadb/templates/default/my.cnf.erb +210 -0
  144. data/cookbooks/mariadb/templates/default/root.cnf.erb +5 -0
  145. data/cookbooks/mingw/.foodcritic +1 -0
  146. data/cookbooks/mingw/CHANGELOG.md +50 -0
  147. data/cookbooks/mingw/CONTRIBUTING.md +2 -0
  148. data/cookbooks/mingw/MAINTAINERS.md +14 -0
  149. data/cookbooks/mingw/README.md +133 -0
  150. data/cookbooks/mingw/files/default/bash.bat +17 -0
  151. data/cookbooks/mingw/files/default/custom-upgrade.sh +23 -0
  152. data/cookbooks/mingw/files/default/custom_prefix.sh +13 -0
  153. data/cookbooks/mingw/files/default/pthread.h +719 -0
  154. data/cookbooks/mingw/files/default/time.h +297 -0
  155. data/cookbooks/mingw/libraries/_helper.rb +38 -0
  156. data/cookbooks/mingw/metadata.json +1 -0
  157. data/cookbooks/mingw/recipes/default.rb +19 -0
  158. data/cookbooks/mingw/resources/get.rb +56 -0
  159. data/cookbooks/mingw/resources/msys2_package.rb +139 -0
  160. data/cookbooks/mingw/resources/tdm_gcc.rb +114 -0
  161. data/cookbooks/ohai/.foodcritic +2 -0
  162. data/cookbooks/ohai/CHANGELOG.md +166 -0
  163. data/cookbooks/ohai/CONTRIBUTING.md +2 -0
  164. data/cookbooks/ohai/MAINTAINERS.md +15 -0
  165. data/cookbooks/ohai/README.md +134 -0
  166. data/cookbooks/ohai/libraries/matchers.rb +41 -0
  167. data/cookbooks/ohai/metadata.json +1 -0
  168. data/cookbooks/ohai/recipes/default.rb +20 -0
  169. data/cookbooks/ohai/resources/hint.rb +55 -0
  170. data/cookbooks/ohai/resources/plugin.rb +117 -0
  171. data/cookbooks/selinux_policy/.gitignore +51 -0
  172. data/cookbooks/selinux_policy/.kitchen.yml +25 -0
  173. data/cookbooks/selinux_policy/.rubocop.yml +2 -0
  174. data/cookbooks/selinux_policy/.travis.yml +26 -0
  175. data/cookbooks/selinux_policy/Berksfile +8 -0
  176. data/cookbooks/selinux_policy/CHANGELOG.md +155 -0
  177. data/cookbooks/selinux_policy/LICENSE +13 -0
  178. data/cookbooks/selinux_policy/README.md +217 -0
  179. data/cookbooks/selinux_policy/Rakefile +68 -0
  180. data/cookbooks/selinux_policy/TESTING.md +2 -0
  181. data/cookbooks/selinux_policy/Thorfile +12 -0
  182. data/cookbooks/selinux_policy/attributes/default.rb +5 -0
  183. data/cookbooks/selinux_policy/chefignore +102 -0
  184. data/cookbooks/selinux_policy/libraries/helper-disabled.rb +29 -0
  185. data/cookbooks/selinux_policy/libraries/matchers.rb +57 -0
  186. data/cookbooks/selinux_policy/metadata.json +58 -0
  187. data/cookbooks/selinux_policy/metadata.rb +20 -0
  188. data/cookbooks/selinux_policy/providers/boolean.rb +28 -0
  189. data/cookbooks/selinux_policy/providers/fcontext.rb +78 -0
  190. data/cookbooks/selinux_policy/providers/module.rb +81 -0
  191. data/cookbooks/selinux_policy/providers/permissive.rb +26 -0
  192. data/cookbooks/selinux_policy/providers/port.rb +58 -0
  193. data/cookbooks/selinux_policy/recipes/default.rb +9 -0
  194. data/cookbooks/selinux_policy/recipes/install.rb +32 -0
  195. data/cookbooks/selinux_policy/resources/boolean.rb +8 -0
  196. data/cookbooks/selinux_policy/resources/fcontext.rb +8 -0
  197. data/cookbooks/selinux_policy/resources/module.rb +21 -0
  198. data/cookbooks/selinux_policy/resources/permissive.rb +6 -0
  199. data/cookbooks/selinux_policy/resources/port.rb +9 -0
  200. data/cookbooks/seven_zip/CHANGELOG.md +30 -0
  201. data/cookbooks/seven_zip/README.md +108 -0
  202. data/cookbooks/seven_zip/attributes/default.rb +31 -0
  203. data/cookbooks/seven_zip/libraries/matchers.rb +33 -0
  204. data/cookbooks/seven_zip/metadata.json +1 -0
  205. data/cookbooks/seven_zip/providers/archive.rb +68 -0
  206. data/cookbooks/seven_zip/recipes/default.rb +41 -0
  207. data/cookbooks/seven_zip/resources/archive.rb +29 -0
  208. data/cookbooks/windows/.foodcritic +2 -0
  209. data/cookbooks/windows/CHANGELOG.md +528 -0
  210. data/cookbooks/windows/CONTRIBUTING.md +2 -0
  211. data/cookbooks/windows/MAINTAINERS.md +21 -0
  212. data/cookbooks/windows/README.md +803 -0
  213. data/cookbooks/windows/attributes/default.rb +21 -0
  214. data/cookbooks/windows/files/dism_features.rb +45 -0
  215. data/cookbooks/windows/libraries/matchers.rb +586 -0
  216. data/cookbooks/windows/libraries/powershell_helper.rb +53 -0
  217. data/cookbooks/windows/libraries/registry_helper.rb +356 -0
  218. data/cookbooks/windows/libraries/version.rb +207 -0
  219. data/cookbooks/windows/libraries/version_helper.rb +79 -0
  220. data/cookbooks/windows/libraries/windows_helper.rb +174 -0
  221. data/cookbooks/windows/libraries/windows_privileged.rb +103 -0
  222. data/cookbooks/windows/libraries/wmi_helper.rb +32 -0
  223. data/cookbooks/windows/metadata.json +1 -0
  224. data/cookbooks/windows/recipes/default.rb +21 -0
  225. data/cookbooks/windows/resources/auto_run.rb +46 -0
  226. data/cookbooks/windows/resources/certificate.rb +166 -0
  227. data/cookbooks/windows/resources/certificate_binding.rb +128 -0
  228. data/cookbooks/windows/resources/feature.rb +82 -0
  229. data/cookbooks/windows/resources/feature_dism.rb +108 -0
  230. data/cookbooks/windows/resources/feature_powershell.rb +70 -0
  231. data/cookbooks/windows/resources/feature_servermanagercmd.rb +76 -0
  232. data/cookbooks/windows/resources/font.rb +80 -0
  233. data/cookbooks/windows/resources/http_acl.rb +110 -0
  234. data/cookbooks/windows/resources/pagefile.rb +152 -0
  235. data/cookbooks/windows/resources/path.rb +54 -0
  236. data/cookbooks/windows/resources/printer.rb +103 -0
  237. data/cookbooks/windows/resources/printer_port.rb +101 -0
  238. data/cookbooks/windows/resources/share.rb +291 -0
  239. data/cookbooks/windows/resources/shortcut.rb +53 -0
  240. data/cookbooks/windows/resources/task.rb +384 -0
  241. data/cookbooks/windows/resources/zipfile.rb +125 -0
  242. data/cookbooks/yum/.foodcritic +1 -0
  243. data/cookbooks/yum/CHANGELOG.md +351 -0
  244. data/cookbooks/yum/CONTRIBUTING.md +2 -0
  245. data/cookbooks/yum/MAINTAINERS.md +16 -0
  246. data/cookbooks/yum/README.md +125 -0
  247. data/cookbooks/yum/attributes/main.rb +103 -0
  248. data/cookbooks/yum/libraries/matchers.rb +9 -0
  249. data/cookbooks/yum/metadata.json +1 -0
  250. data/cookbooks/yum/recipes/default.rb +26 -0
  251. data/cookbooks/yum/recipes/dnf_yum_compat.rb +29 -0
  252. data/cookbooks/yum/resources/globalconfig.rb +119 -0
  253. data/cookbooks/yum/templates/.DS_Store +0 -0
  254. data/cookbooks/yum/templates/main.erb +276 -0
  255. data/cookbooks/yum-epel/CHANGELOG.md +138 -0
  256. data/cookbooks/yum-epel/CONTRIBUTING.md +2 -0
  257. data/cookbooks/yum-epel/MAINTAINERS.md +19 -0
  258. data/cookbooks/yum-epel/README.md +172 -0
  259. data/cookbooks/yum-epel/attributes/default.rb +8 -0
  260. data/cookbooks/yum-epel/attributes/epel-debuginfo.rb +15 -0
  261. data/cookbooks/yum-epel/attributes/epel-source.rb +15 -0
  262. data/cookbooks/yum-epel/attributes/epel-testing-debuginfo.rb +15 -0
  263. data/cookbooks/yum-epel/attributes/epel-testing-source.rb +15 -0
  264. data/cookbooks/yum-epel/attributes/epel-testing.rb +15 -0
  265. data/cookbooks/yum-epel/attributes/epel.rb +21 -0
  266. data/cookbooks/yum-epel/metadata.json +1 -0
  267. data/cookbooks/yum-epel/recipes/default.rb +27 -0
  268. data/cookbooks/yum-scl/.kitchen.dokken.yml +24 -0
  269. data/cookbooks/yum-scl/.kitchen.yml +24 -0
  270. data/cookbooks/yum-scl/.rubocop.yml +6 -0
  271. data/cookbooks/yum-scl/.travis.yml +28 -0
  272. data/cookbooks/yum-scl/Berksfile +3 -0
  273. data/cookbooks/yum-scl/Berksfile.lock +25 -0
  274. data/cookbooks/yum-scl/CHANGELOG.md +11 -0
  275. data/cookbooks/yum-scl/Gemfile +46 -0
  276. data/cookbooks/yum-scl/README.md +76 -0
  277. data/cookbooks/yum-scl/attributes/centos.rb +83 -0
  278. data/cookbooks/yum-scl/attributes/default.rb +15 -0
  279. data/cookbooks/yum-scl/attributes/scientific.rb +1 -0
  280. data/cookbooks/yum-scl/files/default/RPM-GPG-KEY-CentOS-SIG-SCLo +20 -0
  281. data/cookbooks/yum-scl/libraries/yum_scl_helper.rb +33 -0
  282. data/cookbooks/yum-scl/metadata.json +42 -0
  283. data/cookbooks/yum-scl/metadata.rb +12 -0
  284. data/cookbooks/yum-scl/recipes/chef_install.rb +52 -0
  285. data/cookbooks/yum-scl/recipes/default.rb +17 -0
  286. data/cookbooks/yum-scl/recipes/native_install.rb +35 -0
  287. data/lib/vagrant-clone/command/clone.rb +66 -61
  288. data/lib/vagrant-clone/errors.rb +61 -0
  289. data/lib/vagrant-clone/util/clone_manager_base.rb +69 -0
  290. data/lib/vagrant-clone/util/clone_managers/docker.rb +31 -0
  291. data/lib/vagrant-clone/util/clone_managers/libvirt.rb +254 -0
  292. data/lib/vagrant-clone/util/vagrantfile_managers/docker.rb +154 -0
  293. data/lib/vagrant-clone/util/vagrantfile_managers/libvirt.rb +159 -0
  294. data/lib/vagrant-clone/version.rb +2 -2
  295. data/lib/vagrant-clone.rb +6 -6
  296. data/libvirt.txt +7 -0
  297. data/performance_testing.rb +165 -0
  298. data/results.txt +45 -0
  299. data/scripts/create_box.sh +134 -0
  300. data/test.rb +92 -0
  301. data/tools/create_box.sh +130 -0
  302. data/vagrant-clone.gemspec +7 -7
  303. metadata +296 -5
  304. data/lib/vagrant-clone/command/errors.rb +0 -16
  305. data/lib/vagrant-clone/command/provider/docker.rb +0 -13
  306. data/lib/vagrant-clone/utils/vagrantfile_manager.rb +0 -47
@@ -0,0 +1,691 @@
1
+ #
2
+ # NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
3
+ #
4
+ # THIS IS A FILE AUTOGENERATED BY 'rake update' DO NOT EDIT!!!!
5
+ #
6
+ # NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
7
+ #
8
+
9
+ if Gem::Requirement.new('< 12.16.42').satisfied_by?(Gem::Version.new(Chef::VERSION))
10
+ #
11
+ # Author:: Adam Jacob (<adam@chef.io>)
12
+ # Author:: Christopher Walters (<cw@chef.io>)
13
+ # Author:: Tim Hinderliter (<tim@chef.io>)
14
+ # Copyright:: Copyright 2008-2016, Chef Software Inc.
15
+ # License:: Apache License, Version 2.0
16
+ #
17
+ # Licensed under the Apache License, Version 2.0 (the "License");
18
+ # you may not use this file except in compliance with the License.
19
+ # You may obtain a copy of the License at
20
+ #
21
+ # http://www.apache.org/licenses/LICENSE-2.0
22
+ #
23
+ # Unless required by applicable law or agreed to in writing, software
24
+ # distributed under the License is distributed on an "AS IS" BASIS,
25
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
+ # See the License for the specific language governing permissions and
27
+ # limitations under the License.
28
+
29
+ require "chef/resource_collection"
30
+ require "chef/cookbook_version"
31
+ require "chef/node"
32
+ require "chef/role"
33
+ require "chef/log"
34
+ require "chef/recipe"
35
+ require "chef/run_context/cookbook_compiler"
36
+ require "chef/event_dispatch/events_output_stream"
37
+ require "forwardable"
38
+
39
+ class Chef
40
+
41
+ # == Chef::RunContext
42
+ # Value object that loads and tracks the context of a Chef run
43
+ class RunContext
44
+ #
45
+ # Global state
46
+ #
47
+
48
+ #
49
+ # The node for this run
50
+ #
51
+ # @return [Chef::Node]
52
+ #
53
+ attr_reader :node
54
+
55
+ #
56
+ # The set of cookbooks involved in this run
57
+ #
58
+ # @return [Chef::CookbookCollection]
59
+ #
60
+ attr_reader :cookbook_collection
61
+
62
+ #
63
+ # Resource Definitions for this run. Populated when the files in
64
+ # +definitions/+ are evaluated (this is triggered by #load).
65
+ #
66
+ # @return [Array[Chef::ResourceDefinition]]
67
+ #
68
+ attr_reader :definitions
69
+
70
+ #
71
+ # Event dispatcher for this run.
72
+ #
73
+ # @return [Chef::EventDispatch::Dispatcher]
74
+ #
75
+ attr_reader :events
76
+
77
+ #
78
+ # Hash of factoids for a reboot request.
79
+ #
80
+ # @return [Hash]
81
+ #
82
+ attr_accessor :reboot_info
83
+
84
+ #
85
+ # Scoped state
86
+ #
87
+
88
+ #
89
+ # The parent run context.
90
+ #
91
+ # @return [Chef::RunContext] The parent run context, or `nil` if this is the
92
+ # root context.
93
+ #
94
+ attr_reader :parent_run_context
95
+
96
+ #
97
+ # The root run context.
98
+ #
99
+ # @return [Chef::RunContext] The root run context.
100
+ #
101
+ def root_run_context
102
+ rc = self
103
+ rc = rc.parent_run_context until rc.parent_run_context.nil?
104
+ rc
105
+ end
106
+
107
+ #
108
+ # The collection of resources intended to be converged (and able to be
109
+ # notified).
110
+ #
111
+ # @return [Chef::ResourceCollection]
112
+ #
113
+ # @see CookbookCompiler
114
+ #
115
+ attr_reader :resource_collection
116
+
117
+ #
118
+ # The list of control groups to execute during the audit phase
119
+ #
120
+ attr_reader :audits
121
+
122
+ #
123
+ # Notification handling
124
+ #
125
+
126
+ #
127
+ # A Hash containing the before notifications triggered by resources
128
+ # during the converge phase of the chef run.
129
+ #
130
+ # @return [Hash[String, Array[Chef::Resource::Notification]]] A hash from
131
+ # <notifying resource name> => <list of notifications it sent>
132
+ #
133
+ attr_reader :before_notification_collection
134
+
135
+ #
136
+ # A Hash containing the immediate notifications triggered by resources
137
+ # during the converge phase of the chef run.
138
+ #
139
+ # @return [Hash[String, Array[Chef::Resource::Notification]]] A hash from
140
+ # <notifying resource name> => <list of notifications it sent>
141
+ #
142
+ attr_reader :immediate_notification_collection
143
+
144
+ #
145
+ # A Hash containing the delayed (end of run) notifications triggered by
146
+ # resources during the converge phase of the chef run.
147
+ #
148
+ # @return [Hash[String, Array[Chef::Resource::Notification]]] A hash from
149
+ # <notifying resource name> => <list of notifications it sent>
150
+ #
151
+ attr_reader :delayed_notification_collection
152
+
153
+ #
154
+ # An Array containing the delayed (end of run) notifications triggered by
155
+ # resources during the converge phase of the chef run.
156
+ #
157
+ # @return [Array[Chef::Resource::Notification]] An array of notification objects
158
+ #
159
+ attr_reader :delayed_actions
160
+
161
+ # Creates a new Chef::RunContext object and populates its fields. This object gets
162
+ # used by the Chef Server to generate a fully compiled recipe list for a node.
163
+ #
164
+ # @param node [Chef::Node] The node to run against.
165
+ # @param cookbook_collection [Chef::CookbookCollection] The cookbooks
166
+ # involved in this run.
167
+ # @param events [EventDispatch::Dispatcher] The event dispatcher for this
168
+ # run.
169
+ #
170
+ def initialize(node, cookbook_collection, events)
171
+ @node = node
172
+ @cookbook_collection = cookbook_collection
173
+ @events = events
174
+
175
+ node.run_context = self
176
+ node.set_cookbook_attribute
177
+
178
+ @definitions = Hash.new
179
+ @loaded_recipes_hash = {}
180
+ @loaded_attributes_hash = {}
181
+ @reboot_info = {}
182
+ @cookbook_compiler = nil
183
+ @delayed_actions = []
184
+
185
+ initialize_child_state
186
+ end
187
+
188
+ #
189
+ # Triggers the compile phase of the chef run.
190
+ #
191
+ # @param run_list_expansion [Chef::RunList::RunListExpansion] The run list.
192
+ # @see Chef::RunContext::CookbookCompiler
193
+ #
194
+ def load(run_list_expansion)
195
+ @cookbook_compiler = CookbookCompiler.new(self, run_list_expansion, events)
196
+ cookbook_compiler.compile
197
+ end
198
+
199
+ #
200
+ # Initialize state that applies to both Chef::RunContext and Chef::ChildRunContext
201
+ #
202
+ def initialize_child_state
203
+ @audits = {}
204
+ @resource_collection = Chef::ResourceCollection.new(self)
205
+ @before_notification_collection = Hash.new { |h, k| h[k] = [] }
206
+ @immediate_notification_collection = Hash.new { |h, k| h[k] = [] }
207
+ @delayed_notification_collection = Hash.new { |h, k| h[k] = [] }
208
+ @delayed_actions = []
209
+ end
210
+
211
+ #
212
+ # Adds an before notification to the +before_notification_collection+.
213
+ #
214
+ # @param [Chef::Resource::Notification] The notification to add.
215
+ #
216
+ def notifies_before(notification)
217
+ # Note for the future, notification.notifying_resource may be an instance
218
+ # of Chef::Resource::UnresolvedSubscribes when calling {Resource#subscribes}
219
+ # with a string value.
220
+ before_notification_collection[notification.notifying_resource.declared_key] << notification
221
+ end
222
+
223
+ #
224
+ # Adds an immediate notification to the +immediate_notification_collection+.
225
+ #
226
+ # @param [Chef::Resource::Notification] The notification to add.
227
+ #
228
+ def notifies_immediately(notification)
229
+ # Note for the future, notification.notifying_resource may be an instance
230
+ # of Chef::Resource::UnresolvedSubscribes when calling {Resource#subscribes}
231
+ # with a string value.
232
+ immediate_notification_collection[notification.notifying_resource.declared_key] << notification
233
+ end
234
+
235
+ #
236
+ # Adds a delayed notification to the +delayed_notification_collection+.
237
+ #
238
+ # @param [Chef::Resource::Notification] The notification to add.
239
+ #
240
+ def notifies_delayed(notification)
241
+ # Note for the future, notification.notifying_resource may be an instance
242
+ # of Chef::Resource::UnresolvedSubscribes when calling {Resource#subscribes}
243
+ # with a string value.
244
+ delayed_notification_collection[notification.notifying_resource.declared_key] << notification
245
+ end
246
+
247
+ #
248
+ # Adds a delayed action to the +delayed_actions+.
249
+ #
250
+ def add_delayed_action(notification)
251
+ if delayed_actions.any? { |existing_notification| existing_notification.duplicates?(notification) }
252
+ Chef::Log.info( "#{notification.notifying_resource} not queuing delayed action #{notification.action} on #{notification.resource}"\
253
+ " (delayed), as it's already been queued")
254
+ else
255
+ delayed_actions << notification
256
+ end
257
+ end
258
+
259
+ #
260
+ # Get the list of before notifications sent by the given resource.
261
+ #
262
+ # @return [Array[Notification]]
263
+ #
264
+ def before_notifications(resource)
265
+ return before_notification_collection[resource.declared_key]
266
+ end
267
+
268
+ #
269
+ # Get the list of immediate notifications sent by the given resource.
270
+ #
271
+ # @return [Array[Notification]]
272
+ #
273
+ def immediate_notifications(resource)
274
+ return immediate_notification_collection[resource.declared_key]
275
+ end
276
+
277
+ #
278
+ # Get the list of delayed (end of run) notifications sent by the given
279
+ # resource.
280
+ #
281
+ # @return [Array[Notification]]
282
+ #
283
+ def delayed_notifications(resource)
284
+ return delayed_notification_collection[resource.declared_key]
285
+ end
286
+
287
+ #
288
+ # Cookbook and recipe loading
289
+ #
290
+
291
+ #
292
+ # Evaluates the recipes +recipe_names+. Used by DSL::IncludeRecipe
293
+ #
294
+ # @param recipe_names [Array[String]] The list of recipe names (e.g.
295
+ # 'my_cookbook' or 'my_cookbook::my_resource').
296
+ # @param current_cookbook The cookbook we are currently running in.
297
+ #
298
+ # @see DSL::IncludeRecipe#include_recipe
299
+ #
300
+ def include_recipe(*recipe_names, current_cookbook: nil)
301
+ result_recipes = Array.new
302
+ recipe_names.flatten.each do |recipe_name|
303
+ if result = load_recipe(recipe_name, current_cookbook: current_cookbook)
304
+ result_recipes << result
305
+ end
306
+ end
307
+ result_recipes
308
+ end
309
+
310
+ #
311
+ # Evaluates the recipe +recipe_name+. Used by DSL::IncludeRecipe
312
+ #
313
+ # TODO I am sort of confused why we have both this and include_recipe ...
314
+ # I don't see anything different beyond accepting and returning an
315
+ # array of recipes.
316
+ #
317
+ # @param recipe_names [Array[String]] The recipe name (e.g 'my_cookbook' or
318
+ # 'my_cookbook::my_resource').
319
+ # @param current_cookbook The cookbook we are currently running in.
320
+ #
321
+ # @return A truthy value if the load occurred; `false` if already loaded.
322
+ #
323
+ # @see DSL::IncludeRecipe#load_recipe
324
+ #
325
+ def load_recipe(recipe_name, current_cookbook: nil)
326
+ Chef::Log.debug("Loading recipe #{recipe_name} via include_recipe")
327
+
328
+ cookbook_name, recipe_short_name = Chef::Recipe.parse_recipe_name(recipe_name, current_cookbook: current_cookbook)
329
+
330
+ if unreachable_cookbook?(cookbook_name) # CHEF-4367
331
+ Chef::Log.warn(<<-ERROR_MESSAGE)
332
+ MissingCookbookDependency:
333
+ Recipe `#{recipe_name}` is not in the run_list, and cookbook '#{cookbook_name}'
334
+ is not a dependency of any cookbook in the run_list. To load this recipe,
335
+ first add a dependency on cookbook '#{cookbook_name}' in the cookbook you're
336
+ including it from in that cookbook's metadata.
337
+ ERROR_MESSAGE
338
+ end
339
+
340
+ if loaded_fully_qualified_recipe?(cookbook_name, recipe_short_name)
341
+ Chef::Log.debug("I am not loading #{recipe_name}, because I have already seen it.")
342
+ false
343
+ else
344
+ loaded_recipe(cookbook_name, recipe_short_name)
345
+ node.loaded_recipe(cookbook_name, recipe_short_name)
346
+ cookbook = cookbook_collection[cookbook_name]
347
+ cookbook.load_recipe(recipe_short_name, self)
348
+ end
349
+ end
350
+
351
+ #
352
+ # Load the given recipe from a filename.
353
+ #
354
+ # @param recipe_file [String] The recipe filename.
355
+ #
356
+ # @return [Chef::Recipe] The loaded recipe.
357
+ #
358
+ # @raise [Chef::Exceptions::RecipeNotFound] If the file does not exist.
359
+ #
360
+ def load_recipe_file(recipe_file)
361
+ if !File.exist?(recipe_file)
362
+ raise Chef::Exceptions::RecipeNotFound, "could not find recipe file #{recipe_file}"
363
+ end
364
+
365
+ Chef::Log.debug("Loading recipe file #{recipe_file}")
366
+ recipe = Chef::Recipe.new("@recipe_files", recipe_file, self)
367
+ recipe.from_file(recipe_file)
368
+ recipe
369
+ end
370
+
371
+ #
372
+ # Look up an attribute filename.
373
+ #
374
+ # @param cookbook_name [String] The cookbook name of the attribute file.
375
+ # @param attr_file_name [String] The attribute file's name (not path).
376
+ #
377
+ # @return [String] The filename.
378
+ #
379
+ # @see DSL::IncludeAttribute#include_attribute
380
+ #
381
+ # @raise [Chef::Exceptions::CookbookNotFound] If the cookbook could not be found.
382
+ # @raise [Chef::Exceptions::AttributeNotFound] If the attribute file could not be found.
383
+ #
384
+ def resolve_attribute(cookbook_name, attr_file_name)
385
+ cookbook = cookbook_collection[cookbook_name]
386
+ raise Chef::Exceptions::CookbookNotFound, "could not find cookbook #{cookbook_name} while loading attribute #{name}" unless cookbook
387
+
388
+ attribute_filename = cookbook.attribute_filenames_by_short_filename[attr_file_name]
389
+ raise Chef::Exceptions::AttributeNotFound, "could not find filename for attribute #{attr_file_name} in cookbook #{cookbook_name}" unless attribute_filename
390
+
391
+ attribute_filename
392
+ end
393
+
394
+ #
395
+ # A list of all recipes that have been loaded.
396
+ #
397
+ # This is stored internally as a Hash, so ordering is predictable.
398
+ #
399
+ # TODO is the above statement true in a 1.9+ ruby world? Is it relevant?
400
+ #
401
+ # @return [Array[String]] A list of recipes in fully qualified form, e.g.
402
+ # the recipe "nginx" will be given as "nginx::default".
403
+ #
404
+ # @see #loaded_recipe? To determine if a particular recipe has been loaded.
405
+ #
406
+ def loaded_recipes
407
+ loaded_recipes_hash.keys
408
+ end
409
+
410
+ #
411
+ # A list of all attributes files that have been loaded.
412
+ #
413
+ # Stored internally using a Hash, so order is predictable.
414
+ #
415
+ # TODO is the above statement true in a 1.9+ ruby world? Is it relevant?
416
+ #
417
+ # @return [Array[String]] A list of attribute file names in fully qualified
418
+ # form, e.g. the "nginx" will be given as "nginx::default".
419
+ #
420
+ def loaded_attributes
421
+ loaded_attributes_hash.keys
422
+ end
423
+
424
+ #
425
+ # Find out if a given recipe has been loaded.
426
+ #
427
+ # @param cookbook [String] Cookbook name.
428
+ # @param recipe [String] Recipe name.
429
+ #
430
+ # @return [Boolean] `true` if the recipe has been loaded, `false` otherwise.
431
+ #
432
+ def loaded_fully_qualified_recipe?(cookbook, recipe)
433
+ loaded_recipes_hash.has_key?("#{cookbook}::#{recipe}")
434
+ end
435
+
436
+ #
437
+ # Find out if a given recipe has been loaded.
438
+ #
439
+ # @param recipe [String] Recipe name. "nginx" and "nginx::default" yield
440
+ # the same results.
441
+ #
442
+ # @return [Boolean] `true` if the recipe has been loaded, `false` otherwise.
443
+ #
444
+ def loaded_recipe?(recipe)
445
+ cookbook, recipe_name = Chef::Recipe.parse_recipe_name(recipe)
446
+ loaded_fully_qualified_recipe?(cookbook, recipe_name)
447
+ end
448
+
449
+ #
450
+ # Mark a given recipe as having been loaded.
451
+ #
452
+ # @param cookbook [String] Cookbook name.
453
+ # @param recipe [String] Recipe name.
454
+ #
455
+ def loaded_recipe(cookbook, recipe)
456
+ loaded_recipes_hash["#{cookbook}::#{recipe}"] = true
457
+ end
458
+
459
+ #
460
+ # Find out if a given attribute file has been loaded.
461
+ #
462
+ # @param cookbook [String] Cookbook name.
463
+ # @param attribute_file [String] Attribute file name.
464
+ #
465
+ # @return [Boolean] `true` if the recipe has been loaded, `false` otherwise.
466
+ #
467
+ def loaded_fully_qualified_attribute?(cookbook, attribute_file)
468
+ loaded_attributes_hash.has_key?("#{cookbook}::#{attribute_file}")
469
+ end
470
+
471
+ #
472
+ # Mark a given attribute file as having been loaded.
473
+ #
474
+ # @param cookbook [String] Cookbook name.
475
+ # @param attribute_file [String] Attribute file name.
476
+ #
477
+ def loaded_attribute(cookbook, attribute_file)
478
+ loaded_attributes_hash["#{cookbook}::#{attribute_file}"] = true
479
+ end
480
+
481
+ ##
482
+ # Cookbook File Introspection
483
+
484
+ #
485
+ # Find out if the cookbook has the given template.
486
+ #
487
+ # @param cookbook [String] Cookbook name.
488
+ # @param template_name [String] Template name.
489
+ #
490
+ # @return [Boolean] `true` if the template is in the cookbook, `false`
491
+ # otherwise.
492
+ # @see Chef::CookbookVersion#has_template_for_node?
493
+ #
494
+ def has_template_in_cookbook?(cookbook, template_name)
495
+ cookbook = cookbook_collection[cookbook]
496
+ cookbook.has_template_for_node?(node, template_name)
497
+ end
498
+
499
+ #
500
+ # Find out if the cookbook has the given file.
501
+ #
502
+ # @param cookbook [String] Cookbook name.
503
+ # @param cb_file_name [String] File name.
504
+ #
505
+ # @return [Boolean] `true` if the file is in the cookbook, `false`
506
+ # otherwise.
507
+ # @see Chef::CookbookVersion#has_cookbook_file_for_node?
508
+ #
509
+ def has_cookbook_file_in_cookbook?(cookbook, cb_file_name)
510
+ cookbook = cookbook_collection[cookbook]
511
+ cookbook.has_cookbook_file_for_node?(node, cb_file_name)
512
+ end
513
+
514
+ #
515
+ # Find out whether the given cookbook is in the cookbook dependency graph.
516
+ #
517
+ # @param cookbook_name [String] Cookbook name.
518
+ #
519
+ # @return [Boolean] `true` if the cookbook is reachable, `false` otherwise.
520
+ #
521
+ # @see Chef::CookbookCompiler#unreachable_cookbook?
522
+ def unreachable_cookbook?(cookbook_name)
523
+ cookbook_compiler.unreachable_cookbook?(cookbook_name)
524
+ end
525
+
526
+ #
527
+ # Open a stream object that can be printed into and will dispatch to events
528
+ #
529
+ # @param name [String] The name of the stream.
530
+ # @param options [Hash] Other options for the stream.
531
+ #
532
+ # @return [EventDispatch::EventsOutputStream] The created stream.
533
+ #
534
+ # @yield If a block is passed, it will be run and the stream will be closed
535
+ # afterwards.
536
+ # @yieldparam stream [EventDispatch::EventsOutputStream] The created stream.
537
+ #
538
+ def open_stream(name: nil, **options)
539
+ stream = EventDispatch::EventsOutputStream.new(events, name: name, **options)
540
+ if block_given?
541
+ begin
542
+ yield stream
543
+ ensure
544
+ stream.close
545
+ end
546
+ else
547
+ stream
548
+ end
549
+ end
550
+
551
+ # there are options for how to handle multiple calls to these functions:
552
+ # 1. first call always wins (never change reboot_info once set).
553
+ # 2. last call always wins (happily change reboot_info whenever).
554
+ # 3. raise an exception on the first conflict.
555
+ # 4. disable reboot after this run if anyone ever calls :cancel.
556
+ # 5. raise an exception on any second call.
557
+ # 6. ?
558
+ def request_reboot(reboot_info)
559
+ Chef::Log.info "Changing reboot status from #{self.reboot_info.inspect} to #{reboot_info.inspect}"
560
+ @reboot_info = reboot_info
561
+ end
562
+
563
+ def cancel_reboot
564
+ Chef::Log.info "Changing reboot status from #{reboot_info.inspect} to {}"
565
+ @reboot_info = {}
566
+ end
567
+
568
+ def reboot_requested?
569
+ reboot_info.size > 0
570
+ end
571
+
572
+ #
573
+ # Create a child RunContext.
574
+ #
575
+ def create_child
576
+ ChildRunContext.new(self)
577
+ end
578
+
579
+ # @api private
580
+ attr_writer :resource_collection
581
+
582
+ protected
583
+
584
+ attr_reader :cookbook_compiler
585
+ attr_reader :loaded_attributes_hash
586
+ attr_reader :loaded_recipes_hash
587
+
588
+ module Deprecated
589
+ ###
590
+ # These need to be settable so deploy can run a resource_collection
591
+ # independent of any cookbooks via +recipe_eval+
592
+ def audits=(value)
593
+ Chef.log_deprecation("Setting run_context.audits will be removed in a future Chef. Use run_context.create_child to create a new RunContext instead.")
594
+ @audits = value
595
+ end
596
+
597
+ def immediate_notification_collection=(value)
598
+ Chef.log_deprecation("Setting run_context.immediate_notification_collection will be removed in a future Chef. Use run_context.create_child to create a new RunContext instead.")
599
+ @immediate_notification_collection = value
600
+ end
601
+
602
+ def delayed_notification_collection=(value)
603
+ Chef.log_deprecation("Setting run_context.delayed_notification_collection will be removed in a future Chef. Use run_context.create_child to create a new RunContext instead.")
604
+ @delayed_notification_collection = value
605
+ end
606
+ end
607
+ prepend Deprecated
608
+
609
+ #
610
+ # A child run context. Delegates all root context calls to its parent.
611
+ #
612
+ # @api private
613
+ #
614
+ class ChildRunContext < RunContext
615
+ extend Forwardable
616
+ def_delegators :parent_run_context, *%w{
617
+ cancel_reboot
618
+ config
619
+ cookbook_collection
620
+ cookbook_compiler
621
+ definitions
622
+ events
623
+ has_cookbook_file_in_cookbook?
624
+ has_template_in_cookbook?
625
+ load
626
+ loaded_attribute
627
+ loaded_attributes
628
+ loaded_attributes_hash
629
+ loaded_fully_qualified_attribute?
630
+ loaded_fully_qualified_recipe?
631
+ loaded_recipe
632
+ loaded_recipe?
633
+ loaded_recipes
634
+ loaded_recipes_hash
635
+ node
636
+ open_stream
637
+ reboot_info
638
+ reboot_info=
639
+ reboot_requested?
640
+ request_reboot
641
+ resolve_attribute
642
+ unreachable_cookbook?
643
+ }
644
+
645
+ def initialize(parent_run_context)
646
+ @parent_run_context = parent_run_context
647
+
648
+ # We don't call super, because we don't bother initializing stuff we're
649
+ # going to delegate to the parent anyway. Just initialize things that
650
+ # every instance needs.
651
+ initialize_child_state
652
+ end
653
+
654
+ CHILD_STATE = %w{
655
+ audits
656
+ audits=
657
+ create_child
658
+ add_delayed_action
659
+ delayed_actions
660
+ delayed_notification_collection
661
+ delayed_notification_collection=
662
+ delayed_notifications
663
+ immediate_notification_collection
664
+ immediate_notification_collection=
665
+ immediate_notifications
666
+ before_notification_collection
667
+ before_notifications
668
+ include_recipe
669
+ initialize_child_state
670
+ load_recipe
671
+ load_recipe_file
672
+ notifies_before
673
+ notifies_immediately
674
+ notifies_delayed
675
+ parent_run_context
676
+ root_run_context
677
+ resource_collection
678
+ resource_collection=
679
+ }.map { |x| x.to_sym }
680
+
681
+ # Verify that we didn't miss any methods
682
+ unless @__skip_method_checking # hook specifically for compat_resource
683
+ missing_methods = superclass.instance_methods(false) - instance_methods(false) - CHILD_STATE
684
+ if !missing_methods.empty?
685
+ raise "ERROR: not all methods of RunContext accounted for in ChildRunContext! All methods must be marked as child methods with CHILD_STATE or delegated to the parent_run_context. Missing #{missing_methods.join(", ")}."
686
+ end
687
+ end
688
+ end
689
+ end
690
+ end
691
+ end