puppet 2.6.4 → 2.6.5

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 (221) hide show
  1. data/CHANGELOG +147 -0
  2. data/LICENSE +2 -2
  3. data/Rakefile +3 -4
  4. data/lib/puppet.rb +1 -1
  5. data/lib/puppet/application.rb +22 -5
  6. data/lib/puppet/application/apply.rb +2 -18
  7. data/lib/puppet/application/doc.rb +1 -4
  8. data/lib/puppet/application/inspect.rb +178 -0
  9. data/lib/puppet/configurer.rb +9 -11
  10. data/lib/puppet/configurer/plugin_handler.rb +0 -2
  11. data/lib/puppet/defaults.rb +12 -3
  12. data/lib/puppet/external/pson/pure/generator.rb +1 -22
  13. data/lib/puppet/file_bucket/dipper.rb +9 -3
  14. data/lib/puppet/file_bucket/file.rb +14 -94
  15. data/lib/puppet/indirector.rb +4 -0
  16. data/lib/puppet/indirector/catalog/active_record.rb +1 -1
  17. data/lib/puppet/indirector/file_bucket_file/file.rb +64 -75
  18. data/lib/puppet/indirector/indirection.rb +18 -8
  19. data/lib/puppet/indirector/resource/ral.rb +7 -2
  20. data/lib/puppet/indirector/rest.rb +19 -2
  21. data/lib/puppet/network/http/api/v1.rb +3 -0
  22. data/lib/puppet/network/http/handler.rb +16 -1
  23. data/lib/puppet/network/http/rack/rest.rb +1 -3
  24. data/lib/puppet/network/rest_authconfig.rb +4 -12
  25. data/lib/puppet/network/rights.rb +28 -14
  26. data/lib/puppet/parser/ast.rb +4 -0
  27. data/lib/puppet/parser/compiler.rb +18 -3
  28. data/lib/puppet/parser/functions/defined.rb +28 -6
  29. data/lib/puppet/parser/functions/fqdn_rand.rb +6 -3
  30. data/lib/puppet/parser/templatewrapper.rb +1 -0
  31. data/lib/puppet/property.rb +16 -1
  32. data/lib/puppet/property/keyvalue.rb +0 -2
  33. data/lib/puppet/property/list.rb +0 -2
  34. data/lib/puppet/provider/file/posix.rb +1 -3
  35. data/lib/puppet/provider/file/win32.rb +1 -3
  36. data/lib/puppet/provider/maillist/mailman.rb +3 -5
  37. data/lib/puppet/provider/mount.rb +2 -0
  38. data/lib/puppet/provider/nameservice/directoryservice.rb +2 -2
  39. data/lib/puppet/provider/package/freebsd.rb +2 -2
  40. data/lib/puppet/provider/zone/solaris.rb +1 -1
  41. data/lib/puppet/reference/configuration.rb +2 -2
  42. data/lib/puppet/reference/function.rb +4 -0
  43. data/lib/puppet/relationship.rb +4 -0
  44. data/lib/puppet/reports/store.rb +1 -19
  45. data/lib/puppet/resource.rb +11 -2
  46. data/lib/puppet/resource/status.rb +24 -3
  47. data/lib/puppet/resource/type.rb +24 -16
  48. data/lib/puppet/resource/type_collection.rb +4 -1
  49. data/lib/puppet/simple_graph.rb +4 -0
  50. data/lib/puppet/transaction.rb +1 -28
  51. data/lib/puppet/transaction/event.rb +9 -4
  52. data/lib/puppet/transaction/report.rb +42 -22
  53. data/lib/puppet/transaction/resource_harness.rb +99 -71
  54. data/lib/puppet/type.rb +22 -9
  55. data/lib/puppet/type/cron.rb +1 -5
  56. data/lib/puppet/type/exec.rb +4 -34
  57. data/lib/puppet/type/file.rb +19 -26
  58. data/lib/puppet/type/file/checksum.rb +1 -1
  59. data/lib/puppet/type/file/content.rb +2 -1
  60. data/lib/puppet/type/file/ctime.rb +18 -0
  61. data/lib/puppet/type/file/ensure.rb +1 -1
  62. data/lib/puppet/type/file/mode.rb +10 -44
  63. data/lib/puppet/type/file/mtime.rb +17 -0
  64. data/lib/puppet/type/file/owner.rb +1 -1
  65. data/lib/puppet/type/file/source.rb +0 -1
  66. data/lib/puppet/type/file/target.rb +1 -1
  67. data/lib/puppet/type/file/type.rb +5 -12
  68. data/lib/puppet/type/host.rb +1 -1
  69. data/lib/puppet/type/mount.rb +2 -2
  70. data/lib/puppet/type/package.rb +0 -2
  71. data/lib/puppet/type/service.rb +11 -5
  72. data/lib/puppet/type/user.rb +7 -9
  73. data/lib/puppet/type/yumrepo.rb +2 -2
  74. data/lib/puppet/type/zpool.rb +0 -4
  75. data/lib/puppet/util/checksums.rb +24 -1
  76. data/lib/puppet/util/command_line.rb +6 -2
  77. data/lib/puppet/util/command_line/puppet +5 -1
  78. data/lib/puppet/util/command_line/puppetca +2 -2
  79. data/lib/puppet/util/command_line/puppetd +11 -9
  80. data/lib/puppet/util/command_line/puppetdoc +2 -2
  81. data/lib/puppet/util/command_line/puppetmasterd +5 -0
  82. data/lib/puppet/util/log.rb +15 -8
  83. data/lib/puppet/util/log/destinations.rb +2 -0
  84. data/lib/puppet/util/log_paths.rb +1 -1
  85. data/lib/puppet/util/logging.rb +1 -1
  86. data/lib/puppet/util/metric.rb +1 -0
  87. data/lib/puppet/util/reference.rb +1 -10
  88. data/lib/puppet/util/settings.rb +1 -1
  89. data/lib/puppet/util/zaml.rb +30 -31
  90. data/spec/fixtures/unit/provider/mount/mount-output.aix.txt +7 -0
  91. data/spec/integration/application/apply_spec.rb +1 -2
  92. data/spec/integration/defaults_spec.rb +1 -0
  93. data/spec/integration/indirector/catalog/queue_spec.rb +1 -4
  94. data/spec/integration/indirector/report/rest_spec.rb +13 -17
  95. data/spec/integration/network/formats_spec.rb +2 -5
  96. data/spec/integration/network/server/mongrel_spec.rb +1 -2
  97. data/spec/integration/provider/mailalias/aliases_spec.rb +0 -1
  98. data/spec/integration/provider/package_spec.rb +1 -3
  99. data/spec/integration/provider/service/init_spec.rb +3 -9
  100. data/spec/integration/reference/providers_spec.rb +2 -2
  101. data/spec/integration/resource/catalog_spec.rb +1 -2
  102. data/spec/integration/transaction/report_spec.rb +1 -1
  103. data/spec/monkey_patches/alias_should_to_must.rb +2 -0
  104. data/spec/shared_behaviours/file_server_terminus.rb +1 -1
  105. data/spec/shared_behaviours/file_serving.rb +1 -1
  106. data/spec/shared_behaviours/memory_terminus.rb +1 -1
  107. data/spec/spec_helper.rb +8 -6
  108. data/spec/unit/application/agent_spec.rb +1 -0
  109. data/spec/unit/application/apply_spec.rb +7 -7
  110. data/spec/unit/application/doc_spec.rb +2 -2
  111. data/spec/unit/application/filebucket_spec.rb +1 -0
  112. data/spec/unit/application/inspect_spec.rb +278 -0
  113. data/spec/unit/application/kick_spec.rb +1 -3
  114. data/spec/unit/application/master_spec.rb +1 -3
  115. data/spec/unit/application/queue_spec.rb +1 -0
  116. data/spec/unit/application_spec.rb +63 -5
  117. data/spec/unit/configurer/plugin_handler_spec.rb +5 -1
  118. data/spec/unit/configurer_spec.rb +33 -49
  119. data/spec/unit/file_bucket/dipper_spec.rb +69 -77
  120. data/spec/unit/file_bucket/file_spec.rb +12 -127
  121. data/spec/unit/file_serving/fileset_spec.rb +1 -0
  122. data/spec/unit/file_serving/metadata_spec.rb +4 -4
  123. data/spec/unit/indirector/active_record_spec.rb +1 -0
  124. data/spec/unit/indirector/catalog/active_record_spec.rb +29 -13
  125. data/spec/unit/indirector/facts/active_record_spec.rb +2 -3
  126. data/spec/unit/indirector/facts/couch_spec.rb +1 -2
  127. data/spec/unit/indirector/file_bucket_file/file_spec.rb +202 -218
  128. data/spec/unit/indirector/file_server_spec.rb +6 -7
  129. data/spec/unit/indirector/indirection_spec.rb +71 -2
  130. data/spec/unit/indirector/ldap_spec.rb +2 -6
  131. data/spec/unit/indirector/node/active_record_spec.rb +1 -3
  132. data/spec/unit/indirector/queue_spec.rb +1 -3
  133. data/spec/unit/indirector/rest_spec.rb +37 -1
  134. data/spec/unit/indirector/ssl_file_spec.rb +5 -5
  135. data/spec/unit/indirector_spec.rb +6 -1
  136. data/spec/unit/module_spec.rb +1 -3
  137. data/spec/unit/network/formats_spec.rb +2 -5
  138. data/spec/unit/network/http/api/v1_spec.rb +4 -0
  139. data/spec/unit/network/http/compression_spec.rb +1 -3
  140. data/spec/unit/network/http/handler_spec.rb +39 -0
  141. data/spec/unit/network/http/mongrel/rest_spec.rb +1 -2
  142. data/spec/unit/network/http/mongrel_spec.rb +3 -9
  143. data/spec/unit/network/http/rack/rest_spec.rb +1 -3
  144. data/spec/unit/network/http/rack/xmlrpc_spec.rb +2 -3
  145. data/spec/unit/network/http/rack_spec.rb +2 -3
  146. data/spec/unit/network/http/webrick_spec.rb +1 -0
  147. data/spec/unit/network/rest_authconfig_spec.rb +1 -1
  148. data/spec/unit/network/rights_spec.rb +43 -23
  149. data/spec/unit/network/xmlrpc/client_spec.rb +1 -0
  150. data/spec/unit/parameter_spec.rb +1 -2
  151. data/spec/unit/parser/collector_spec.rb +3 -6
  152. data/spec/unit/parser/compiler_spec.rb +90 -5
  153. data/spec/unit/parser/lexer_spec.rb +3 -2
  154. data/spec/unit/parser/templatewrapper_spec.rb +1 -0
  155. data/spec/unit/property/keyvalue_spec.rb +5 -5
  156. data/spec/unit/property/list_spec.rb +7 -7
  157. data/spec/unit/provider/mount/parsed_spec.rb +1 -2
  158. data/spec/unit/provider/mount_spec.rb +8 -0
  159. data/spec/unit/provider/nameservice/directoryservice_spec.rb +38 -0
  160. data/spec/unit/provider/package/freebsd_spec.rb +55 -0
  161. data/spec/unit/provider/service/init_spec.rb +2 -0
  162. data/spec/unit/rails/host_spec.rb +1 -3
  163. data/spec/unit/rails/param_value_spec.rb +2 -3
  164. data/spec/unit/rails/resource_spec.rb +2 -3
  165. data/spec/unit/rails_spec.rb +5 -15
  166. data/spec/unit/relationship_spec.rb +2 -6
  167. data/spec/unit/reports/http_spec.rb +1 -1
  168. data/spec/unit/reports/store_spec.rb +31 -0
  169. data/spec/unit/reports/tagmail_spec.rb +1 -1
  170. data/spec/unit/resource/catalog_spec.rb +2 -6
  171. data/spec/unit/resource/status_spec.rb +53 -3
  172. data/spec/unit/resource/type_collection_spec.rb +0 -8
  173. data/spec/unit/resource/type_spec.rb +50 -4
  174. data/spec/unit/resource_spec.rb +10 -6
  175. data/spec/unit/ssl/certificate_authority/interface_spec.rb +1 -1
  176. data/spec/unit/transaction/event_spec.rb +21 -2
  177. data/spec/unit/transaction/report_spec.rb +91 -35
  178. data/spec/unit/transaction/resource_harness_spec.rb +289 -208
  179. data/spec/unit/transaction_spec.rb +1 -6
  180. data/spec/unit/type/augeas_spec.rb +1 -3
  181. data/spec/unit/type/file/content_spec.rb +63 -10
  182. data/spec/unit/type/file/ctime.rb +35 -0
  183. data/spec/unit/type/file/ensure_spec.rb +8 -7
  184. data/spec/unit/type/file/group_spec.rb +5 -5
  185. data/spec/unit/type/file/mtime.rb +35 -0
  186. data/spec/unit/type/file/owner_spec.rb +7 -7
  187. data/spec/unit/type/file/selinux_spec.rb +2 -2
  188. data/spec/unit/type/file/source_spec.rb +3 -3
  189. data/spec/unit/type/file/type.rb +20 -0
  190. data/spec/unit/type/file_spec.rb +131 -8
  191. data/spec/unit/type/mount_spec.rb +4 -4
  192. data/spec/unit/type/package_spec.rb +3 -3
  193. data/spec/unit/type/ssh_authorized_key_spec.rb +1 -1
  194. data/spec/unit/type/user_spec.rb +31 -3
  195. data/spec/unit/type/zpool_spec.rb +12 -12
  196. data/spec/unit/type_spec.rb +2 -2
  197. data/spec/unit/util/checksums_spec.rb +9 -1
  198. data/spec/unit/util/command_line_spec.rb +29 -0
  199. data/spec/unit/util/log/destinations_spec.rb +13 -0
  200. data/spec/unit/util/log_spec.rb +24 -12
  201. data/spec/unit/util/logging_spec.rb +1 -1
  202. data/spec/unit/util/metric_spec.rb +7 -7
  203. data/spec/unit/util/pson_spec.rb +15 -0
  204. data/spec/unit/util/queue/stomp_spec.rb +2 -6
  205. data/spec/unit/util/settings/file_setting_spec.rb +1 -3
  206. data/spec/unit/util/zaml_spec.rb +51 -0
  207. data/test/language/snippets.rb +3 -0
  208. data/test/lib/puppettest/fileparsing.rb +2 -0
  209. data/test/lib/puppettest/reporttesting.rb +1 -1
  210. data/test/lib/puppettest/support/utils.rb +1 -1
  211. data/test/network/server/mongrel_test.rb +0 -6
  212. data/test/other/report.rb +1 -1
  213. data/test/ral/providers/cron/crontab.rb +4 -1
  214. data/test/ral/type/file.rb +1 -1
  215. data/test/ral/type/filesources.rb +1 -4
  216. metadata +1119 -1113
  217. data/lib/puppet/transaction/change.rb +0 -87
  218. data/spec/Rakefile +0 -91
  219. data/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +0 -46
  220. data/spec/spec_specs/runnable_spec.rb +0 -95
  221. data/spec/unit/transaction/change_spec.rb +0 -193
data/CHANGELOG CHANGED
@@ -1,3 +1,150 @@
1
+ 2.6.5
2
+ =====
3
+ 30fa41d Updated CHANGELOG for 2.6.5rc5
4
+ b481321 (#6337) Fix Ruby warning on 1.8.6 about "future compatibility"
5
+ dcce45c (#6353) Restore the ability to store paths in the filebucket
6
+ 0450197 (#6126) Puppet inspect now reports status after run completes.
7
+ 960890f (#6364) Adjust mis-translated regex in mount provider for AIX
8
+ 9e0f9c5 Updated CHANGELOG for 2.6.5rc4
9
+ 664ef67 (#3646) Fix the documentation fix for `puppet apply --apply`
10
+ 4b6519a Updated CHANGELOG for 2.6.5rc3
11
+ 7ef2fbf Updated fix for #3646 - apply / compile documentation
12
+ 193016d (#5977) fix spec test failure when new applications are introduced.
13
+ c08fc1b Updated CHANGELOG for 2.6.5rc2
14
+ 1f89906 (#6257) Speed up PUT and POST requests under rack
15
+ 70a43c4 Updated CHANGELOG and version for 2.6.5rc1
16
+ f108f03 (#6018) Nick F's --help text for puppet inspect.
17
+ 04ea826 (#5823) document the not-an-API status of set_run_mode
18
+ 4ff5769 (#5823) run mode can now be set dynamically...
19
+ bddfa1e (6114) Update the audit metaparameter for 2.6.5.
20
+ ac8d316 Fix for #5755 -- making zaml serialization robust over projected objects
21
+ c912a2a (#4139) hook log autoflush into global defaults
22
+ f9e2e2b Augmentation of tests for prior commit
23
+ 392504a Fix to fix for #5755 -- backref serialization issues in zaml
24
+ a732a15 Fixed #5564 - Added some more fqdn_rand documentation
25
+ f279f2c Fixed #4968 - Updated list of options turned on by --test in documentation
26
+ ce5a2bf (#5061) - allow special hostclass/define variables to be evaluated as defaults.
27
+ fd73874 (#6107) Fix an error when auditing a file with empty content
28
+ 530496b Remove already initialized constant warning from file_spec.rb tests
29
+ 76788f8 (#5566) Treat source only File checksums as syntax errors when used with content
30
+ d657292 Rename variable used in File type validation to be more clear
31
+ 3398139 Remove invalid "timestamp" and "time", and add missing "ctime" File checksum types.
32
+ 6c93eb2 Remove order dependency when specifying source and checksum on File type
33
+ 3a125d4 Bug #5755 -- ZAML generates extra newline in some hash backreferences.
34
+ 50c12e5 bug #5681 -- code fix to handle AIX mount output
35
+ 139760b Bug #5681 -- parse AIX mount command output.
36
+ 2f74d83 Spec for #5681 to allow parsing of AIX mount output in mount provider
37
+ 878f266 Fixed #6091 - Changed POSIX path matching to allow multiple leading slashes
38
+ eb97aa5 Bug #6091 -- test leading double-slash in filenames are allowed.
39
+ 1bfc9a0 Fixed #6071 - Fixed typo and improved exec path error message
40
+ c50a48e Fixed #6061 - Allowed -1 as password min/max age
41
+ bf44e72 Bug #6061 -- verify that negative {min,max}_password_age are accepted.
42
+ af1c1fe Feature #5855 -- fix withenv call in freebsd package provider
43
+ d871641 Feature #5855 -- undefined method 'withenv' in FreeBSD package provider.
44
+ f1ab588 Fixed #6009 - nested member list vs directory service group provider
45
+ 86a2a00 (#5944) Remove documentation of define() when used on nodes, as it is not a supported use of this function.
46
+ 2b9f653 (#5944) Further edits of inline defined() documentation.
47
+ 5d108e8 (#5944) Improve documentation of defined() function
48
+ 7d38ab2 (#5594) Update documentation of exec resource type.
49
+ 67e1bba (#5931) Prevent errors when calling insync? on audited properties
50
+ 0f9d236 Maint: Removed dead code from resource harness.
51
+ 0765afb Maint: Rename misleading insync? method in file provider
52
+ 0084b08 (#5548) Specify return values of manual status commands in service type description.
53
+ dd332f6 Fixed #6002 - Added note about function execution
54
+ 3cfbd07 (#5045) Cleaning up some tests and code
55
+ a2036ea (#5045) External node classifiers should be able to specify params for classes
56
+ 18ca97b (#5045) Adds support to resource/type to also accept a param hash
57
+ 70630b9 Fix #3165 Ralsh (bin/puppet resource) can't manage files
58
+ 1fd3600 Fixed #3646 - Added documentation for compile and apply to man page
59
+ ae48634 Fixed #5914 Removed genconfig = true from genconfig output
60
+ 7e7f342 Fixed #1657 - Added note about target file
61
+ 069f29b Fixed #2096 - clarified option modification and tested it is working
62
+ 66b442b Fixes #5916 - Cleanup of unused doc methods and documentation
63
+ 9b74968 Modified rubydoc in lib/puppet/util/command_line/puppetca to fix inaccurate description of --clean.
64
+ e58f5dc Fixed #5742 - Removed legacy fqdn option from documentation
65
+ 4d1b51f Fixed #5167 - misleading documentation in the defaults of [main]
66
+ c1b5c7f (#5913) Fix Puppet::Application.find constant lookup behavior
67
+ 7b3b56e (5977) Puppet::Applications can be loaded from multiple paths.
68
+ f9bfb96 (#5900) Include ResourceStatus#failed in serialized reports
69
+ 79b6332 (#5882) Added error-handling for bucketing files in puppet inspect
70
+ 17843d5 (#5882) Added error-handling to puppet inspect when auditing
71
+ 1a6fab2 (#5171) Made "puppet inspect" upload audited files to a file bucket
72
+ a7cd185 Prep for #5171: Added a missing require to inspect application.
73
+ 71ac9cf Locked Puppet license to GPLv2
74
+ abc6256 (#5838) Support paths as part of file bucket requests.
75
+ 002f9f1 (#5838) Improve the quality of file bucket specs.
76
+ 94d7179 (#5838) Make file bucket dipper efficient when saving a file that already exists
77
+ 89f5692 (#5838) Implemented the "head" method for FileBucketFile::File terminus.
78
+ 9cfd3d5 (#5838) Reworked file dipper spec to perform less stubbing.
79
+ c514c64 (#5838) Added support for HEAD requests to the indirector.
80
+ 2b9b7a5 (#5838) Refactored error handling logic into find_in_cache.
81
+ 08561b2 (#5838) Refactored Puppet::Network::Rights#fail_on_deny
82
+ 87c5c30 (#5910) Improved logging when declared classes cannot be found:
83
+ 4efc98a maint: Remove unused Rakefile in spec directory
84
+ a002231 (#5171) Made filebucket able to perform diffs
85
+ 8f314f2 (#5710) Removed unnecessary calls to insync?
86
+ e270086 Prep for fixing #5710: Refactor stub provider in resource harness spec
87
+ c57a677 Maint: test partial resource failure
88
+ 8aa8b9d (#5799) Simplify report dir creation
89
+ 2d88844 maint: Add vim swap files to .gitignore
90
+ 3d3baec maint: Remove rspec options from the Rakefile
91
+ df65304 maint: Inspect reports should have audited = true on events
92
+ 4c9eca1 Maint: Added "skipped" to the YAML output for Puppet::Resource::Status
93
+ 717670f (#5771): Fix spec failures associated with rspec upgrade
94
+ 52760a4 (#5771) Upgrade rspec to version 2
95
+ 7603b05 maint: remove stray debug statement.
96
+ 7661ba8 maint: Prune #inspect methods on various objects
97
+ 80bfb54 (#5758) Verify that report events are correctly created
98
+ de85f8d Prep work for #5758: set audited=true on all audit events
99
+ e162da9 Prep work for #5758: clean up initializer for Puppet::Transaction::Event
100
+ 06a8d1e Fix #5698 puppet inspect shouldn't report of attributes of deleted files
101
+ 1f72c31 (#5715) Added attributes resource_type and title to Puppet::Resource::Status.
102
+ a6cd736 (#5715) Removed attribute source_description from the YAML representation of Puppet::Resource::Status.
103
+ 98db2da (#5715) Removed unnecessary attributes from YAML of Puppet::Transaction::Event.
104
+ bd4a8a1 (#5715) Make certain report attributes always present.
105
+ 716ee1c (#5715) Changed the type of metric names to always be strings.
106
+ 037eac4 (#5715) Add status attribute to reports.
107
+ e4a2e04 (#5715) Made the report "calculate" methods strictly functional.
108
+ 71db5be (#5715) Made the changes/total and events/total metrics always present
109
+ a4e40f4 (#5715) Refactor in preparation for adding a status attribute to reports.
110
+ 15dda94 (#5715) Added total time to inspect reports and made inspect metrics more consistent.
111
+ d1bcdec (#5715) Removed Puppet::Transaction::Report#external_times from YAML output.
112
+ 1550bbb (#5715) Added total time metric to apply reports.
113
+ 4cc42cd (#5715) Removed redundant attribute Transaction::Event#version
114
+ 1907650 (#5715) Removed redundant attribute Resource::Status#version
115
+ e596a57 (#5715) Removed Puppet::Util::Log#version.
116
+ 908e0e0 (#5715) Removed the unused attribute Puppet::Transaction::Event#node
117
+ 0e39ec5 (#5715) Removed Resource::Status#skipped_reason. It was never used.
118
+ b765f0e (#5715) Prep work: Fixed add_statuses in report_spec.
119
+ 8631709 (#5723) Fix failing type/package specs
120
+ 76fe2b3 Implement #5168 and #5169 ctime and mtime are properties
121
+ d11ae78 [3782] Test isolation problem in test/ral/providers/cron/crontab.rb
122
+ 4d3030c Modified the behavior of Puppet::Resource::Status as follows:
123
+ 7fff780 (#5408) Reworked ResourceHarness so that code is clearer and all behaviors are tested
124
+ d516f63 (#5493) Add report_format, puppet_version, and configuration_version to Reports
125
+ 093c45f (#5375) Rework puppet apply to use configurer.run
126
+ e99a3ea Fix #5566 none, mtime, and ctime checksum types can write file contents
127
+ d74e8e1 maint: Fix ActiveRecord confine issue
128
+ 6daeb16 maint: Fix a test that was missing a require
129
+ 5db696b maint: Fix tests that don't run on their own
130
+ 7f4e058 (#4487) Fix environment column in hosts table
131
+ 3ac50fa maint: restore plugin handler safety
132
+ f38c36c (#5408) Attributes can be both audited and managed
133
+ 54a1025 maint: missing stub
134
+ 1d3192e maint: missing stub
135
+ 1aa8157 maint: missing line and filename stubs
136
+ 5e5ee97 maint: Fully stub partially stubbed test.
137
+ 3d7c8d0 maint: remove Puppet.settings stubs
138
+ 52fba89 maint: test was expecting Catalog.find too few times
139
+ 8c134b6 maint: broken test not failing due to over-eager exception catching
140
+ 3e59277 Fix #1757 Change file mode representation to octal
141
+ 84bf02e Bug #5423: This moves the home directory property before the uid property, thus minimizing room for damage when usermod is in use.
142
+ 1131ad7 (#4943) Add puppet inspect application
143
+ e005cc7 maint: Remove bogus mongrel test
144
+ c908fdb (#5261) Fix #5261 Don't escape Unicode characters in PSON
145
+ b27e9b4 [#5081] Revert "Fix #4349 - Parsing with ignoreimport=true was always loading site.pp"
146
+ af6e08c (#5304) Use internal_name rather than real_name for maillist provider
147
+
1
148
  2.6.4
2
149
  =====
3
150
  76890a5 Revert "(#5304) Use internal_name rather than real_name for maillist provider"
data/LICENSE CHANGED
@@ -4,8 +4,8 @@ Puppet Labs can be contacted at: info@puppetlabs.com
4
4
 
5
5
  This program and entire repository is free software; you can
6
6
  redistribute it and/or modify it under the terms of the GNU
7
- General Public License as published by the Free Software
8
- Foundation; either version 2 of the License, or any later version.
7
+ General Public License Version 2 as published by the Free Software
8
+ Foundation.
9
9
 
10
10
  This program is distributed in the hope that it will be useful,
11
11
  but WITHOUT ANY WARRANTY; without even the implied warranty of
data/Rakefile CHANGED
@@ -5,8 +5,8 @@ $LOAD_PATH << File.join(File.dirname(__FILE__), 'tasks')
5
5
  require 'rake'
6
6
  require 'rake/packagetask'
7
7
  require 'rake/gempackagetask'
8
- require 'spec'
9
- require 'spec/rake/spectask'
8
+ require 'rspec'
9
+ require "rspec/core/rake_task"
10
10
 
11
11
  module Puppet
12
12
  PUPPETVERSION = File.read('lib/puppet.rb')[/PUPPETVERSION *= *'(.*)'/,1] or fail "Couldn't find PUPPETVERSION"
@@ -42,8 +42,7 @@ end
42
42
  desc "Create the tarball and the gem - use when releasing"
43
43
  task :puppetpackages => [:create_gem, :package]
44
44
 
45
- Spec::Rake::SpecTask.new do |t|
46
- t.spec_opts = ['--format','s', '--loadby','mtime','--color']
45
+ RSpec::Core::RakeTask.new do |t|
47
46
  t.pattern ='spec/{unit,integration}/**/*.rb'
48
47
  t.fail_on_error = false
49
48
  end
@@ -24,7 +24,7 @@ require 'puppet/util/run_mode'
24
24
  # it's also a place to find top-level commands like 'debug'
25
25
 
26
26
  module Puppet
27
- PUPPETVERSION = '2.6.4'
27
+ PUPPETVERSION = '2.6.5'
28
28
 
29
29
  def Puppet.version
30
30
  PUPPETVERSION
@@ -212,10 +212,17 @@ class Application
212
212
  end
213
213
 
214
214
  def find(name)
215
- self.const_get(name.to_s.capitalize)
216
- rescue
215
+ klass = name.to_s.capitalize
216
+
217
+ # const_defined? is used before const_get since const_defined? will only
218
+ # check within our namespace, whereas const_get will check ancestor
219
+ # trees as well, resulting in unexpected behaviour.
220
+ if !self.const_defined?(klass)
217
221
  puts "Unable to find application '#{name.to_s}'."
218
222
  Kernel::exit(1)
223
+ end
224
+
225
+ self.const_get(klass)
219
226
  end
220
227
 
221
228
  def [](name)
@@ -257,9 +264,21 @@ class Application
257
264
  def initialize(command_line = nil)
258
265
  require 'puppet/util/command_line'
259
266
  @command_line = command_line || Puppet::Util::CommandLine.new
260
- @run_mode = self.class.run_mode
267
+ set_run_mode self.class.run_mode
261
268
  @options = {}
262
269
 
270
+ require 'puppet'
271
+ end
272
+
273
+ # WARNING: This is a totally scary, frightening, and nasty internal API. We
274
+ # strongly advise that you do not use this, and if you insist, we will
275
+ # politely allow you to keep both pieces of your broken code.
276
+ #
277
+ # We plan to provide a supported, long-term API to deliver this in a way
278
+ # that you can use. Please make sure that you let us know if you do require
279
+ # this, and this message is still present in the code. --daniel 2011-02-03
280
+ def set_run_mode(mode)
281
+ @run_mode = mode
263
282
  $puppet_application_mode = @run_mode
264
283
  $puppet_application_name = name
265
284
 
@@ -274,8 +293,6 @@ class Application
274
293
  Puppet.settings.set_value(:rundir, Puppet.run_mode.run_dir, :mutable_defaults)
275
294
  Puppet.settings.set_value(:run_mode, Puppet.run_mode.name.to_s, :mutable_defaults)
276
295
  end
277
-
278
- require 'puppet'
279
296
  end
280
297
 
281
298
  # This is the main application entry point
@@ -123,25 +123,9 @@ class Puppet::Application::Apply < Puppet::Application
123
123
 
124
124
  require 'puppet/configurer'
125
125
  configurer = Puppet::Configurer.new
126
- configurer.execute_prerun_command
126
+ report = configurer.run(:skip_plugin_download => true, :catalog => catalog)
127
127
 
128
- # And apply it
129
- if Puppet[:report]
130
- report = configurer.initialize_report
131
- Puppet::Util::Log.newdestination(report)
132
- end
133
- transaction = catalog.apply
134
-
135
- configurer.execute_postrun_command
136
-
137
- if Puppet[:report]
138
- Puppet::Util::Log.close(report)
139
- configurer.send_report(report, transaction)
140
- else
141
- transaction.generate_report
142
- end
143
-
144
- exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? transaction.report.exit_status : 0 )
128
+ exit( Puppet[:noop] ? 0 : options[:detailed_exitcodes] ? report.exit_status : 0 )
145
129
  rescue => detail
146
130
  puts detail.backtrace if Puppet[:trace]
147
131
  $stderr.puts detail.message
@@ -8,7 +8,7 @@ class Puppet::Application::Doc < Puppet::Application
8
8
  attr_accessor :unknown_args, :manifest
9
9
 
10
10
  def preinit
11
- {:references => [], :mode => :text, :format => :to_rest }.each do |name,value|
11
+ {:references => [], :mode => :text, :format => :to_markdown }.each do |name,value|
12
12
  options[name] = value
13
13
  end
14
14
  @unknown_args = []
@@ -113,9 +113,6 @@ class Puppet::Application::Doc < Puppet::Application
113
113
 
114
114
  text += Puppet::Util::Reference.footer unless with_contents # We've only got one reference
115
115
 
116
- # Replace the trac links, since they're invalid everywhere else
117
- text.gsub!(/`\w+\s+([^`]+)`:trac:/) { |m| $1 }
118
-
119
116
  if options[:mode] == :pdf
120
117
  Puppet::Util::Reference.pdf(text)
121
118
  else
@@ -0,0 +1,178 @@
1
+ require 'puppet'
2
+ require 'puppet/application'
3
+ require 'puppet/file_bucket/dipper'
4
+
5
+ class Puppet::Application::Inspect < Puppet::Application
6
+
7
+ should_parse_config
8
+ run_mode :agent
9
+
10
+ option("--debug","-d")
11
+ option("--verbose","-v")
12
+
13
+ option("--logdest LOGDEST", "-l") do |arg|
14
+ begin
15
+ Puppet::Util::Log.newdestination(arg)
16
+ options[:logset] = true
17
+ rescue => detail
18
+ $stderr.puts detail.to_s
19
+ end
20
+ end
21
+
22
+ def help
23
+ puts <<-HELP ; exit # XXX
24
+
25
+ SYNOPSIS
26
+ ========
27
+
28
+ Prepare and submit an inspection report to the puppet master.
29
+
30
+
31
+ USAGE
32
+ =====
33
+
34
+ puppet inspect
35
+
36
+
37
+ DESCRIPTION
38
+ ===========
39
+
40
+ This command uses the cached catalog from the previous run of 'puppet
41
+ agent' to determine which attributes of which resources have been
42
+ marked as auditable with the 'audit' metaparameter. It then examines
43
+ the current state of the system, writes the state of the specified
44
+ resource attributes to a report, and submits the report to the puppet
45
+ master.
46
+
47
+ Puppet inspect does not run as a daemon, and must be run manually or from cron.
48
+
49
+
50
+ OPTIONS
51
+ =======
52
+
53
+ Any configuration setting which is valid in the configuration file is
54
+ also a valid long argument, e.g. '--server=master.domain.com'. See the
55
+ configuration file documentation at
56
+ http://docs.puppetlabs.com/references/latest/configuration.html for
57
+ the full list of acceptable settings.
58
+
59
+
60
+ AUTHOR
61
+ ======
62
+
63
+ Puppet Labs
64
+
65
+
66
+ COPYRIGHT
67
+ =========
68
+
69
+ Copyright (c) 2011 Puppet Labs, LLC
70
+ Licensed under the GNU General Public License version 2
71
+
72
+ HELP
73
+ end
74
+
75
+ def setup
76
+ exit(Puppet.settings.print_configs ? 0 : 1) if Puppet.settings.print_configs?
77
+
78
+ raise "Inspect requires reporting to be enabled. Set report=true in puppet.conf to enable reporting." unless Puppet[:report]
79
+
80
+ @report = Puppet::Transaction::Report.new("inspect")
81
+
82
+ Puppet::Util::Log.newdestination(@report)
83
+ Puppet::Util::Log.newdestination(:console) unless options[:logset]
84
+
85
+ trap(:INT) do
86
+ $stderr.puts "Exiting"
87
+ exit(1)
88
+ end
89
+
90
+ if options[:debug]
91
+ Puppet::Util::Log.level = :debug
92
+ elsif options[:verbose]
93
+ Puppet::Util::Log.level = :info
94
+ end
95
+
96
+ Puppet::Transaction::Report.terminus_class = :rest
97
+ Puppet::Resource::Catalog.terminus_class = :yaml
98
+ end
99
+
100
+ def run_command
101
+ benchmark(:notice, "Finished inspection") do
102
+ retrieval_starttime = Time.now
103
+
104
+ unless catalog = Puppet::Resource::Catalog.find(Puppet[:certname])
105
+ raise "Could not find catalog for #{Puppet[:certname]}"
106
+ end
107
+
108
+ @report.configuration_version = catalog.version
109
+
110
+ inspect_starttime = Time.now
111
+ @report.add_times("config_retrieval", inspect_starttime - retrieval_starttime)
112
+
113
+ if Puppet[:archive_files]
114
+ dipper = Puppet::FileBucket::Dipper.new(:Server => Puppet[:archive_file_server])
115
+ end
116
+
117
+ catalog.to_ral.resources.each do |ral_resource|
118
+ audited_attributes = ral_resource[:audit]
119
+ next unless audited_attributes
120
+
121
+ status = Puppet::Resource::Status.new(ral_resource)
122
+
123
+ begin
124
+ audited_resource = ral_resource.to_resource
125
+ rescue StandardError => detail
126
+ puts detail.backtrace if Puppet[:trace]
127
+ ral_resource.err "Could not inspect #{ral_resource}; skipping: #{detail}"
128
+ audited_attributes.each do |name|
129
+ event = ral_resource.event(
130
+ :property => name,
131
+ :status => "failure",
132
+ :audited => true,
133
+ :message => "failed to inspect #{name}"
134
+ )
135
+ status.add_event(event)
136
+ end
137
+ else
138
+ audited_attributes.each do |name|
139
+ next if audited_resource[name].nil?
140
+ # Skip :absent properties of :absent resources. Really, it would be nicer if the RAL returned nil for those, but it doesn't. ~JW
141
+ if name == :ensure or audited_resource[:ensure] != :absent or audited_resource[name] != :absent
142
+ event = ral_resource.event(
143
+ :previous_value => audited_resource[name],
144
+ :property => name,
145
+ :status => "audit",
146
+ :audited => true,
147
+ :message => "inspected value is #{audited_resource[name].inspect}"
148
+ )
149
+ status.add_event(event)
150
+ end
151
+ end
152
+ end
153
+ if Puppet[:archive_files] and ral_resource.type == :file and audited_attributes.include?(:content)
154
+ path = ral_resource[:path]
155
+ if File.readable?(path)
156
+ begin
157
+ dipper.backup(path)
158
+ rescue StandardError => detail
159
+ Puppet.warning detail
160
+ end
161
+ end
162
+ end
163
+ @report.add_resource_status(status)
164
+ end
165
+
166
+ finishtime = Time.now
167
+ @report.add_times("inspect", finishtime - inspect_starttime)
168
+ @report.finalize_report
169
+
170
+ begin
171
+ @report.save
172
+ rescue => detail
173
+ puts detail.backtrace if Puppet[:trace]
174
+ Puppet.err "Could not send report: #{detail}"
175
+ end
176
+ end
177
+ end
178
+ end