puppet 0.24.9 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (910) hide show
  1. data/CHANGELOG +18680 -1241
  2. data/CHANGELOG.old +1705 -0
  3. data/LICENSE +2 -2
  4. data/README +1 -1
  5. data/README.queueing +126 -0
  6. data/README.rst +4 -4
  7. data/Rakefile +62 -216
  8. data/bin/filebucket +6 -117
  9. data/bin/pi +50 -0
  10. data/bin/puppet +7 -188
  11. data/bin/puppetdoc +7 -198
  12. data/bin/ralsh +4 -191
  13. data/conf/auth.conf +94 -0
  14. data/conf/gentoo/init.d/puppetmaster +30 -30
  15. data/conf/osx/PackageInfo.plist +30 -30
  16. data/conf/osx/createpackage.sh +23 -18
  17. data/conf/osx/preflight +8 -0
  18. data/conf/puppet-queue.conf +10 -0
  19. data/conf/redhat/client.init +52 -41
  20. data/conf/redhat/logrotate +1 -0
  21. data/conf/redhat/puppet.spec +74 -36
  22. data/conf/redhat/rundir-perms.patch +28 -0
  23. data/conf/redhat/server.init +48 -43
  24. data/conf/redhat/server.sysconfig +4 -4
  25. data/conf/solaris/smf/puppetd.xml +53 -53
  26. data/conf/solaris/smf/puppetmasterd.xml +53 -53
  27. data/conf/solaris/smf/svc-puppetd +4 -4
  28. data/conf/solaris/smf/svc-puppetmasterd +3 -3
  29. data/conf/suse/client.init +4 -4
  30. data/conf/suse/puppet.spec +14 -14
  31. data/conf/suse/server.init +17 -17
  32. data/examples/etc/init.d/sleeper +8 -8
  33. data/examples/mac_dscl.pp +2 -2
  34. data/examples/mac_dscl_revert.pp +1 -1
  35. data/examples/mcx_dock_default.pp +108 -108
  36. data/examples/mcx_dock_full.pp +108 -108
  37. data/examples/mcx_nogroup.pp +108 -108
  38. data/examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +5 -5
  39. data/examples/modules/sample-module/manifests/init.pp +2 -2
  40. data/examples/relationships +1 -1
  41. data/ext/autotest/config +6 -6
  42. data/ext/bin/sleeper +12 -12
  43. data/ext/dbfix.sql +21 -21
  44. data/ext/emacs/puppet-mode.el +42 -41
  45. data/ext/extlookup.rb +183 -0
  46. data/ext/ldap/puppet.schema +2 -1
  47. data/ext/logcheck/puppet +1 -1
  48. data/ext/module_puppet +7 -7
  49. data/ext/nagios/check_puppet.rb +83 -83
  50. data/ext/nagios/naggen +302 -0
  51. data/ext/puppet-test +61 -18
  52. data/ext/puppetlisten/puppetlisten.rb +76 -0
  53. data/ext/puppetlisten/puppetrun.rb +39 -0
  54. data/ext/puppetstoredconfigclean.rb +29 -29
  55. data/ext/rack/README +73 -0
  56. data/ext/rack/files/apache2.conf +38 -0
  57. data/ext/rack/files/config.ru +18 -0
  58. data/ext/rack/manifest.pp +59 -0
  59. data/ext/vim/syntax/puppet.vim +54 -35
  60. data/install.rb +37 -26
  61. data/lib/puppet.rb +15 -227
  62. data/lib/puppet/agent.rb +134 -0
  63. data/lib/puppet/agent/locker.rb +42 -0
  64. data/lib/puppet/agent/runner.rb +65 -0
  65. data/lib/puppet/application.rb +313 -0
  66. data/lib/puppet/application/filebucket.rb +87 -0
  67. data/lib/puppet/application/pi.rb +214 -0
  68. data/lib/puppet/application/puppet.rb +177 -0
  69. data/lib/puppet/application/puppetca.rb +71 -0
  70. data/lib/puppet/application/puppetd.rb +256 -0
  71. data/lib/puppet/application/puppetdoc.rb +222 -0
  72. data/lib/puppet/application/puppetmasterd.rb +168 -0
  73. data/lib/puppet/application/puppetqd.rb +96 -0
  74. data/lib/puppet/application/puppetrun.rb +219 -0
  75. data/lib/puppet/application/ralsh.rb +168 -0
  76. data/lib/puppet/configurer.rb +177 -0
  77. data/lib/puppet/configurer/downloader.rb +79 -0
  78. data/lib/puppet/configurer/fact_handler.rb +68 -0
  79. data/lib/puppet/configurer/plugin_handler.rb +26 -0
  80. data/lib/puppet/daemon.rb +78 -28
  81. data/lib/puppet/defaults.rb +239 -166
  82. data/lib/puppet/dsl.rb +7 -7
  83. data/lib/puppet/external/dot.rb +271 -271
  84. data/lib/puppet/external/event-loop/better-definers.rb +298 -298
  85. data/lib/puppet/external/event-loop/event-loop.rb +274 -274
  86. data/lib/puppet/external/event-loop/signal-system.rb +163 -163
  87. data/lib/puppet/external/lock.rb +1 -1
  88. data/lib/puppet/external/nagios.rb +20 -20
  89. data/lib/puppet/external/nagios/base.rb +3 -3
  90. data/lib/puppet/external/nagios/grammar.ry +185 -0
  91. data/lib/puppet/external/nagios/makefile +9 -0
  92. data/lib/puppet/external/nagios/parser.rb +1 -1
  93. data/lib/puppet/feature/json.rb +2 -0
  94. data/lib/puppet/feature/rack.rb +24 -0
  95. data/lib/puppet/feature/rails.rb +23 -33
  96. data/lib/puppet/feature/rubygems.rb +6 -0
  97. data/lib/puppet/feature/stomp.rb +6 -0
  98. data/lib/puppet/file_serving/{file_base.rb → base.rb} +10 -9
  99. data/lib/puppet/file_serving/configuration.rb +61 -61
  100. data/lib/puppet/file_serving/configuration/parser.rb +24 -29
  101. data/lib/puppet/file_serving/content.rb +26 -11
  102. data/lib/puppet/file_serving/fileset.rb +54 -19
  103. data/lib/puppet/file_serving/indirection_hooks.rb +12 -24
  104. data/lib/puppet/file_serving/metadata.rb +8 -8
  105. data/lib/puppet/file_serving/mount.rb +9 -151
  106. data/lib/puppet/file_serving/mount/file.rb +126 -0
  107. data/lib/puppet/file_serving/mount/modules.rb +25 -0
  108. data/lib/puppet/file_serving/mount/plugins.rb +27 -0
  109. data/lib/puppet/file_serving/terminus_helper.rb +9 -4
  110. data/lib/puppet/indirector.rb +6 -4
  111. data/lib/puppet/indirector/active_record.rb +28 -0
  112. data/lib/puppet/indirector/catalog/active_record.rb +36 -0
  113. data/lib/puppet/indirector/catalog/compiler.rb +50 -24
  114. data/lib/puppet/indirector/catalog/queue.rb +5 -0
  115. data/lib/puppet/indirector/catalog/rest.rb +6 -0
  116. data/lib/puppet/indirector/catalog/yaml.rb +2 -4
  117. data/lib/puppet/indirector/certificate/ca.rb +9 -0
  118. data/lib/puppet/indirector/certificate/file.rb +9 -0
  119. data/lib/puppet/indirector/certificate/rest.rb +9 -0
  120. data/lib/puppet/indirector/certificate_request/ca.rb +14 -0
  121. data/lib/puppet/indirector/certificate_request/file.rb +8 -0
  122. data/lib/puppet/indirector/certificate_request/rest.rb +9 -0
  123. data/lib/puppet/indirector/certificate_revocation_list/ca.rb +8 -0
  124. data/lib/puppet/indirector/certificate_revocation_list/file.rb +8 -0
  125. data/lib/puppet/indirector/certificate_revocation_list/rest.rb +9 -0
  126. data/lib/puppet/indirector/direct_file_server.rb +4 -8
  127. data/lib/puppet/indirector/exec.rb +2 -6
  128. data/lib/puppet/indirector/facts/active_record.rb +36 -0
  129. data/lib/puppet/indirector/facts/facter.rb +30 -22
  130. data/lib/puppet/indirector/facts/rest.rb +6 -0
  131. data/lib/puppet/indirector/file.rb +1 -0
  132. data/lib/puppet/indirector/file_content/rest.rb +0 -1
  133. data/lib/puppet/indirector/file_metadata/file.rb +2 -2
  134. data/lib/puppet/indirector/file_metadata/rest.rb +0 -1
  135. data/lib/puppet/indirector/file_server.rb +31 -18
  136. data/lib/puppet/indirector/indirection.rb +46 -33
  137. data/lib/puppet/indirector/key/ca.rb +12 -0
  138. data/lib/puppet/indirector/key/file.rb +42 -0
  139. data/lib/puppet/indirector/node/active_record.rb +13 -0
  140. data/lib/puppet/indirector/node/ldap.rb +1 -1
  141. data/lib/puppet/indirector/queue.rb +83 -0
  142. data/lib/puppet/indirector/report/processor.rb +1 -1
  143. data/lib/puppet/indirector/report/rest.rb +7 -0
  144. data/lib/puppet/indirector/request.rb +158 -15
  145. data/lib/puppet/indirector/rest.rb +74 -36
  146. data/lib/puppet/indirector/runner/rest.rb +7 -0
  147. data/lib/puppet/indirector/ssl_file.rb +174 -0
  148. data/lib/puppet/indirector/terminus.rb +4 -4
  149. data/lib/puppet/indirector/yaml.rb +1 -1
  150. data/lib/puppet/metatype/manager.rb +3 -3
  151. data/lib/puppet/module.rb +99 -124
  152. data/lib/puppet/network/authconfig.rb +57 -42
  153. data/lib/puppet/network/authstore.rb +58 -10
  154. data/lib/puppet/network/client.rb +0 -2
  155. data/lib/puppet/network/client/ca.rb +1 -1
  156. data/lib/puppet/network/client/dipper.rb +7 -2
  157. data/lib/puppet/network/format.rb +123 -0
  158. data/lib/puppet/network/format_handler.rb +156 -0
  159. data/lib/puppet/network/formats.rb +123 -0
  160. data/lib/puppet/network/handler/filebucket.rb +1 -1
  161. data/lib/puppet/network/handler/fileserver.rb +43 -35
  162. data/lib/puppet/network/handler/master.rb +4 -4
  163. data/lib/puppet/network/handler/report.rb +1 -1
  164. data/lib/puppet/network/handler/resource.rb +16 -20
  165. data/lib/puppet/network/handler/runner.rb +9 -42
  166. data/lib/puppet/network/http.rb +4 -4
  167. data/lib/puppet/network/http/api.rb +4 -0
  168. data/lib/puppet/network/http/api/v1.rb +65 -0
  169. data/lib/puppet/network/http/handler.rb +163 -56
  170. data/lib/puppet/network/http/mongrel.rb +19 -15
  171. data/lib/puppet/network/http/mongrel/rest.rb +35 -17
  172. data/lib/puppet/network/http/rack.rb +62 -0
  173. data/lib/puppet/network/http/rack/httphandler.rb +34 -0
  174. data/lib/puppet/network/http/rack/rest.rb +79 -0
  175. data/lib/puppet/network/http/rack/xmlrpc.rb +65 -0
  176. data/lib/puppet/network/http/webrick.rb +89 -16
  177. data/lib/puppet/network/http/webrick/rest.rb +24 -11
  178. data/lib/puppet/network/http_pool.rb +28 -29
  179. data/lib/puppet/network/http_server/mongrel.rb +8 -10
  180. data/lib/puppet/network/http_server/webrick.rb +1 -3
  181. data/lib/puppet/network/rest_authconfig.rb +89 -0
  182. data/lib/puppet/network/rest_authorization.rb +25 -0
  183. data/lib/puppet/network/rights.rb +230 -27
  184. data/lib/puppet/network/server.rb +133 -31
  185. data/lib/puppet/network/xmlrpc/client.rb +5 -5
  186. data/lib/puppet/network/xmlrpc/webrick_servlet.rb +6 -6
  187. data/lib/puppet/node.rb +28 -21
  188. data/lib/puppet/node/environment.rb +48 -0
  189. data/lib/puppet/node/facts.rb +21 -0
  190. data/lib/puppet/parameter.rb +291 -219
  191. data/lib/puppet/parser/ast.rb +1 -0
  192. data/lib/puppet/parser/ast/astarray.rb +5 -1
  193. data/lib/puppet/parser/ast/boolean_operator.rb +3 -3
  194. data/lib/puppet/parser/ast/caseopt.rb +10 -0
  195. data/lib/puppet/parser/ast/casestatement.rb +12 -27
  196. data/lib/puppet/parser/ast/collection.rb +31 -0
  197. data/lib/puppet/parser/ast/collexpr.rb +18 -11
  198. data/lib/puppet/parser/ast/comparison_operator.rb +1 -1
  199. data/lib/puppet/parser/ast/definition.rb +6 -2
  200. data/lib/puppet/parser/ast/function.rb +7 -2
  201. data/lib/puppet/parser/ast/ifstatement.rb +11 -6
  202. data/lib/puppet/parser/ast/leaf.rb +106 -3
  203. data/lib/puppet/parser/ast/match_operator.rb +31 -0
  204. data/lib/puppet/parser/ast/node.rb +10 -6
  205. data/lib/puppet/parser/ast/resource_defaults.rb +2 -2
  206. data/lib/puppet/parser/ast/resource_override.rb +1 -1
  207. data/lib/puppet/parser/ast/resource_reference.rb +11 -3
  208. data/lib/puppet/parser/ast/selector.rb +14 -32
  209. data/lib/puppet/parser/ast/vardef.rb +1 -1
  210. data/lib/puppet/parser/collector.rb +67 -15
  211. data/lib/puppet/parser/compiler.rb +21 -53
  212. data/lib/puppet/parser/files.rb +92 -0
  213. data/lib/puppet/parser/functions.rb +3 -3
  214. data/lib/puppet/parser/functions/defined.rb +3 -3
  215. data/lib/puppet/parser/functions/fqdn_rand.rb +3 -3
  216. data/lib/puppet/parser/functions/inline_template.rb +4 -4
  217. data/lib/puppet/parser/functions/regsubst.rb +37 -35
  218. data/lib/puppet/parser/functions/require.rb +34 -0
  219. data/lib/puppet/parser/functions/shellquote.rb +41 -0
  220. data/lib/puppet/parser/functions/split.rb +29 -0
  221. data/lib/puppet/parser/functions/sprintf.rb +6 -6
  222. data/lib/puppet/parser/functions/template.rb +4 -4
  223. data/lib/puppet/parser/functions/versioncmp.rb +22 -1
  224. data/lib/puppet/parser/grammar.ra +812 -0
  225. data/lib/puppet/parser/interpreter.rb +4 -4
  226. data/lib/puppet/parser/lexer.rb +44 -15
  227. data/lib/puppet/parser/loaded_code.rb +115 -0
  228. data/lib/puppet/parser/makefile +8 -0
  229. data/lib/puppet/parser/parser.rb +1080 -928
  230. data/lib/puppet/parser/parser_support.rb +118 -96
  231. data/lib/puppet/parser/resource.rb +56 -126
  232. data/lib/puppet/parser/resource/param.rb +2 -76
  233. data/lib/puppet/parser/resource/reference.rb +15 -8
  234. data/lib/puppet/parser/scope.rb +68 -35
  235. data/lib/puppet/parser/templatewrapper.rb +8 -8
  236. data/lib/puppet/parser/yaml_trimmer.rb +11 -0
  237. data/lib/puppet/property.rb +69 -124
  238. data/lib/puppet/property/list.rb +3 -3
  239. data/lib/puppet/provider.rb +5 -5
  240. data/lib/puppet/provider/augeas/augeas.rb +119 -118
  241. data/lib/puppet/provider/computer/computer.rb +3 -3
  242. data/lib/puppet/provider/confine/variable.rb +1 -1
  243. data/lib/puppet/provider/cron/crontab.rb +8 -7
  244. data/lib/puppet/provider/group/directoryservice.rb +2 -2
  245. data/lib/puppet/provider/group/groupadd.rb +1 -1
  246. data/lib/puppet/provider/group/ldap.rb +3 -3
  247. data/lib/puppet/provider/group/pw.rb +1 -1
  248. data/lib/puppet/provider/host/parsed.rb +3 -3
  249. data/lib/puppet/provider/ldap.rb +1 -3
  250. data/lib/puppet/provider/macauthorization/macauthorization.rb +62 -55
  251. data/lib/puppet/provider/mailalias/aliases.rb +9 -1
  252. data/lib/puppet/provider/maillist/mailman.rb +8 -4
  253. data/lib/puppet/provider/mcx/mcxcontent.rb +11 -11
  254. data/lib/puppet/provider/mount/parsed.rb +2 -2
  255. data/lib/puppet/provider/nameservice.rb +6 -6
  256. data/lib/puppet/provider/nameservice/directoryservice.rb +83 -87
  257. data/lib/puppet/provider/package/appdmg.rb +10 -9
  258. data/lib/puppet/provider/package/apple.rb +1 -3
  259. data/lib/puppet/provider/package/apt.rb +5 -5
  260. data/lib/puppet/provider/package/aptitude.rb +1 -1
  261. data/lib/puppet/provider/package/aptrpm.rb +1 -1
  262. data/lib/puppet/provider/package/darwinport.rb +1 -1
  263. data/lib/puppet/provider/package/dpkg.rb +2 -2
  264. data/lib/puppet/provider/package/fink.rb +6 -6
  265. data/lib/puppet/provider/package/freebsd.rb +1 -1
  266. data/lib/puppet/provider/package/gem.rb +2 -2
  267. data/lib/puppet/provider/package/hpux.rb +5 -5
  268. data/lib/puppet/provider/package/pkgdmg.rb +30 -22
  269. data/lib/puppet/provider/package/portage.rb +1 -1
  270. data/lib/puppet/provider/package/ports.rb +1 -1
  271. data/lib/puppet/provider/package/rpm.rb +5 -5
  272. data/lib/puppet/provider/package/rug.rb +1 -1
  273. data/lib/puppet/provider/package/sun.rb +7 -7
  274. data/lib/puppet/provider/package/up2date.rb +1 -1
  275. data/lib/puppet/provider/package/yum.rb +2 -2
  276. data/lib/puppet/provider/package/yumhelper.py +2 -2
  277. data/lib/puppet/provider/port/parsed.rb +1 -1
  278. data/lib/puppet/provider/selmodule/semodule.rb +3 -3
  279. data/lib/puppet/provider/service/base.rb +21 -12
  280. data/lib/puppet/provider/service/daemontools.rb +86 -49
  281. data/lib/puppet/provider/service/debian.rb +20 -12
  282. data/lib/puppet/provider/service/freebsd.rb +5 -5
  283. data/lib/puppet/provider/service/gentoo.rb +2 -2
  284. data/lib/puppet/provider/service/init.rb +21 -33
  285. data/lib/puppet/provider/service/launchd.rb +120 -48
  286. data/lib/puppet/provider/service/redhat.rb +12 -21
  287. data/lib/puppet/provider/service/runit.rb +19 -9
  288. data/lib/puppet/provider/service/smf.rb +49 -34
  289. data/lib/puppet/provider/ssh_authorized_key/parsed.rb +34 -0
  290. data/lib/puppet/provider/sshkey/parsed.rb +2 -2
  291. data/lib/puppet/provider/user/directoryservice.rb +12 -29
  292. data/lib/puppet/provider/user/hpux.rb +3 -3
  293. data/lib/puppet/provider/user/ldap.rb +2 -2
  294. data/lib/puppet/provider/zfs/solaris.rb +1 -1
  295. data/lib/puppet/provider/zone/solaris.rb +4 -4
  296. data/lib/puppet/provider/zpool/solaris.rb +3 -3
  297. data/lib/puppet/rails.rb +9 -9
  298. data/lib/puppet/rails/benchmark.rb +69 -0
  299. data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +5 -5
  300. data/lib/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb +2 -2
  301. data/lib/puppet/rails/database/003_add_environment_to_host.rb +1 -1
  302. data/lib/puppet/rails/database/schema.rb +8 -8
  303. data/lib/puppet/rails/fact_value.rb +1 -1
  304. data/lib/puppet/rails/host.rb +211 -93
  305. data/lib/puppet/rails/param_name.rb +5 -1
  306. data/lib/puppet/rails/param_value.rb +29 -2
  307. data/lib/puppet/rails/puppet_tag.rb +5 -0
  308. data/lib/puppet/rails/resource.rb +120 -20
  309. data/lib/puppet/rails/resource_tag.rb +1 -1
  310. data/lib/puppet/rails/source_file.rb +1 -1
  311. data/lib/puppet/reference/configuration.rb +14 -14
  312. data/lib/puppet/reference/function.rb +1 -1
  313. data/lib/puppet/reference/metaparameter.rb +48 -0
  314. data/lib/puppet/reference/providers.rb +6 -6
  315. data/lib/puppet/reference/type.rb +1 -37
  316. data/lib/puppet/relationship.rb +57 -30
  317. data/lib/puppet/reports/rrdgraph.rb +4 -4
  318. data/lib/puppet/reports/store.rb +3 -3
  319. data/lib/puppet/reports/tagmail.rb +15 -15
  320. data/lib/puppet/resource.rb +265 -0
  321. data/lib/puppet/{node → resource}/catalog.rb +188 -112
  322. data/lib/puppet/{resource_reference.rb → resource/reference.rb} +46 -24
  323. data/lib/puppet/simple_graph.rb +165 -27
  324. data/lib/puppet/ssl.rb +7 -0
  325. data/lib/puppet/ssl/base.rb +62 -0
  326. data/lib/puppet/ssl/certificate.rb +34 -0
  327. data/lib/puppet/ssl/certificate_authority.rb +298 -0
  328. data/lib/puppet/ssl/certificate_authority/interface.rb +118 -0
  329. data/lib/puppet/ssl/certificate_factory.rb +145 -0
  330. data/lib/puppet/ssl/certificate_request.rb +51 -0
  331. data/lib/puppet/ssl/certificate_revocation_list.rb +86 -0
  332. data/lib/puppet/ssl/host.rb +271 -0
  333. data/lib/puppet/ssl/inventory.rb +52 -0
  334. data/lib/puppet/ssl/key.rb +56 -0
  335. data/lib/puppet/sslcertificates.rb +6 -6
  336. data/lib/puppet/sslcertificates/ca.rb +15 -15
  337. data/lib/puppet/sslcertificates/certificate.rb +4 -4
  338. data/lib/puppet/sslcertificates/inventory.rb +3 -3
  339. data/lib/puppet/transaction.rb +113 -139
  340. data/lib/puppet/transaction/change.rb +6 -6
  341. data/lib/puppet/transaction/event.rb +1 -1
  342. data/lib/puppet/transaction/report.rb +7 -1
  343. data/lib/puppet/transportable.rb +28 -28
  344. data/lib/puppet/type.rb +263 -688
  345. data/lib/puppet/type/augeas.rb +3 -2
  346. data/lib/puppet/type/component.rb +28 -95
  347. data/lib/puppet/type/computer.rb +10 -10
  348. data/lib/puppet/type/cron.rb +19 -14
  349. data/lib/puppet/type/exec.rb +21 -20
  350. data/lib/puppet/type/file.rb +306 -633
  351. data/lib/puppet/type/file/checksum.rb +10 -11
  352. data/lib/puppet/type/file/content.rb +83 -22
  353. data/lib/puppet/type/file/ensure.rb +15 -9
  354. data/lib/puppet/type/file/group.rb +7 -1
  355. data/lib/puppet/type/file/mode.rb +1 -1
  356. data/lib/puppet/type/file/owner.rb +9 -3
  357. data/lib/puppet/type/file/selcontext.rb +4 -4
  358. data/lib/puppet/type/file/source.rb +78 -179
  359. data/lib/puppet/type/file/target.rb +3 -3
  360. data/lib/puppet/type/file/type.rb +2 -2
  361. data/lib/puppet/type/filebucket.rb +33 -54
  362. data/lib/puppet/type/group.rb +8 -8
  363. data/lib/puppet/type/host.rb +7 -7
  364. data/lib/puppet/type/k5login.rb +2 -2
  365. data/lib/puppet/type/macauthorization.rb +77 -52
  366. data/lib/puppet/type/mailalias.rb +2 -2
  367. data/lib/puppet/type/maillist.rb +2 -2
  368. data/lib/puppet/type/mcx.rb +3 -3
  369. data/lib/puppet/type/mount.rb +16 -11
  370. data/lib/puppet/type/notify.rb +4 -4
  371. data/lib/puppet/type/package.rb +6 -28
  372. data/lib/puppet/type/port.rb +1 -1
  373. data/lib/puppet/type/resources.rb +19 -19
  374. data/lib/puppet/type/schedule.rb +18 -20
  375. data/lib/puppet/type/selmodule.rb +1 -1
  376. data/lib/puppet/type/service.rb +11 -7
  377. data/lib/puppet/type/ssh_authorized_key.rb +26 -9
  378. data/lib/puppet/type/sshkey.rb +2 -2
  379. data/lib/puppet/type/tidy.rb +285 -289
  380. data/lib/puppet/type/user.rb +9 -7
  381. data/lib/puppet/type/yumrepo.rb +17 -16
  382. data/lib/puppet/type/zone.rb +8 -7
  383. data/lib/puppet/util.rb +11 -36
  384. data/lib/puppet/util/autoload.rb +31 -19
  385. data/lib/puppet/util/autoload/file_cache.rb +115 -0
  386. data/lib/puppet/util/backups.rb +86 -0
  387. data/lib/puppet/util/cacher.rb +135 -0
  388. data/lib/puppet/util/checksums.rb +11 -1
  389. data/lib/puppet/util/classgen.rb +1 -1
  390. data/lib/puppet/util/config_store.rb +2 -2
  391. data/lib/puppet/util/constant_inflector.rb +1 -1
  392. data/lib/puppet/util/diff.rb +2 -2
  393. data/lib/puppet/util/docs.rb +9 -3
  394. data/lib/puppet/util/execution.rb +1 -1
  395. data/lib/puppet/util/feature.rb +27 -20
  396. data/lib/puppet/util/fileparsing.rb +3 -3
  397. data/lib/puppet/util/filetype.rb +8 -6
  398. data/lib/puppet/util/graph.rb +5 -5
  399. data/lib/puppet/util/inifile.rb +5 -5
  400. data/lib/puppet/util/json.rb +13 -0
  401. data/lib/puppet/util/ldap/connection.rb +2 -2
  402. data/lib/puppet/util/log.rb +48 -31
  403. data/lib/puppet/util/metric.rb +4 -4
  404. data/lib/puppet/util/monkey_patches.rb +43 -0
  405. data/lib/puppet/util/nagios_maker.rb +1 -1
  406. data/lib/puppet/util/package.rb +4 -4
  407. data/lib/puppet/util/pidlock.rb +59 -59
  408. data/lib/puppet/util/posix.rb +13 -52
  409. data/lib/puppet/util/provider_features.rb +3 -3
  410. data/lib/puppet/util/queue.rb +96 -0
  411. data/lib/puppet/util/queue/stomp.rb +47 -0
  412. data/lib/puppet/util/rails/cache_accumulator.rb +65 -0
  413. data/lib/puppet/util/rails/collection_merger.rb +0 -39
  414. data/lib/puppet/util/rails/reference_serializer.rb +17 -3
  415. data/lib/puppet/util/rdoc.rb +1 -0
  416. data/lib/puppet/util/rdoc/code_objects.rb +5 -1
  417. data/lib/puppet/util/rdoc/generators/puppet_generator.rb +5 -5
  418. data/lib/puppet/util/rdoc/generators/template/puppet/puppet.rb +13 -13
  419. data/lib/puppet/util/rdoc/parser.rb +28 -32
  420. data/lib/puppet/util/reference.rb +29 -8
  421. data/lib/puppet/util/resource_template.rb +1 -1
  422. data/lib/puppet/util/selinux.rb +12 -6
  423. data/lib/puppet/util/settings.rb +203 -578
  424. data/lib/puppet/util/settings/boolean_setting.rb +33 -0
  425. data/lib/puppet/util/settings/file_setting.rb +119 -0
  426. data/lib/puppet/util/settings/setting.rb +110 -0
  427. data/lib/puppet/util/subclass_loader.rb +1 -1
  428. data/lib/puppet/util/suidmanager.rb +2 -2
  429. data/lib/puppet/util/tagging.rb +1 -1
  430. data/lib/puppet/util/warnings.rb +17 -9
  431. data/man/man8/filebucket.8 +2 -2
  432. data/man/man8/pi.8 +2 -2
  433. data/man/man8/puppet.8 +3 -4
  434. data/man/man8/puppet.conf.8 +63 -63
  435. data/man/man8/puppetca.8 +2 -2
  436. data/man/man8/puppetd.8 +2 -2
  437. data/man/man8/puppetdoc.8 +2 -2
  438. data/man/man8/puppetmasterd.8 +2 -2
  439. data/man/man8/puppetrun.8 +2 -2
  440. data/man/man8/ralsh.8 +3 -3
  441. data/sbin/puppetca +102 -0
  442. data/sbin/puppetd +159 -0
  443. data/sbin/puppetmasterd +66 -0
  444. data/sbin/puppetqd +53 -0
  445. data/sbin/puppetrun +130 -0
  446. data/spec/Rakefile +2 -2
  447. data/spec/integration/application/puppet.rb +33 -0
  448. data/spec/integration/bin/puppetmasterd.rb +110 -0
  449. data/spec/integration/configurer.rb +18 -0
  450. data/spec/integration/defaults.rb +158 -7
  451. data/spec/integration/file_serving/content.rb +2 -0
  452. data/spec/integration/file_serving/fileset.rb +14 -0
  453. data/spec/integration/file_serving/metadata.rb +2 -0
  454. data/spec/integration/file_serving/terminus_helper.rb +22 -0
  455. data/spec/integration/indirector/catalog/compiler.rb +67 -0
  456. data/spec/integration/indirector/catalog/queue.rb +61 -0
  457. data/spec/integration/indirector/certificate/rest.rb +69 -0
  458. data/spec/integration/indirector/certificate_request/rest.rb +89 -0
  459. data/spec/integration/indirector/certificate_revocation_list/rest.rb +77 -0
  460. data/spec/integration/indirector/direct_file_server.rb +16 -23
  461. data/spec/integration/indirector/file_content/file_server.rb +75 -0
  462. data/spec/integration/indirector/report/rest.rb +95 -0
  463. data/spec/integration/indirector/rest.rb +207 -147
  464. data/spec/integration/network/client.rb +19 -0
  465. data/spec/integration/network/formats.rb +110 -0
  466. data/spec/integration/network/handler.rb +25 -0
  467. data/spec/integration/network/server/mongrel.rb +26 -8
  468. data/spec/integration/network/server/webrick.rb +49 -11
  469. data/spec/integration/node/environment.rb +58 -0
  470. data/spec/integration/node/facts.rb +4 -2
  471. data/spec/integration/parser/compiler.rb +29 -0
  472. data/spec/integration/parser/functions/require.rb +67 -0
  473. data/spec/integration/provider/mailalias/aliases.rb +25 -0
  474. data/spec/integration/{node → resource}/catalog.rb +17 -10
  475. data/spec/integration/ssl/certificate_authority.rb +135 -0
  476. data/spec/integration/ssl/certificate_request.rb +59 -0
  477. data/spec/integration/ssl/certificate_revocation_list.rb +42 -0
  478. data/spec/integration/ssl/host.rb +90 -0
  479. data/spec/integration/transaction.rb +66 -0
  480. data/spec/integration/transaction/report.rb +2 -5
  481. data/spec/integration/type.rb +22 -0
  482. data/spec/integration/type/file.rb +458 -0
  483. data/spec/integration/type/package.rb +1 -1
  484. data/spec/integration/type/tidy.rb +27 -0
  485. data/spec/integration/util/autoload.rb +114 -0
  486. data/spec/integration/util/feature.rb +54 -0
  487. data/spec/integration/util/file_locking.rb +2 -1
  488. data/spec/integration/util/settings.rb +27 -0
  489. data/spec/lib/puppet_spec/files.rb +9 -0
  490. data/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +1 -0
  491. data/spec/monkey_patches/alias_should_to_must.rb +1 -0
  492. data/spec/shared_behaviours/file_server_terminus.rb +14 -11
  493. data/spec/shared_behaviours/file_serving.rb +13 -17
  494. data/spec/spec_helper.rb +22 -5
  495. data/spec/unit/agent.rb +259 -0
  496. data/spec/unit/agent/locker.rb +100 -0
  497. data/spec/unit/agent/runner.rb +118 -0
  498. data/spec/unit/application.rb +420 -0
  499. data/spec/unit/application/filebucket.rb +220 -0
  500. data/spec/unit/application/pi.rb +84 -0
  501. data/spec/unit/application/puppet.rb +404 -0
  502. data/spec/unit/application/puppetca.rb +142 -0
  503. data/spec/unit/application/puppetd.rb +502 -0
  504. data/spec/unit/application/puppetdoc.rb +345 -0
  505. data/spec/unit/application/puppetmasterd.rb +456 -0
  506. data/spec/unit/application/puppetqd.rb +186 -0
  507. data/spec/unit/application/puppetrun.rb +279 -0
  508. data/spec/unit/application/ralsh.rb +237 -0
  509. data/spec/unit/configurer.rb +232 -0
  510. data/spec/unit/configurer/downloader.rb +188 -0
  511. data/spec/unit/configurer/fact_handler.rb +150 -0
  512. data/spec/unit/configurer/plugin_handler.rb +112 -0
  513. data/spec/unit/daemon.rb +287 -0
  514. data/spec/unit/file_serving/{file_base.rb → base.rb} +39 -31
  515. data/spec/unit/file_serving/configuration.rb +104 -93
  516. data/spec/unit/file_serving/configuration/parser.rb +64 -18
  517. data/spec/unit/file_serving/content.rb +65 -26
  518. data/spec/unit/file_serving/fileset.rb +116 -14
  519. data/spec/unit/file_serving/indirection_hooks.rb +34 -95
  520. data/spec/unit/file_serving/metadata.rb +27 -40
  521. data/spec/unit/file_serving/mount.rb +7 -118
  522. data/spec/unit/file_serving/mount/file.rb +188 -0
  523. data/spec/unit/file_serving/mount/modules.rb +63 -0
  524. data/spec/unit/file_serving/mount/plugins.rb +61 -0
  525. data/spec/unit/file_serving/terminus_helper.rb +39 -27
  526. data/spec/unit/indirector.rb +6 -1
  527. data/spec/unit/indirector/active_record.rb +76 -0
  528. data/spec/unit/indirector/catalog/active_record.rb +122 -0
  529. data/spec/unit/indirector/catalog/compiler.rb +222 -118
  530. data/spec/unit/indirector/catalog/queue.rb +20 -0
  531. data/spec/unit/indirector/catalog/rest.rb +11 -0
  532. data/spec/unit/indirector/catalog/yaml.rb +6 -6
  533. data/spec/unit/indirector/certificate/ca.rb +28 -0
  534. data/spec/unit/indirector/certificate/file.rb +28 -0
  535. data/spec/unit/indirector/certificate/rest.rb +23 -0
  536. data/spec/unit/indirector/certificate_request/ca.rb +19 -0
  537. data/spec/unit/indirector/certificate_request/file.rb +19 -0
  538. data/spec/unit/indirector/certificate_request/rest.rb +23 -0
  539. data/spec/unit/indirector/certificate_revocation_list/ca.rb +21 -0
  540. data/spec/unit/indirector/certificate_revocation_list/file.rb +20 -0
  541. data/spec/unit/indirector/certificate_revocation_list/rest.rb +23 -0
  542. data/spec/unit/indirector/direct_file_server.rb +3 -8
  543. data/spec/unit/indirector/exec.rb +6 -1
  544. data/spec/unit/indirector/facts/active_record.rb +104 -0
  545. data/spec/unit/indirector/facts/facter.rb +53 -12
  546. data/spec/unit/indirector/facts/rest.rb +11 -0
  547. data/spec/unit/indirector/file.rb +8 -1
  548. data/spec/unit/indirector/file_metadata/file.rb +5 -5
  549. data/spec/unit/indirector/file_server.rb +181 -98
  550. data/spec/unit/indirector/indirection.rb +102 -38
  551. data/spec/unit/indirector/key/ca.rb +28 -0
  552. data/spec/unit/indirector/key/file.rb +104 -0
  553. data/spec/unit/indirector/node/active_record.rb +34 -0
  554. data/spec/unit/indirector/node/ldap.rb +1 -1
  555. data/spec/unit/indirector/node/rest.rb +2 -2
  556. data/spec/unit/indirector/queue.rb +123 -0
  557. data/spec/unit/indirector/report/rest.rb +28 -0
  558. data/spec/unit/indirector/request.rb +221 -0
  559. data/spec/unit/indirector/rest.rb +343 -334
  560. data/spec/unit/indirector/runner/rest.rb +11 -0
  561. data/spec/unit/indirector/ssl_file.rb +280 -0
  562. data/spec/unit/module.rb +180 -180
  563. data/spec/unit/network/authconfig.rb +292 -0
  564. data/spec/unit/network/authstore.rb +94 -0
  565. data/spec/unit/network/client.rb +2 -2
  566. data/spec/unit/network/client/dipper.rb +16 -0
  567. data/spec/unit/network/format.rb +191 -0
  568. data/spec/unit/network/format_handler.rb +306 -0
  569. data/spec/unit/network/formats.rb +249 -0
  570. data/spec/unit/network/handler/fileserver.rb +2 -5
  571. data/spec/unit/network/http.rb +3 -3
  572. data/spec/unit/network/http/api/v1.rb +122 -0
  573. data/spec/unit/network/http/handler.rb +448 -0
  574. data/spec/unit/network/http/mongrel.rb +46 -32
  575. data/spec/unit/network/http/mongrel/rest.rb +174 -319
  576. data/spec/unit/network/http/rack.rb +102 -0
  577. data/spec/unit/network/http/rack/rest.rb +199 -0
  578. data/spec/unit/network/http/rack/xmlrpc.rb +157 -0
  579. data/spec/unit/network/http/webrick.rb +249 -37
  580. data/spec/unit/network/http/webrick/rest.rb +113 -279
  581. data/spec/unit/network/http_pool.rb +86 -110
  582. data/spec/unit/network/rest_authconfig.rb +146 -0
  583. data/spec/unit/network/rest_authorization.rb +43 -0
  584. data/spec/unit/network/rights.rb +519 -0
  585. data/spec/unit/network/server.rb +475 -257
  586. data/spec/unit/node.rb +43 -10
  587. data/spec/unit/node/environment.rb +143 -9
  588. data/spec/unit/node/facts.rb +77 -24
  589. data/spec/unit/other/selinux.rb +85 -0
  590. data/spec/unit/other/transbucket.rb +29 -13
  591. data/spec/unit/other/transobject.rb +35 -15
  592. data/spec/unit/parameter.rb +378 -5
  593. data/spec/unit/parser/ast.rb +1 -1
  594. data/spec/unit/parser/ast/arithmetic_operator.rb +17 -17
  595. data/spec/unit/parser/ast/astarray.rb +16 -10
  596. data/spec/unit/parser/ast/boolean_operator.rb +2 -2
  597. data/spec/unit/parser/ast/casestatement.rb +143 -0
  598. data/spec/unit/parser/ast/collection.rb +63 -0
  599. data/spec/unit/parser/ast/collexpr.rb +31 -8
  600. data/spec/unit/parser/ast/comparison_operator.rb +9 -9
  601. data/spec/unit/parser/ast/definition.rb +18 -0
  602. data/spec/unit/parser/ast/function.rb +6 -0
  603. data/spec/unit/parser/ast/ifstatement.rb +75 -0
  604. data/spec/unit/parser/ast/leaf.rb +261 -0
  605. data/spec/unit/parser/ast/match_operator.rb +50 -0
  606. data/spec/unit/parser/ast/minus.rb +1 -1
  607. data/spec/unit/parser/ast/node.rb +20 -0
  608. data/spec/unit/parser/ast/not.rb +1 -1
  609. data/spec/unit/parser/ast/resource_override.rb +5 -5
  610. data/spec/unit/parser/ast/resource_reference.rb +11 -5
  611. data/spec/unit/parser/ast/selector.rb +156 -0
  612. data/spec/unit/parser/ast/vardef.rb +11 -11
  613. data/spec/unit/parser/collector.rb +167 -48
  614. data/spec/unit/parser/compiler.rb +128 -104
  615. data/spec/unit/parser/files.rb +190 -0
  616. data/spec/unit/parser/functions/inline_template.rb +0 -0
  617. data/spec/unit/parser/functions/regsubst.rb +42 -42
  618. data/spec/unit/parser/functions/require.rb +36 -0
  619. data/spec/unit/parser/functions/shellquote.rb +92 -0
  620. data/spec/unit/parser/functions/split.rb +51 -0
  621. data/spec/unit/parser/functions/sprintf.rb +11 -11
  622. data/spec/unit/parser/functions/template.rb +0 -0
  623. data/spec/unit/parser/functions/versioncmp.rb +2 -2
  624. data/spec/unit/parser/interpreter.rb +16 -7
  625. data/spec/unit/parser/lexer.rb +72 -12
  626. data/spec/unit/parser/loaded_code.rb +198 -0
  627. data/spec/unit/parser/parser.rb +215 -28
  628. data/spec/unit/parser/resource.rb +131 -22
  629. data/spec/unit/parser/scope.rb +207 -12
  630. data/spec/unit/parser/templatewrapper.rb +8 -3
  631. data/spec/unit/property.rb +270 -16
  632. data/spec/unit/property/list.rb +12 -6
  633. data/spec/unit/provider.rb +31 -0
  634. data/spec/unit/provider/augeas/augeas.rb +61 -33
  635. data/spec/unit/provider/macauthorization.rb +29 -29
  636. data/spec/unit/provider/mcx/mcxcontent.rb +4 -4
  637. data/spec/unit/provider/mount/parsed.rb +5 -8
  638. data/spec/unit/provider/naginator.rb +0 -0
  639. data/spec/unit/provider/package/apt.rb +6 -6
  640. data/spec/unit/provider/package/pkgdmg.rb +73 -0
  641. data/spec/unit/provider/selboolean.rb +1 -1
  642. data/spec/unit/provider/selmodule.rb +2 -2
  643. data/spec/unit/provider/service/daemontools.rb +40 -15
  644. data/spec/unit/provider/service/debian.rb +89 -0
  645. data/spec/unit/provider/service/init.rb +106 -0
  646. data/spec/unit/provider/service/launchd.rb +71 -13
  647. data/spec/unit/provider/service/redhat.rb +94 -0
  648. data/spec/unit/provider/service/runit.rb +14 -2
  649. data/spec/unit/provider/ssh_authorized_key/parsed.rb +66 -2
  650. data/spec/unit/provider/user/ldap.rb +1 -1
  651. data/spec/unit/provider/user/user_role_add.rb +1 -1
  652. data/spec/unit/provider/zfs/solaris.rb +18 -6
  653. data/spec/unit/provider/zone/solaris.rb +1 -1
  654. data/spec/unit/rails.rb +16 -22
  655. data/spec/unit/rails/host.rb +163 -0
  656. data/spec/unit/rails/param_value.rb +49 -0
  657. data/spec/unit/rails/resource.rb +87 -0
  658. data/spec/unit/relationship.rb +141 -29
  659. data/spec/unit/resource.rb +504 -0
  660. data/spec/unit/resource/catalog.rb +1061 -0
  661. data/spec/unit/resource/reference.rb +111 -0
  662. data/spec/unit/simple_graph.rb +448 -191
  663. data/spec/unit/ssl/certificate.rb +124 -0
  664. data/spec/unit/ssl/certificate_authority.rb +741 -0
  665. data/spec/unit/ssl/certificate_authority/interface.rb +269 -0
  666. data/spec/unit/ssl/certificate_factory.rb +107 -0
  667. data/spec/unit/ssl/certificate_request.rb +193 -0
  668. data/spec/unit/ssl/certificate_revocation_list.rb +180 -0
  669. data/spec/unit/ssl/host.rb +704 -0
  670. data/spec/unit/ssl/inventory.rb +180 -0
  671. data/spec/unit/ssl/key.rb +198 -0
  672. data/spec/unit/transaction.rb +65 -2
  673. data/spec/unit/transaction/change.rb +1 -1
  674. data/spec/unit/transaction/report.rb +1 -1
  675. data/spec/unit/type.rb +361 -8
  676. data/spec/unit/type/augeas.rb +30 -37
  677. data/spec/unit/type/component.rb +63 -0
  678. data/spec/unit/type/computer.rb +17 -21
  679. data/spec/unit/type/exec.rb +27 -2
  680. data/spec/unit/type/file.rb +704 -83
  681. data/spec/unit/type/file/content.rb +253 -15
  682. data/spec/unit/type/file/ensure.rb +65 -2
  683. data/spec/unit/type/file/group.rb +5 -0
  684. data/spec/unit/type/file/owner.rb +5 -0
  685. data/spec/unit/type/file/selinux.rb +12 -16
  686. data/spec/unit/type/file/source.rb +264 -0
  687. data/spec/unit/type/filebucket.rb +74 -0
  688. data/spec/unit/type/group.rb +1 -5
  689. data/spec/unit/type/macauthorization.rb +59 -26
  690. data/spec/unit/type/mcx.rb +8 -16
  691. data/spec/unit/type/mount.rb +8 -16
  692. data/spec/unit/type/noop_metaparam.rb +0 -2
  693. data/spec/unit/type/package.rb +13 -23
  694. data/spec/unit/type/resources.rb +4 -7
  695. data/spec/unit/type/schedule.rb +1 -7
  696. data/spec/unit/type/selboolean.rb +4 -6
  697. data/spec/unit/type/service.rb +23 -33
  698. data/spec/unit/type/ssh_authorized_key.rb +25 -14
  699. data/spec/unit/type/tidy.rb +329 -21
  700. data/spec/unit/type/user.rb +18 -10
  701. data/spec/unit/type/zfs.rb +6 -6
  702. data/spec/unit/util/autoload.rb +94 -3
  703. data/spec/unit/util/autoload/file_cache.rb +183 -0
  704. data/spec/unit/util/backups.rb +159 -0
  705. data/spec/unit/util/cache_accumulator.rb +69 -0
  706. data/spec/unit/util/cacher.rb +185 -0
  707. data/spec/unit/util/checksums.rb +9 -1
  708. data/spec/unit/util/feature.rb +72 -0
  709. data/spec/unit/util/filetype.rb +1 -11
  710. data/spec/unit/util/json.rb +21 -0
  711. data/spec/unit/util/log.rb +45 -0
  712. data/spec/unit/util/package.rb +2 -2
  713. data/spec/unit/util/queue.rb +88 -0
  714. data/spec/unit/util/queue/stomp.rb +140 -0
  715. data/spec/unit/util/reference_serializer.rb +52 -0
  716. data/spec/unit/util/selinux.rb +5 -3
  717. data/spec/unit/util/settings.rb +413 -264
  718. data/spec/unit/util/settings/file_setting.rb +223 -0
  719. data/spec/unit/util/storage.rb +11 -11
  720. data/spec/unit/util/warnings.rb +21 -17
  721. data/test/Rakefile +6 -5
  722. data/test/certmgr/ca.rb +5 -5
  723. data/test/certmgr/certmgr.rb +4 -4
  724. data/test/data/providers/cron/crontab.allthree +2 -2
  725. data/test/data/providers/cron/crontab.envNcomment +1 -1
  726. data/test/data/providers/cron/crontab.envNname +1 -1
  727. data/test/data/providers/cron/crontab.multirecords +1 -1
  728. data/test/data/providers/cron/crontab_collections.yaml +14 -14
  729. data/test/data/providers/cron/crontab_multiple_with_env.yaml +6 -6
  730. data/test/data/providers/cron/crontab_sample_records.yaml +102 -102
  731. data/test/data/providers/mailalias/aliases/test1 +28 -0
  732. data/test/data/providers/package/testpackages.yaml +6 -6
  733. data/test/data/reports/1.yaml +17 -17
  734. data/test/data/reports/tagmail_passers.conf +2 -2
  735. data/test/data/snippets/append.pp +5 -5
  736. data/test/data/snippets/casestatement.pp +9 -2
  737. data/test/data/snippets/classincludes.pp +1 -1
  738. data/test/data/snippets/collection_override.pp +8 -0
  739. data/test/data/snippets/fqparents.pp +2 -2
  740. data/test/data/snippets/ifexpression.pp +12 -0
  741. data/test/data/snippets/multilinecomments.pp +5 -1
  742. data/test/data/snippets/selectorvalues.pp +7 -0
  743. data/test/data/types/hosts/1 +1 -1
  744. data/test/data/types/hosts/2 +3 -3
  745. data/test/data/types/hosts/solaris +2 -2
  746. data/test/data/types/mount/freebsd.fstab +7 -7
  747. data/test/data/types/mount/solaris.fstab +10 -10
  748. data/test/data/types/port/1 +472 -472
  749. data/test/data/types/port/darwin +4347 -4347
  750. data/test/language/ast.rb +3 -2
  751. data/test/language/ast/casestatement.rb +12 -12
  752. data/test/language/ast/resource.rb +4 -4
  753. data/test/language/ast/resource_reference.rb +5 -5
  754. data/test/language/ast/selector.rb +11 -11
  755. data/test/language/ast/variable.rb +4 -4
  756. data/test/language/functions.rb +16 -16
  757. data/test/language/parser.rb +89 -111
  758. data/test/language/resource.rb +3 -88
  759. data/test/language/scope.rb +14 -55
  760. data/test/language/snippets.rb +31 -31
  761. data/test/lib/puppettest.rb +12 -12
  762. data/test/lib/puppettest/certificates.rb +2 -2
  763. data/test/lib/puppettest/exetest.rb +0 -1
  764. data/test/lib/puppettest/fakes.rb +1 -1
  765. data/test/lib/puppettest/parsertesting.rb +9 -4
  766. data/test/lib/puppettest/railstesting.rb +3 -3
  767. data/test/lib/puppettest/servertest.rb +1 -1
  768. data/test/lib/puppettest/support/assertions.rb +2 -2
  769. data/test/lib/puppettest/support/collection.rb +1 -1
  770. data/test/lib/puppettest/support/resources.rb +7 -7
  771. data/test/lib/puppettest/support/utils.rb +10 -16
  772. data/test/lib/puppettest/testcase.rb +2 -1
  773. data/test/network/authconfig.rb +1 -1
  774. data/test/network/authorization.rb +1 -1
  775. data/test/network/authstore.rb +57 -14
  776. data/test/network/client/ca.rb +1 -0
  777. data/test/network/client/resource.rb +12 -50
  778. data/test/network/client_request.rb +1 -1
  779. data/test/network/handler/bucket.rb +2 -2
  780. data/test/network/handler/fileserver.rb +17 -21
  781. data/test/network/handler/master.rb +5 -5
  782. data/test/network/handler/report.rb +3 -3
  783. data/test/network/handler/resource.rb +29 -75
  784. data/test/network/handler/runner.rb +8 -58
  785. data/test/network/rights.rb +1 -1
  786. data/test/network/server/mongrel_test.rb +15 -1
  787. data/test/network/server/webrick.rb +0 -36
  788. data/test/network/xmlrpc/webrick_servlet.rb +5 -5
  789. data/test/other/dsl.rb +3 -3
  790. data/test/other/events.rb +15 -15
  791. data/test/other/puppet.rb +2 -32
  792. data/test/other/relationships.rb +21 -148
  793. data/test/other/report.rb +20 -23
  794. data/test/other/transactions.rb +110 -298
  795. data/test/puppet/defaults.rb +1 -1
  796. data/test/puppet/tc_suidmanager.rb +1 -1
  797. data/test/rails/railsparameter.rb +4 -4
  798. data/test/ral/manager/attributes.rb +12 -68
  799. data/test/ral/manager/instances.rb +3 -19
  800. data/test/ral/manager/manager.rb +7 -7
  801. data/test/ral/manager/provider.rb +7 -7
  802. data/test/ral/manager/type.rb +54 -349
  803. data/test/ral/providers/cron/crontab.rb +14 -14
  804. data/test/ral/providers/group.rb +5 -6
  805. data/test/ral/providers/host/parsed.rb +3 -3
  806. data/test/ral/providers/mailalias/aliases.rb +4 -4
  807. data/test/ral/providers/package.rb +3 -3
  808. data/test/ral/providers/package/aptitude.rb +55 -55
  809. data/test/ral/providers/package/aptrpm.rb +7 -7
  810. data/test/ral/providers/parsedfile.rb +10 -14
  811. data/test/ral/providers/port/parsed.rb +6 -6
  812. data/test/ral/providers/provider.rb +10 -10
  813. data/test/ral/providers/service/base.rb +32 -32
  814. data/test/ral/providers/sshkey/parsed.rb +14 -14
  815. data/test/ral/providers/user.rb +16 -17
  816. data/test/ral/providers/user/useradd.rb +19 -22
  817. data/test/ral/type/cron.rb +21 -28
  818. data/test/ral/type/exec.rb +57 -60
  819. data/test/ral/type/file.rb +88 -862
  820. data/test/ral/type/file/target.rb +21 -70
  821. data/test/ral/type/fileignoresource.rb +37 -44
  822. data/test/ral/type/filesources.rb +43 -473
  823. data/test/ral/type/group.rb +6 -7
  824. data/test/ral/type/host.rb +14 -30
  825. data/test/ral/type/mailalias.rb +3 -3
  826. data/test/ral/type/port.rb +5 -5
  827. data/test/ral/type/resources.rb +37 -37
  828. data/test/ral/type/service.rb +3 -3
  829. data/test/ral/type/sshkey.rb +34 -39
  830. data/test/ral/type/user.rb +15 -14
  831. data/test/ral/type/yumrepo.rb +18 -17
  832. data/test/ral/type/zone.rb +4 -6
  833. data/test/test +9 -9
  834. data/test/util/fileparsing.rb +10 -10
  835. data/test/util/inifile.rb +6 -6
  836. data/test/util/instance_loader.rb +1 -1
  837. data/test/util/log.rb +2 -2
  838. data/test/util/metrics.rb +1 -6
  839. data/test/util/package.rb +1 -1
  840. data/test/util/pidlock.rb +116 -116
  841. data/test/util/settings.rb +40 -429
  842. data/test/util/storage.rb +5 -5
  843. data/test/util/subclass_loader.rb +0 -7
  844. data/test/util/utiltest.rb +10 -29
  845. metadata +1369 -941
  846. data/bin/puppetca +0 -363
  847. data/bin/puppetd +0 -439
  848. data/bin/puppetmasterd +0 -289
  849. data/bin/puppetrun +0 -369
  850. data/conf/redhat/lsb-config.patch +0 -51
  851. data/conf/redhat/no-chuser-0.15.1.patch +0 -38
  852. data/conf/redhat/no-lockdir.patch +0 -13
  853. data/examples/mac_netinfo.pp +0 -5
  854. data/ext/passenger/README +0 -63
  855. data/ext/passenger/apache2.conf +0 -29
  856. data/ext/passenger/config.ru +0 -40
  857. data/lib/puppet/config_stores/rest.rb +0 -60
  858. data/lib/puppet/executables/client/certhandler.rb +0 -82
  859. data/lib/puppet/indirector/file_content/modules.rb +0 -11
  860. data/lib/puppet/indirector/file_metadata/modules.rb +0 -17
  861. data/lib/puppet/indirector/module_files.rb +0 -82
  862. data/lib/puppet/indirector/ssl_rsa.rb +0 -5
  863. data/lib/puppet/indirector/ssl_rsa/file.rb +0 -33
  864. data/lib/puppet/network/client/master.rb +0 -524
  865. data/lib/puppet/network/http_server/rack.rb +0 -148
  866. data/lib/puppet/pgraph.rb +0 -121
  867. data/lib/puppet/provider/group/netinfo.rb +0 -15
  868. data/lib/puppet/provider/host/netinfo.rb +0 -19
  869. data/lib/puppet/provider/mount/netinfo.rb +0 -37
  870. data/lib/puppet/provider/nameservice/netinfo.rb +0 -224
  871. data/lib/puppet/provider/user/netinfo.rb +0 -111
  872. data/lib/puppet/util/fact_store.rb +0 -59
  873. data/lib/puppet/util/uri_helper.rb +0 -22
  874. data/spec/integration/file_serving/configuration.rb +0 -43
  875. data/spec/integration/indirector/module_files.rb +0 -57
  876. data/spec/unit/executables/client/certhandler.rb +0 -135
  877. data/spec/unit/indirector/file_content/modules.rb +0 -18
  878. data/spec/unit/indirector/file_metadata/modules.rb +0 -42
  879. data/spec/unit/indirector/module_files.rb +0 -259
  880. data/spec/unit/indirector/ssl_rsa/file.rb +0 -121
  881. data/spec/unit/network/client/master.rb +0 -442
  882. data/spec/unit/node/catalog.rb +0 -865
  883. data/spec/unit/other/pgraph.rb +0 -210
  884. data/spec/unit/resource_reference.rb +0 -73
  885. data/spec/unit/util/uri_helper.rb +0 -41
  886. data/test/data/snippets/ifexpression.rb +0 -6
  887. data/test/executables/filebucket.rb +0 -51
  888. data/test/executables/puppetbin.rb +0 -104
  889. data/test/executables/puppetca.rb +0 -115
  890. data/test/executables/puppetd.rb +0 -55
  891. data/test/executables/puppetmasterd.rb +0 -147
  892. data/test/network/client/client.rb +0 -195
  893. data/test/network/client/master.rb +0 -490
  894. data/test/network/daemon.rb +0 -70
  895. data/test/network/handler/handler.rb +0 -63
  896. data/test/other/overrides.rb +0 -107
  897. data/test/puppet/conffiles.rb +0 -107
  898. data/test/rails/ast.rb +0 -73
  899. data/test/rails/configuration.rb +0 -71
  900. data/test/rails/host.rb +0 -154
  901. data/test/rails/railsresource.rb +0 -251
  902. data/test/ral/providers/host/netinfo.rb +0 -56
  903. data/test/ral/providers/mount/netinfo.rb +0 -79
  904. data/test/ral/type/basic.rb +0 -85
  905. data/test/ral/type/filebucket.rb +0 -157
  906. data/test/ral/type/parameter.rb +0 -174
  907. data/test/ral/type/property.rb +0 -388
  908. data/test/ral/type/tidy.rb +0 -291
  909. data/test/util/autoload.rb +0 -145
  910. data/test/util/features.rb +0 -95
@@ -6,17 +6,20 @@ require 'fileutils'
6
6
  require 'puppet/network/handler'
7
7
  require 'puppet/util/diff'
8
8
  require 'puppet/util/checksums'
9
+ require 'puppet/network/client'
10
+ require 'puppet/util/backups'
9
11
 
10
12
  module Puppet
11
13
  newtype(:file) do
12
14
  include Puppet::Util::MethodHelper
13
15
  include Puppet::Util::Checksums
16
+ include Puppet::Util::Backups
14
17
  @doc = "Manages local files, including setting ownership and
15
18
  permissions, creation of both files and directories, and
16
19
  retrieving entire files from remote servers. As Puppet matures, it
17
20
  expected that the ``file`` resource will be used less and less to
18
21
  manage content, and instead native resources will be used to do so.
19
-
22
+
20
23
  If you find that you are often copying files in from a central
21
24
  location, rather than using native resources, please contact
22
25
  Reductive Labs and we can hopefully work with you to develop a
@@ -28,9 +31,21 @@ module Puppet
28
31
 
29
32
  validate do |value|
30
33
  unless value =~ /^#{File::SEPARATOR}/
31
- raise Puppet::Error, "File paths must be fully qualified"
34
+ raise Puppet::Error, "File paths must be fully qualified, not '%s'" % value
32
35
  end
33
36
  end
37
+
38
+ # convert the current path in an index into the collection and the last
39
+ # path name. The aim is to use less storage for all common paths in a hierarchy
40
+ munge do |value|
41
+ path, name = File.split(value)
42
+ { :index => Puppet::FileCollection.collection.index(path), :name => name }
43
+ end
44
+
45
+ # and the reverse
46
+ unmunge do |value|
47
+ File.join( Puppet::FileCollection.collection.path(value[:index]), value[:name] )
48
+ end
34
49
  end
35
50
 
36
51
  newparam(:backup) do
@@ -45,11 +60,11 @@ module Puppet
45
60
  the same directory with that value as the extension of the
46
61
  backup. Setting ``backup => false`` disables all backups of the
47
62
  file in question.
48
-
63
+
49
64
  Puppet automatically creates a local filebucket named ``puppet`` and
50
65
  defaults to backing up there. To use a server-based filebucket,
51
66
  you must specify one in your configuration::
52
-
67
+
53
68
  filebucket { main:
54
69
  server => puppet
55
70
  }
@@ -74,39 +89,21 @@ module Puppet
74
89
  filebucketed files.
75
90
  "
76
91
 
77
- defaultto { "puppet" }
78
-
92
+ defaultto "puppet"
93
+
79
94
  munge do |value|
80
95
  # I don't really know how this is happening.
81
- if value.is_a?(Array)
82
- value = value.shift
83
- end
96
+ value = value.shift if value.is_a?(Array)
97
+
84
98
  case value
85
- when false, "false", :false:
99
+ when false, "false", :false
86
100
  false
87
- when true, "true", ".puppet-bak", :true:
101
+ when true, "true", ".puppet-bak", :true
88
102
  ".puppet-bak"
89
- when /^\./
103
+ when String
90
104
  value
91
- when String:
92
- # We can't depend on looking this up right now,
93
- # we have to do it after all of the objects
94
- # have been instantiated.
95
- if bucketobj = Puppet::Type.type(:filebucket)[value]
96
- @resource.bucket = bucketobj.bucket
97
- bucketobj.title
98
- else
99
- # Set it to the string; finish() turns it into a
100
- # filebucket.
101
- @resource.bucket = value
102
- value
103
- end
104
- when Puppet::Network::Client.client(:Dipper):
105
- @resource.bucket = value
106
- value.name
107
105
  else
108
- self.fail "Invalid backup type %s" %
109
- value.inspect
106
+ self.fail "Invalid backup type %s" % value.inspect
110
107
  end
111
108
  end
112
109
  end
@@ -115,7 +112,7 @@ module Puppet
115
112
  desc "Whether and how deeply to do recursive
116
113
  management."
117
114
 
118
- newvalues(:true, :false, :inf, /^[0-9]+$/)
115
+ newvalues(:true, :false, :inf, :remote, /^[0-9]+$/)
119
116
 
120
117
  # Replace the validation so that we allow numbers in
121
118
  # addition to string representations of them.
@@ -125,10 +122,42 @@ module Puppet
125
122
  case newval
126
123
  when :true, :inf: true
127
124
  when :false: false
125
+ when :remote: :remote
126
+ when Integer, Fixnum, Bignum:
127
+ self.warning "Setting recursion depth with the recurse parameter is now deprecated, please use recurselimit"
128
+
129
+ # recurse == 0 means no recursion
130
+ return false if value == 0
131
+
132
+ resource[:recurselimit] = value
133
+ true
134
+ when /^\d+$/:
135
+ self.warning "Setting recursion depth with the recurse parameter is now deprecated, please use recurselimit"
136
+ value = Integer(value)
137
+
138
+ # recurse == 0 means no recursion
139
+ return false if value == 0
140
+
141
+ resource[:recurselimit] = value
142
+ true
143
+ else
144
+ raise ArgumentError, "Invalid recurse value %s" % value.inspect
145
+ end
146
+ end
147
+ end
148
+
149
+ newparam(:recurselimit) do
150
+ desc "How deeply to do recursive management."
151
+
152
+ newvalues(/^[0-9]+$/)
153
+
154
+ munge do |value|
155
+ newval = super(value)
156
+ case newval
128
157
  when Integer, Fixnum, Bignum: value
129
158
  when /^\d+$/: Integer(value)
130
159
  else
131
- raise ArgumentError, "Invalid recurse value %s" % value.inspect
160
+ raise ArgumentError, "Invalid recurselimit value %s" % value.inspect
132
161
  end
133
162
  end
134
163
  end
@@ -156,8 +185,6 @@ module Puppet
156
185
  engine, so shell metacharacters are fully supported, e.g. ``[a-z]*``.
157
186
  Matches that would descend into the directory structure are ignored,
158
187
  e.g., ``*/*``."
159
-
160
- defaultto false
161
188
 
162
189
  validate do |value|
163
190
  unless value.is_a?(Array) or value.is_a?(String) or value == false
@@ -186,7 +213,7 @@ module Puppet
186
213
  this will destroy data. Only use this option for generated
187
214
  files unless you really know what you are doing. This option only
188
215
  makes sense when recursively managing directories.
189
-
216
+
190
217
  Note that when using ``purge`` with ``source``, Puppet will purge any files
191
218
  that are not on the remote system."
192
219
 
@@ -207,15 +234,13 @@ module Puppet
207
234
 
208
235
  newvalues(:first, :all)
209
236
  end
210
-
211
- attr_accessor :bucket
212
237
 
213
238
  # Autorequire any parent directories.
214
239
  autorequire(:file) do
215
- if self[:path]
216
- File.dirname(self[:path])
240
+ basedir = File.dirname(self[:path])
241
+ if basedir != self[:path]
242
+ basedir
217
243
  else
218
- Puppet.err "no path for %s, somehow; cannot setup autorequires" % self.ref
219
244
  nil
220
245
  end
221
246
  end
@@ -235,7 +260,7 @@ module Puppet
235
260
  end
236
261
  end
237
262
  end
238
-
263
+
239
264
  CREATORS = [:content, :source, :target]
240
265
 
241
266
  validate do
@@ -243,11 +268,22 @@ module Puppet
243
268
  CREATORS.each do |param|
244
269
  count += 1 if self.should(param)
245
270
  end
271
+ if @parameters.include?(:source)
272
+ count += 1
273
+ end
246
274
  if count > 1
247
275
  self.fail "You cannot specify more than one of %s" % CREATORS.collect { |p| p.to_s}.join(", ")
248
276
  end
277
+
278
+ if !self[:source] and self[:recurse] == :remote
279
+ self.fail "You cannot specify a remote recursion without a source"
280
+ end
281
+
282
+ if !self[:recurse] and self[:recurselimit]
283
+ self.warning "Possible error: recurselimit is set but not recurse, no recursion will happen"
284
+ end
249
285
  end
250
-
286
+
251
287
  def self.[](path)
252
288
  return nil unless path
253
289
  super(path.gsub(/\/+/, '/').sub(/\/$/, ''))
@@ -268,7 +304,7 @@ module Puppet
268
304
  obj[:check] = :all
269
305
  files << obj
270
306
  else
271
- files << self.create(
307
+ files << self.new(
272
308
  :name => path, :check => :all
273
309
  )
274
310
  end
@@ -278,11 +314,6 @@ module Puppet
278
314
 
279
315
  @depthfirst = false
280
316
 
281
-
282
- def argument?(arg)
283
- @arghash.include?(arg)
284
- end
285
-
286
317
  # Determine the user to write files as.
287
318
  def asuser
288
319
  if self.should(:owner) and ! self.should(:owner).is_a?(Symbol)
@@ -301,159 +332,68 @@ module Puppet
301
332
  return asuser
302
333
  end
303
334
 
335
+ def bucket
336
+ return @bucket if defined?(@bucket) and @bucket
337
+
338
+ backup = self[:backup]
339
+ return nil unless backup
340
+ return nil if backup =~ /^\./
341
+
342
+ unless catalog or backup == "puppet"
343
+ fail "Can not find filebucket for backups without a catalog"
344
+ end
345
+
346
+ unless catalog and filebucket = catalog.resource(:filebucket, backup) or backup == "puppet"
347
+ fail "Could not find filebucket %s specified in backup" % backup
348
+ end
349
+
350
+ return default_bucket unless filebucket
351
+
352
+ @bucket = filebucket.bucket
353
+
354
+ return @bucket
355
+ end
356
+
357
+ def default_bucket
358
+ Puppet::Type.type(:filebucket).mkdefaultbucket.bucket
359
+ end
360
+
361
+ # Does the file currently exist? Just checks for whether
362
+ # we have a stat
363
+ def exist?
364
+ stat ? true : false
365
+ end
366
+
304
367
  # We have to do some extra finishing, to retrieve our bucket if
305
368
  # there is one.
306
369
  def finish
307
- # Let's cache these values, since there should really only be
308
- # a couple of these buckets
309
- @@filebuckets ||= {}
310
-
311
370
  # Look up our bucket, if there is one
312
- if bucket = self.bucket
313
- case bucket
314
- when String:
315
- if obj = @@filebuckets[bucket]
316
- # This sets the @value on :backup, too
317
- self.bucket = obj
318
- elsif bucket == "puppet"
319
- obj = Puppet::Network::Client.client(:Dipper).new(
320
- :Path => Puppet[:clientbucketdir]
321
- )
322
- self.bucket = obj
323
- @@filebuckets[bucket] = obj
324
- elsif obj = Puppet::Type.type(:filebucket).bucket(bucket)
325
- @@filebuckets[bucket] = obj
326
- self.bucket = obj
327
- else
328
- self.fail "Could not find filebucket %s" % bucket
329
- end
330
- when Puppet::Network::Client.client(:Dipper): # things are hunky-dorey
331
- else
332
- self.fail "Invalid bucket type %s" % bucket.class
333
- end
334
- end
371
+ bucket()
335
372
  super
336
373
  end
337
-
374
+
338
375
  # Create any children via recursion or whatever.
339
376
  def eval_generate
340
- recurse()
341
- end
377
+ return [] unless self.recurse?
342
378
 
343
- # Deal with backups.
344
- def handlebackup(file = nil)
345
- # let the path be specified
346
- file ||= self[:path]
347
- # if they specifically don't want a backup, then just say
348
- # we're good
349
- unless FileTest.exists?(file)
350
- return true
351
- end
352
-
353
- unless self[:backup]
354
- return true
355
- end
379
+ recurse
380
+ #recurse.reject do |resource|
381
+ # catalog.resource(:file, resource[:path])
382
+ #end.each do |child|
383
+ # catalog.add_resource child
384
+ # catalog.relationship_graph.add_edge self, child
385
+ #end
386
+ end
356
387
 
357
- case File.stat(file).ftype
358
- when "directory":
359
- if self[:recurse]
360
- # we don't need to backup directories when recurse is on
361
- return true
362
- else
363
- backup = self.bucket || self[:backup]
364
- case backup
365
- when Puppet::Network::Client.client(:Dipper):
366
- notice "Recursively backing up to filebucket"
367
- require 'find'
368
- Find.find(self[:path]) do |f|
369
- if File.file?(f)
370
- sum = backup.backup(f)
371
- self.notice "Filebucketed %s to %s with sum %s" %
372
- [f, backup.name, sum]
373
- end
374
- end
375
-
376
- return true
377
- when String:
378
- newfile = file + backup
379
- # Just move it, since it's a directory.
380
- if FileTest.exists?(newfile)
381
- remove_backup(newfile)
382
- end
383
- begin
384
- bfile = file + backup
385
-
386
- # Ruby 1.8.1 requires the 'preserve' addition, but
387
- # later versions do not appear to require it.
388
- FileUtils.cp_r(file, bfile, :preserve => true)
389
- return true
390
- rescue => detail
391
- # since they said they want a backup, let's error out
392
- # if we couldn't make one
393
- self.fail "Could not back %s up: %s" %
394
- [file, detail.message]
395
- end
396
- else
397
- self.err "Invalid backup type %s" % backup.inspect
398
- return false
399
- end
400
- end
401
- when "file":
402
- backup = self.bucket || self[:backup]
403
- case backup
404
- when Puppet::Network::Client.client(:Dipper):
405
- sum = backup.backup(file)
406
- self.notice "Filebucketed to %s with sum %s" %
407
- [backup.name, sum]
408
- return true
409
- when String:
410
- newfile = file + backup
411
- if FileTest.exists?(newfile)
412
- remove_backup(newfile)
413
- end
414
- begin
415
- # FIXME Shouldn't this just use a Puppet object with
416
- # 'source' specified?
417
- bfile = file + backup
418
-
419
- # Ruby 1.8.1 requires the 'preserve' addition, but
420
- # later versions do not appear to require it.
421
- FileUtils.cp(file, bfile, :preserve => true)
422
- return true
423
- rescue => detail
424
- # since they said they want a backup, let's error out
425
- # if we couldn't make one
426
- self.fail "Could not back %s up: %s" %
427
- [file, detail.message]
428
- end
429
- else
430
- self.err "Invalid backup type %s" % backup.inspect
431
- return false
432
- end
433
- when "link": return true
434
- else
435
- self.notice "Cannot backup files of type %s" %
436
- File.stat(file).ftype
437
- return false
388
+ def flush
389
+ # We want to make sure we retrieve metadata anew on each transaction.
390
+ @parameters.each do |name, param|
391
+ param.flush if param.respond_to?(:flush)
438
392
  end
393
+ @stat = nil
439
394
  end
440
-
441
- def handleignore(children)
442
- return children unless self[:ignore]
443
- self[:ignore].each { |ignore|
444
- ignored = []
445
- Dir.glob(File.join(self[:path],ignore), File::FNM_DOTMATCH) {
446
- |match| ignored.push(File.basename(match))
447
- }
448
- children = children - ignored
449
- }
450
- return children
451
- end
452
-
453
- def initialize(hash)
454
- # Store a copy of the arguments for later.
455
- tmphash = hash.to_hash
456
395
 
396
+ def initialize(hash)
457
397
  # Used for caching clients
458
398
  @clients = {}
459
399
 
@@ -461,197 +401,42 @@ module Puppet
461
401
 
462
402
  # Get rid of any duplicate slashes, and remove any trailing slashes.
463
403
  @title = @title.gsub(/\/+/, "/")
464
-
465
- @title.sub!(/\/$/, "") unless @title == "/"
466
-
467
- # Clean out as many references to any file paths as possible.
468
- # This was the source of many, many bugs.
469
- @arghash = tmphash
470
- @arghash.delete(self.class.namevar)
471
404
 
472
- [:source, :parent].each do |param|
473
- if @arghash.include?(param)
474
- @arghash.delete(param)
475
- end
476
- end
405
+ @title.sub!(/\/$/, "") unless @title == "/"
477
406
 
478
407
  @stat = nil
479
408
  end
480
409
 
481
- # Build a recursive map of a link source
482
- def linkrecurse(recurse)
483
- target = @parameters[:target].should
484
-
485
- method = :lstat
486
- if self[:links] == :follow
487
- method = :stat
488
- end
489
-
490
- targetstat = nil
491
- unless FileTest.exist?(target)
492
- return
493
- end
494
- # Now stat our target
495
- targetstat = File.send(method, target)
496
- unless targetstat.ftype == "directory"
497
- return
498
- end
499
-
500
- # Now that we know our corresponding target is a directory,
501
- # change our type
502
- self[:ensure] = :directory
503
-
504
- unless FileTest.readable? target
505
- self.notice "Cannot manage %s: permission denied" % self.name
506
- return
507
- end
508
-
509
- children = Dir.entries(target).reject { |d| d =~ /^\.+$/ }
510
-
511
- # Get rid of ignored children
512
- if @parameters.include?(:ignore)
513
- children = handleignore(children)
514
- end
515
-
516
- added = []
517
- children.each do |file|
518
- Dir.chdir(target) do
519
- longname = File.join(target, file)
520
-
521
- # Files know to create directories when recursion
522
- # is enabled and we're making links
523
- args = {
524
- :recurse => recurse,
525
- :ensure => longname
526
- }
527
-
528
- if child = self.newchild(file, true, args)
529
- added << child
530
- end
531
- end
410
+ # Configure discovered resources to be purged.
411
+ def mark_children_for_purging(children)
412
+ children.each do |name, child|
413
+ next if child[:source]
414
+ child[:ensure] = :absent
532
415
  end
533
-
534
- added
535
416
  end
536
417
 
537
- # Build up a recursive map of what's around right now
538
- def localrecurse(recurse)
539
- unless FileTest.exist?(self[:path]) and self.stat.directory?
540
- #self.info "%s is not a directory; not recursing" %
541
- # self[:path]
542
- return
543
- end
544
-
545
- unless FileTest.readable? self[:path]
546
- self.notice "Cannot manage %s: permission denied" % self.name
547
- return
548
- end
549
-
550
- children = Dir.entries(self[:path])
551
-
552
- #Get rid of ignored children
553
- if @parameters.include?(:ignore)
554
- children = handleignore(children)
555
- end
556
-
557
- added = []
558
- children.each { |file|
559
- file = File.basename(file)
560
- next if file =~ /^\.\.?$/ # skip . and ..
561
- options = {:recurse => recurse}
562
-
563
- if child = self.newchild(file, true, options)
564
- added << child
565
- end
566
- }
567
-
568
- added
569
- end
570
-
571
418
  # Create a new file or directory object as a child to the current
572
419
  # object.
573
- def newchild(path, local, hash = {})
574
- raise(Puppet::DevError, "File recursion cannot happen without a catalog") unless catalog
420
+ def newchild(path)
421
+ full_path = File.join(self[:path], path)
575
422
 
576
- # make local copy of arguments
577
- args = symbolize_options(@arghash)
423
+ # Add some new values to our original arguments -- these are the ones
424
+ # set at initialization. We specifically want to exclude any param
425
+ # values set by the :source property or any default values.
426
+ # LAK:NOTE This is kind of silly, because the whole point here is that
427
+ # the values set at initialization should live as long as the resource
428
+ # but values set by default or by :source should only live for the transaction
429
+ # or so. Unfortunately, we don't have a straightforward way to manage
430
+ # the different lifetimes of this data, so we kludge it like this.
431
+ # The right-side hash wins in the merge.
432
+ options = @original_parameters.merge(:path => full_path).reject { |param, value| value.nil? }
578
433
 
579
- # There's probably a better way to do this, but we don't want
580
- # to pass this info on.
581
- if v = args[:ensure]
582
- v = symbolize(v)
583
- args.delete(:ensure)
434
+ # These should never be passed to our children.
435
+ [:parent, :ensure, :recurse, :recurselimit, :target, :alias, :source].each do |param|
436
+ options.delete(param) if options.include?(param)
584
437
  end
585
438
 
586
- if path =~ %r{^#{File::SEPARATOR}}
587
- self.devfail(
588
- "Must pass relative paths to PFile#newchild()"
589
- )
590
- else
591
- path = File.join(self[:path], path)
592
- end
593
-
594
- args[:path] = path
595
-
596
- unless hash.include?(:recurse)
597
- if args.include?(:recurse)
598
- if args[:recurse].is_a?(Integer)
599
- args[:recurse] -= 1 # reduce the level of recursion
600
- end
601
- end
602
-
603
- end
604
-
605
- hash.each { |key,value|
606
- args[key] = value
607
- }
608
-
609
- child = nil
610
-
611
- # The child might already exist because 'localrecurse' runs
612
- # before 'sourcerecurse'. I could push the override stuff into
613
- # a separate method or something, but the work is the same other
614
- # than this last bit, so it doesn't really make sense.
615
- if child = catalog.resource(:file, path)
616
- unless child.parent.object_id == self.object_id
617
- self.debug "Not managing more explicit file %s" %
618
- path
619
- return nil
620
- end
621
-
622
- # This is only necessary for sourcerecurse, because we might have
623
- # created the object with different 'should' values than are
624
- # set remotely.
625
- unless local
626
- args.each { |var,value|
627
- next if var == :path
628
- next if var == :name
629
-
630
- # behave idempotently
631
- unless child.should(var) == value
632
- child[var] = value
633
- end
634
- }
635
- end
636
- return nil
637
- else # create it anew
638
- #notice "Creating new file with args %s" % args.inspect
639
- args[:parent] = self
640
- begin
641
- # This method is used by subclasses of :file, so use the class name rather than hard-coding
642
- # :file.
643
- return nil unless child = catalog.create_implicit_resource(self.class.name, args)
644
- rescue => detail
645
- self.notice "Cannot manage: %s" % [detail]
646
- return nil
647
- end
648
- end
649
-
650
- # LAK:FIXME This shouldn't be necessary, but as long as we're
651
- # modeling the relationship graph specifically, it is.
652
- catalog.relationship_graph.add_edge self, child
653
-
654
- return child
439
+ return self.class.new(options)
655
440
  end
656
441
 
657
442
  # Files handle paths specially, because they just lengthen their
@@ -675,63 +460,60 @@ module Puppet
675
460
  return [self.ref]
676
461
  end
677
462
  end
678
-
463
+
679
464
  # Should we be purging?
680
465
  def purge?
681
466
  @parameters.include?(:purge) and (self[:purge] == :true or self[:purge] == "true")
682
467
  end
683
468
 
684
- # Recurse into the directory. This basically just calls 'localrecurse'
685
- # and maybe 'sourcerecurse', returning the collection of generated
686
- # files.
469
+ # Recursively generate a list of file resources, which will
470
+ # be used to copy remote files, manage local files, and/or make links
471
+ # to map to another directory.
687
472
  def recurse
688
- # are we at the end of the recursion?
689
- return unless self.recurse?
690
-
691
- recurse = self[:recurse]
692
- # we might have a string, rather than a number
693
- if recurse.is_a?(String)
694
- if recurse =~ /^[0-9]+$/
695
- recurse = Integer(recurse)
696
- else # anything else is infinite recursion
697
- recurse = true
698
- end
473
+ children = {}
474
+ if self[:recurse] != :remote
475
+ children = recurse_local
699
476
  end
700
477
 
701
- if recurse.is_a?(Integer)
702
- recurse -= 1
703
- end
704
-
705
- children = []
706
-
707
- # We want to do link-recursing before normal recursion so that all
708
- # of the target stuff gets copied over correctly.
709
- if @parameters.include? :target and ret = self.linkrecurse(recurse)
710
- children += ret
711
- end
712
- if ret = self.localrecurse(recurse)
713
- children += ret
478
+ if self[:target]
479
+ recurse_link(children)
480
+ elsif self[:source]
481
+ recurse_remote(children)
714
482
  end
715
483
 
716
- # These will be files pulled in by the file source
717
- sourced = false
718
- if @parameters.include?(:source)
719
- ret, sourced = self.sourcerecurse(recurse)
720
- if ret
721
- children += ret
722
- end
723
- end
484
+ # If we're purging resources, then delete any resource that isn't on the
485
+ # remote system.
486
+ mark_children_for_purging(children) if self.purge?
724
487
 
725
- # The purge check needs to happen after all of the other recursion.
726
- if self.purge?
727
- children.each do |child|
728
- if (sourced and ! sourced.include?(child[:path])) or ! child.managed?
729
- child[:ensure] = :absent
488
+ result = children.values.sort { |a, b| a[:path] <=> b[:path] }
489
+ remove_less_specific_files(result)
490
+ end
491
+
492
+ # This is to fix bug #2296, where two files recurse over the same
493
+ # set of files. It's a rare case, and when it does happen you're
494
+ # not likely to have many actual conflicts, which is good, because
495
+ # this is a pretty inefficient implementation.
496
+ def remove_less_specific_files(files)
497
+ # We sort the paths so we can short-circuit some tests.
498
+ mypath = self[:path]
499
+ other_paths = catalog.vertices.find_all do |r|
500
+ r.is_a?(self.class) and r[:path][0..(mypath.length - 1)] == mypath
501
+ end.collect { |r| r[:path] }.sort { |a, b| a.length <=> b.length } - [self[:path]]
502
+
503
+ return files if other_paths.empty?
504
+
505
+ remove = []
506
+ files.each do |file|
507
+ path = file[:path]
508
+ other_paths.each do |p|
509
+ if path[0..(p.length - 1)] == p
510
+ remove << file
511
+ break
730
512
  end
731
513
  end
732
514
  end
733
-
734
- children
515
+
516
+ files - remove
735
517
  end
736
518
 
737
519
  # A simple method for determining whether we should be recursing.
@@ -740,174 +522,120 @@ module Puppet
740
522
 
741
523
  val = @parameters[:recurse].value
742
524
 
743
- if val and (val == true or val > 0)
525
+ if val and (val == true or val == :remote)
744
526
  return true
745
527
  else
746
528
  return false
747
529
  end
748
530
  end
749
531
 
750
- # Remove the old backup.
751
- def remove_backup(newfile)
752
- if self.class.name == :file and self[:links] != :follow
753
- method = :lstat
754
- else
755
- method = :stat
532
+ # Recurse the target of the link.
533
+ def recurse_link(children)
534
+ perform_recursion(self[:target]).each do |meta|
535
+ if meta.relative_path == "."
536
+ self[:ensure] = :directory
537
+ next
538
+ end
539
+
540
+ children[meta.relative_path] ||= newchild(meta.relative_path)
541
+ if meta.ftype == "directory"
542
+ children[meta.relative_path][:ensure] = :directory
543
+ else
544
+ children[meta.relative_path][:ensure] = :link
545
+ children[meta.relative_path][:target] = meta.full_path
546
+ end
756
547
  end
757
- old = File.send(method, newfile).ftype
548
+ children
549
+ end
758
550
 
759
- if old == "directory"
760
- raise Puppet::Error,
761
- "Will not remove directory backup %s; use a filebucket" %
762
- newfile
551
+ # Recurse the file itself, returning a Metadata instance for every found file.
552
+ def recurse_local
553
+ result = perform_recursion(self[:path])
554
+ return {} unless result
555
+ result.inject({}) do |hash, meta|
556
+ next hash if meta.relative_path == "."
557
+
558
+ hash[meta.relative_path] = newchild(meta.relative_path)
559
+ hash
763
560
  end
561
+ end
764
562
 
765
- info "Removing old backup of type %s" %
766
- File.send(method, newfile).ftype
563
+ # Recurse against our remote file.
564
+ def recurse_remote(children)
565
+ sourceselect = self[:sourceselect]
767
566
 
768
- begin
769
- File.unlink(newfile)
770
- rescue => detail
771
- puts detail.backtrace if Puppet[:trace]
772
- self.err "Could not remove old backup: %s" % detail
773
- return false
567
+ total = self[:source].collect do |source|
568
+ next unless result = perform_recursion(source)
569
+ return if top = result.find { |r| r.relative_path == "." } and top.ftype != "directory"
570
+ result.each { |data| data.source = "%s/%s" % [source, data.relative_path] }
571
+ break result if result and ! result.empty? and sourceselect == :first
572
+ result
573
+ end.flatten
574
+
575
+ # This only happens if we have sourceselect == :all
576
+ unless sourceselect == :first
577
+ found = []
578
+ total.reject! do |data|
579
+ result = found.include?(data.relative_path)
580
+ found << data.relative_path unless found.include?(data.relative_path)
581
+ result
582
+ end
583
+ end
584
+
585
+ total.each do |meta|
586
+ if meta.relative_path == "."
587
+ parameter(:source).metadata = meta
588
+ next
589
+ end
590
+ children[meta.relative_path] ||= newchild(meta.relative_path)
591
+ children[meta.relative_path][:source] = meta.source
592
+ children[meta.relative_path][:checksum] = :md5 if meta.ftype == "file"
593
+
594
+ children[meta.relative_path].parameter(:source).metadata = meta
774
595
  end
596
+
597
+ children
598
+ end
599
+
600
+ def perform_recursion(path)
601
+ Puppet::FileServing::Metadata.search(path, :links => self[:links], :recurse => (self[:recurse] == :remote ? true : self[:recurse]), :recurselimit => self[:recurselimit], :ignore => self[:ignore])
775
602
  end
776
603
 
777
604
  # Remove any existing data. This is only used when dealing with
778
605
  # links or directories.
779
606
  def remove_existing(should)
780
- return unless s = stat(true)
607
+ return unless s = stat
781
608
 
782
- self.fail "Could not back up; will not replace" unless handlebackup
609
+ self.fail "Could not back up; will not replace" unless perform_backup
783
610
 
784
611
  unless should.to_s == "link"
785
- return if s.ftype.to_s == should.to_s
612
+ return if s.ftype.to_s == should.to_s
786
613
  end
787
614
 
788
615
  case s.ftype
789
- when "directory":
616
+ when "directory"
790
617
  if self[:force] == :true
791
618
  debug "Removing existing directory for replacement with %s" % should
792
619
  FileUtils.rmtree(self[:path])
793
620
  else
794
621
  notice "Not removing directory; use 'force' to override"
795
622
  end
796
- when "link", "file":
623
+ when "link", "file"
797
624
  debug "Removing existing %s for replacement with %s" %
798
625
  [s.ftype, should]
799
626
  File.unlink(self[:path])
800
627
  else
801
628
  self.fail "Could not back up files of type %s" % s.ftype
802
629
  end
630
+ expire
803
631
  end
804
632
 
805
633
  # a wrapper method to make sure the file exists before doing anything
806
634
  def retrieve
807
- unless stat = self.stat(true)
808
- self.debug "File does not exist"
809
- # If the file doesn't exist but we have a source, then call
810
- # retrieve on that property
811
-
812
- propertyvalues = properties().inject({}) { |hash, property|
813
- hash[property] = :absent
814
- hash
815
- }
816
-
817
- if @parameters.include?(:source)
818
- propertyvalues[:source] = @parameters[:source].retrieve
819
- end
820
- return propertyvalues
821
- end
822
-
823
- return currentpropvalues()
824
- end
825
-
826
- # This recurses against the remote source and makes sure the local
827
- # and remote structures match. It's run after 'localrecurse'. This
828
- # method only does anything when its corresponding remote entry is
829
- # a directory; in that case, this method creates file objects that
830
- # correspond to any contained remote files.
831
- def sourcerecurse(recurse)
832
- # we'll set this manually as necessary
833
- if @arghash.include?(:ensure)
834
- @arghash.delete(:ensure)
835
- end
836
-
837
- r = false
838
- if recurse
839
- unless recurse == 0
840
- r = 1
841
- end
635
+ if source = parameter(:source)
636
+ source.copy_source_values
842
637
  end
843
-
844
- ignore = self[:ignore]
845
-
846
- result = []
847
- found = []
848
-
849
- # Keep track of all the files we found in the source, so we can purge
850
- # appropriately.
851
- sourced = []
852
-
853
- success = false
854
-
855
- @parameters[:source].should.each do |source|
856
- sourceobj, path = uri2obj(source)
857
-
858
- # okay, we've got our source object; now we need to
859
- # build up a local file structure to match the remote
860
- # one
861
-
862
- server = sourceobj.server
863
-
864
- desc = server.list(path, self[:links], r, ignore)
865
- if desc == ""
866
- next
867
- end
868
-
869
- success = true
870
-
871
- # Now create a new child for every file returned in the list.
872
- result += desc.split("\n").collect { |line|
873
- file, type = line.split("\t")
874
- next if file == "/" # skip the listing object
875
- name = file.sub(/^\//, '')
876
-
877
- # This makes sure that the first source *always* wins
878
- # for conflicting files.
879
- next if found.include?(name)
880
-
881
- # For directories, keep all of the sources, so that
882
- # sourceselect still works as planned.
883
- if type == "directory"
884
- newsource = @parameters[:source].should.collect do |tmpsource|
885
- tmpsource + file
886
- end
887
- else
888
- newsource = source + file
889
- end
890
- args = {:source => newsource}
891
- if type == file
892
- args[:recurse] = nil
893
- end
894
-
895
- found << name
896
- sourced << File.join(self[:path], name)
897
-
898
- self.newchild(name, false, args)
899
- }.reject {|c| c.nil? }
900
-
901
- if self[:sourceselect] == :first
902
- return [result, sourced]
903
- end
904
- end
905
-
906
- unless success
907
- raise Puppet::Error, "None of the provided sources exist"
908
- end
909
-
910
- return [result, sourced]
638
+ super
911
639
  end
912
640
 
913
641
  # Set the checksum, from another property. There are multiple
@@ -926,11 +654,33 @@ module Puppet
926
654
  end
927
655
  end
928
656
 
657
+ # Should this thing be a normal file? This is a relatively complex
658
+ # way of determining whether we're trying to create a normal file,
659
+ # and it's here so that the logic isn't visible in the content property.
660
+ def should_be_file?
661
+ return true if self[:ensure] == :file
662
+
663
+ # I.e., it's set to something like "directory"
664
+ return false if e = self[:ensure] and e != :present
665
+
666
+ # The user doesn't really care, apparently
667
+ if self[:ensure] == :present
668
+ return true unless s = stat
669
+ return true if s.ftype == "file"
670
+ return false
671
+ end
672
+
673
+ # If we've gotten here, then :ensure isn't set
674
+ return true if self[:content]
675
+ return true if stat and stat.ftype == "file"
676
+ return false
677
+ end
678
+
929
679
  # Stat our file. Depending on the value of the 'links' attribute, we
930
680
  # use either 'stat' or 'lstat', and we expect the properties to use the
931
681
  # resulting stat object accordingly (mostly by testing the 'ftype'
932
682
  # value).
933
- def stat(refresh = false)
683
+ cached_attr(:stat) do
934
684
  method = :stat
935
685
 
936
686
  # Files are the only types that support links
@@ -938,23 +688,15 @@ module Puppet
938
688
  method = :lstat
939
689
  end
940
690
  path = self[:path]
941
- # Just skip them when they don't exist at all.
942
- unless FileTest.exists?(path) or FileTest.symlink?(path)
943
- @stat = nil
944
- return @stat
945
- end
946
- if @stat.nil? or refresh == true
947
- begin
948
- @stat = File.send(method, self[:path])
949
- rescue Errno::ENOENT => error
950
- @stat = nil
951
- rescue Errno::EACCES => error
952
- self.warning "Could not stat; permission denied"
953
- @stat = nil
954
- end
955
- end
956
691
 
957
- return @stat
692
+ begin
693
+ File.send(method, self[:path])
694
+ rescue Errno::ENOENT => error
695
+ return nil
696
+ rescue Errno::EACCES => error
697
+ warning "Could not stat; permission denied"
698
+ return nil
699
+ end
958
700
  end
959
701
 
960
702
  # We have to hack this just a little bit, because otherwise we'll get
@@ -968,75 +710,6 @@ module Puppet
968
710
  obj
969
711
  end
970
712
 
971
- def localfileserver
972
- unless defined? @@localfileserver
973
- args = {
974
- :Local => true,
975
- :Mount => { "/" => "localhost" },
976
- :Config => false
977
- }
978
- @@localfileserver = Puppet::Network::Handler.handler(:fileserver).new(args)
979
- end
980
- @@localfileserver
981
- end
982
-
983
- def uri2obj(source)
984
- sourceobj = Puppet::Type::File::FileSource.new
985
- path = nil
986
- unless source
987
- devfail "Got a nil source"
988
- end
989
- if source =~ /^\//
990
- source = "file://localhost/%s" % URI.escape(source)
991
- sourceobj.mount = "localhost"
992
- sourceobj.local = true
993
- end
994
- begin
995
- uri = URI.parse(URI.escape(source))
996
- rescue => detail
997
- self.fail "Could not understand source %s: %s" %
998
- [source, detail.to_s]
999
- end
1000
-
1001
- case uri.scheme
1002
- when "file":
1003
- sourceobj.server = localfileserver
1004
- path = "/localhost" + uri.path
1005
- when "puppet":
1006
- # FIXME: We should cache clients by uri.host + uri.port
1007
- # not by the full source path
1008
- unless @clients.include?(source)
1009
- host = uri.host
1010
- host ||= Puppet[:server] unless Puppet[:name] == "puppet"
1011
- if host.nil?
1012
- server = localfileserver
1013
- else
1014
- args = { :Server => host }
1015
- if uri.port
1016
- args[:Port] = uri.port
1017
- end
1018
- server = Puppet::Network::Client.file.new(args)
1019
- end
1020
- @clients[source] = server
1021
- end
1022
- sourceobj.server = @clients[source]
1023
-
1024
- tmp = uri.path
1025
- if tmp =~ %r{^/(\w+)}
1026
- sourceobj.mount = $1
1027
- path = tmp
1028
- #path = tmp.sub(%r{^/\w+},'') || "/"
1029
- else
1030
- self.fail "Invalid source path %s" % tmp
1031
- end
1032
- else
1033
- self.fail "Got other URL type '%s' from %s" %
1034
- [uri.scheme, source]
1035
- end
1036
-
1037
- return [sourceobj, path.sub(/\/\//, '/')]
1038
- end
1039
-
1040
713
  # Write out the file. Requires the content to be written,
1041
714
  # the property name for logging, and the checksum for validation.
1042
715
  def write(content, property, checksum = nil)
@@ -1049,8 +722,14 @@ module Puppet
1049
722
  remove_existing(:file)
1050
723
 
1051
724
  use_temporary_file = (content.length != 0)
1052
- path = self[:path]
1053
- path += ".puppettmp" if use_temporary_file
725
+ if use_temporary_file
726
+ path = "#{self[:path]}.puppettmp_#{rand(10000)}"
727
+ while File.exists?(path) or File.symlink?(path)
728
+ path = "#{self[:path]}.puppettmp_#{rand(10000)}"
729
+ end
730
+ else
731
+ path = self[:path]
732
+ end
1054
733
 
1055
734
  mode = self.should(:mode) # might be nil
1056
735
  umask = mode ? 000 : 022
@@ -1065,7 +744,7 @@ module Puppet
1065
744
  fail_if_checksum_is_wrong(path, checksum) if validate
1066
745
  File.rename(path, self[:path])
1067
746
  rescue => detail
1068
- self.err "Could not rename tmp %s for replacing: %s" % [self[:path], detail]
747
+ fail "Could not rename temporary file %s to %s : %s" % [path, self[:path], detail]
1069
748
  ensure
1070
749
  # Make sure the created file gets removed
1071
750
  File.unlink(path) if FileTest.exists?(path)
@@ -1130,20 +809,14 @@ module Puppet
1130
809
  next unless [:mode, :owner, :group, :seluser, :selrole, :seltype, :selrange].include?(thing.name)
1131
810
 
1132
811
  # Make sure we get a new stat objct
1133
- self.stat(true)
812
+ expire
1134
813
  currentvalue = thing.retrieve
1135
814
  unless thing.insync?(currentvalue)
1136
815
  thing.sync
1137
816
  end
1138
817
  end
1139
818
  end
1140
- end # Puppet.type(:pfile)
1141
-
1142
- # the filesource class can't include the path, because the path
1143
- # changes for every file instance
1144
- class ::Puppet::Type::File::FileSource
1145
- attr_accessor :mount, :root, :server, :local
1146
- end
819
+ end # Puppet::Type.type(:pfile)
1147
820
 
1148
821
  # We put all of the properties in separate files, because there are so many
1149
822
  # of them. The order these are loaded is important, because it determines