puppet 4.7.1-x86-mingw32 → 4.8.0-x86-mingw32

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 (276) hide show
  1. data/Gemfile +0 -3
  2. data/MAINTAINERS +76 -0
  3. data/README.md +0 -6
  4. data/Rakefile +2 -2
  5. data/lib/puppet/agent.rb +3 -3
  6. data/lib/puppet/application/apply.rb +1 -1
  7. data/lib/puppet/configurer.rb +2 -2
  8. data/lib/puppet/data_providers.rb +1 -0
  9. data/lib/puppet/data_providers/data_adapter.rb +1 -0
  10. data/lib/puppet/data_providers/data_function_support.rb +1 -0
  11. data/lib/puppet/data_providers/function_env_data_provider.rb +1 -0
  12. data/lib/puppet/data_providers/function_module_data_provider.rb +1 -0
  13. data/lib/puppet/data_providers/hiera_config.rb +1 -0
  14. data/lib/puppet/data_providers/hiera_env_data_provider.rb +1 -0
  15. data/lib/puppet/data_providers/hiera_interpolate.rb +1 -0
  16. data/lib/puppet/data_providers/hiera_module_data_provider.rb +1 -0
  17. data/lib/puppet/data_providers/hiera_support.rb +1 -2
  18. data/lib/puppet/data_providers/json_data_provider_factory.rb +2 -0
  19. data/lib/puppet/data_providers/yaml_data_provider_factory.rb +2 -0
  20. data/lib/puppet/defaults.rb +20 -1
  21. data/lib/puppet/environments.rb +5 -2
  22. data/lib/puppet/face/catalog.rb +1 -1
  23. data/lib/puppet/face/epp.rb +57 -11
  24. data/lib/puppet/face/module/install.rb +6 -6
  25. data/lib/puppet/functions.rb +23 -24
  26. data/lib/puppet/functions/alert.rb +14 -0
  27. data/lib/puppet/functions/binary_file.rb +25 -0
  28. data/lib/puppet/functions/break.rb +22 -0
  29. data/lib/puppet/functions/contain.rb +33 -0
  30. data/lib/puppet/functions/crit.rb +14 -0
  31. data/lib/puppet/functions/debug.rb +14 -0
  32. data/lib/puppet/functions/emerg.rb +14 -0
  33. data/lib/puppet/functions/epp.rb +1 -1
  34. data/lib/puppet/functions/err.rb +14 -0
  35. data/lib/puppet/functions/find_file.rb +31 -0
  36. data/lib/puppet/functions/include.rb +21 -0
  37. data/lib/puppet/functions/info.rb +14 -0
  38. data/lib/puppet/functions/new.rb +1 -1
  39. data/lib/puppet/functions/next.rb +23 -0
  40. data/lib/puppet/functions/notice.rb +14 -0
  41. data/lib/puppet/functions/regsubst.rb +12 -16
  42. data/lib/puppet/functions/require.rb +37 -0
  43. data/lib/puppet/functions/return.rb +22 -0
  44. data/lib/puppet/functions/strftime.rb +35 -0
  45. data/lib/puppet/functions/warning.rb +14 -0
  46. data/lib/puppet/generate/models/type/type.rb +4 -0
  47. data/lib/puppet/generate/templates/type/pcore.erb +2 -1
  48. data/lib/puppet/indirector/face.rb +6 -1
  49. data/lib/puppet/network/http/error.rb +2 -2
  50. data/lib/puppet/network/http/handler.rb +2 -2
  51. data/lib/puppet/node/environment.rb +11 -0
  52. data/lib/puppet/parser/ast.rb +5 -0
  53. data/lib/puppet/parser/ast/pops_bridge.rb +17 -4
  54. data/lib/puppet/parser/compiler.rb +29 -1
  55. data/lib/puppet/parser/functions.rb +6 -0
  56. data/lib/puppet/parser/functions/assert_type.rb +1 -1
  57. data/lib/puppet/parser/functions/binary_file.rb +24 -0
  58. data/lib/puppet/parser/functions/break.rb +39 -0
  59. data/lib/puppet/parser/functions/contain.rb +7 -15
  60. data/lib/puppet/parser/functions/defined.rb +2 -2
  61. data/lib/puppet/parser/functions/dig.rb +1 -1
  62. data/lib/puppet/parser/functions/each.rb +1 -1
  63. data/lib/puppet/parser/functions/epp.rb +2 -2
  64. data/lib/puppet/parser/functions/filter.rb +1 -1
  65. data/lib/puppet/parser/functions/find_file.rb +28 -0
  66. data/lib/puppet/parser/functions/hiera.rb +4 -4
  67. data/lib/puppet/parser/functions/hiera_array.rb +1 -1
  68. data/lib/puppet/parser/functions/hiera_hash.rb +1 -1
  69. data/lib/puppet/parser/functions/hiera_include.rb +1 -1
  70. data/lib/puppet/parser/functions/include.rb +4 -8
  71. data/lib/puppet/parser/functions/inline_epp.rb +1 -1
  72. data/lib/puppet/parser/functions/lest.rb +1 -1
  73. data/lib/puppet/parser/functions/lookup.rb +4 -2
  74. data/lib/puppet/parser/functions/map.rb +1 -1
  75. data/lib/puppet/parser/functions/match.rb +1 -1
  76. data/lib/puppet/parser/functions/new.rb +414 -18
  77. data/lib/puppet/parser/functions/next.rb +38 -0
  78. data/lib/puppet/parser/functions/reduce.rb +1 -1
  79. data/lib/puppet/parser/functions/regsubst.rb +4 -2
  80. data/lib/puppet/parser/functions/require.rb +4 -27
  81. data/lib/puppet/parser/functions/return.rb +71 -0
  82. data/lib/puppet/parser/functions/reverse_each.rb +1 -1
  83. data/lib/puppet/parser/functions/scanf.rb +13 -8
  84. data/lib/puppet/parser/functions/slice.rb +1 -1
  85. data/lib/puppet/parser/functions/split.rb +1 -1
  86. data/lib/puppet/parser/functions/step.rb +1 -1
  87. data/lib/puppet/parser/functions/strftime.rb +185 -0
  88. data/lib/puppet/parser/functions/then.rb +1 -1
  89. data/lib/puppet/parser/functions/type.rb +1 -1
  90. data/lib/puppet/parser/functions/with.rb +3 -3
  91. data/lib/puppet/parser/resource.rb +8 -5
  92. data/lib/puppet/parser/scope.rb +1 -1
  93. data/lib/puppet/plugins/configuration.rb +8 -0
  94. data/lib/puppet/plugins/data_providers.rb +1 -0
  95. data/lib/puppet/plugins/data_providers/data_provider.rb +7 -28
  96. data/lib/puppet/plugins/data_providers/registry.rb +1 -0
  97. data/lib/puppet/pops.rb +4 -0
  98. data/lib/puppet/pops/evaluator/access_operator.rb +36 -5
  99. data/lib/puppet/pops/evaluator/closure.rb +81 -12
  100. data/lib/puppet/pops/evaluator/compare_operator.rb +24 -1
  101. data/lib/puppet/pops/evaluator/evaluator_impl.rb +29 -5
  102. data/lib/puppet/pops/evaluator/json_strict_literal_evaluator.rb +1 -1
  103. data/lib/puppet/pops/evaluator/runtime3_converter.rb +53 -62
  104. data/lib/puppet/pops/evaluator/runtime3_support.rb +15 -6
  105. data/lib/puppet/pops/functions/dispatch.rb +9 -2
  106. data/lib/puppet/pops/functions/dispatcher.rb +3 -1
  107. data/lib/puppet/pops/functions/function.rb +19 -2
  108. data/lib/puppet/pops/issues.rb +9 -0
  109. data/lib/puppet/pops/label_provider.rb +2 -2
  110. data/lib/puppet/pops/loader/loader.rb +17 -0
  111. data/lib/puppet/pops/loader/static_loader.rb +0 -41
  112. data/lib/puppet/pops/lookup.rb +12 -0
  113. data/lib/puppet/pops/lookup/context.rb +86 -0
  114. data/lib/puppet/pops/lookup/explainer.rb +46 -6
  115. data/lib/puppet/pops/lookup/invocation.rb +19 -0
  116. data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
  117. data/lib/puppet/pops/model/factory.rb +20 -8
  118. data/lib/puppet/pops/model/model_label_provider.rb +3 -0
  119. data/lib/puppet/pops/model/model_meta.rb +2 -0
  120. data/lib/puppet/pops/model/model_tree_dumper.rb +14 -0
  121. data/lib/puppet/pops/parser/egrammar.ra +11 -6
  122. data/lib/puppet/pops/parser/eparser.rb +1112 -1086
  123. data/lib/puppet/pops/parser/heredoc_support.rb +1 -2
  124. data/lib/puppet/pops/pcore.rb +1 -0
  125. data/lib/puppet/pops/puppet_stack.rb +3 -3
  126. data/lib/puppet/pops/resource/param.rb +5 -1
  127. data/lib/puppet/pops/resource/resource_type_impl.rb +8 -4
  128. data/lib/puppet/pops/resource/resource_type_set.pcore +1 -0
  129. data/lib/puppet/pops/serialization/abstract_reader.rb +19 -2
  130. data/lib/puppet/pops/serialization/abstract_writer.rb +16 -3
  131. data/lib/puppet/pops/serialization/deserializer.rb +5 -1
  132. data/lib/puppet/pops/serialization/extension.rb +2 -0
  133. data/lib/puppet/pops/serialization/json.rb +76 -26
  134. data/lib/puppet/pops/serialization/serializer.rb +5 -1
  135. data/lib/puppet/pops/serialization/time_factory.rb +2 -1
  136. data/lib/puppet/pops/time/timespan.rb +718 -0
  137. data/lib/puppet/pops/time/timestamp.rb +148 -0
  138. data/lib/puppet/pops/types/p_binary_type.rb +220 -0
  139. data/lib/puppet/pops/types/p_object_type.rb +12 -6
  140. data/lib/puppet/pops/types/p_sensitive_type.rb +5 -1
  141. data/lib/puppet/pops/types/p_timespan_type.rb +141 -0
  142. data/lib/puppet/pops/types/p_timestamp_type.rb +69 -0
  143. data/lib/puppet/pops/types/string_converter.rb +62 -0
  144. data/lib/puppet/pops/types/type_asserter.rb +1 -1
  145. data/lib/puppet/pops/types/type_calculator.rb +17 -3
  146. data/lib/puppet/pops/types/type_factory.rb +35 -1
  147. data/lib/puppet/pops/types/type_formatter.rb +64 -11
  148. data/lib/puppet/pops/types/type_mismatch_describer.rb +110 -61
  149. data/lib/puppet/pops/types/type_parser.rb +18 -4
  150. data/lib/puppet/pops/types/types.rb +98 -63
  151. data/lib/puppet/pops/validation.rb +9 -1
  152. data/lib/puppet/pops/validation/checker4_0.rb +7 -0
  153. data/lib/puppet/property.rb +1 -1
  154. data/lib/puppet/provider.rb +3 -6
  155. data/lib/puppet/provider/mcx/mcxcontent.rb +1 -1
  156. data/lib/puppet/provider/mount/parsed.rb +18 -4
  157. data/lib/puppet/provider/nameservice/directoryservice.rb +15 -7
  158. data/lib/puppet/provider/package/gem.rb +6 -1
  159. data/lib/puppet/provider/package/pip.rb +0 -1
  160. data/lib/puppet/provider/package/pkg.rb +5 -1
  161. data/lib/puppet/provider/package/pkgng.rb +1 -1
  162. data/lib/puppet/provider/package/yum.rb +10 -0
  163. data/lib/puppet/provider/service/launchd.rb +1 -0
  164. data/lib/puppet/provider/user/directoryservice.rb +6 -6
  165. data/lib/puppet/provider/yumrepo/inifile.rb +1 -1
  166. data/lib/puppet/provider/zpool/zpool.rb +1 -1
  167. data/lib/puppet/resource.rb +54 -12
  168. data/lib/puppet/resource/capability_finder.rb +15 -9
  169. data/lib/puppet/resource/catalog.rb +25 -6
  170. data/lib/puppet/resource/type.rb +3 -1
  171. data/lib/puppet/settings.rb +1 -1
  172. data/lib/puppet/settings/environment_conf.rb +12 -4
  173. data/lib/puppet/syntax_checkers/base64.rb +41 -0
  174. data/lib/puppet/syntax_checkers/json.rb +0 -2
  175. data/lib/puppet/transaction.rb +6 -0
  176. data/lib/puppet/transaction/additional_resource_generator.rb +5 -0
  177. data/lib/puppet/transaction/report.rb +7 -2
  178. data/lib/puppet/type.rb +2 -1
  179. data/lib/puppet/type/file/checksum.rb +1 -0
  180. data/lib/puppet/type/file/content.rb +4 -4
  181. data/lib/puppet/type/mount.rb +44 -0
  182. data/lib/puppet/type/ssh_authorized_key.rb +1 -1
  183. data/lib/puppet/type/tidy.rb +3 -0
  184. data/lib/puppet/type/user.rb +12 -6
  185. data/lib/puppet/util/log.rb +25 -0
  186. data/lib/puppet/util/plist.rb +8 -3
  187. data/lib/puppet/version.rb +1 -1
  188. data/lib/puppet_x.rb +7 -1
  189. data/spec/integration/application/apply_spec.rb +118 -0
  190. data/spec/integration/parser/compiler_spec.rb +28 -0
  191. data/spec/integration/parser/pcore_resource_spec.rb +40 -3
  192. data/spec/integration/provider/mount_spec.rb +2 -1
  193. data/spec/integration/util/windows/principal_spec.rb +2 -2
  194. data/spec/integration/util/windows/registry_spec.rb +4 -4
  195. data/spec/lib/puppet_spec/compiler.rb +5 -1
  196. data/spec/lib/puppet_spec/unindent.rb +5 -0
  197. data/spec/shared_contexts/types_setup.rb +6 -0
  198. data/spec/shared_examples/rhel_package_provider.rb +16 -0
  199. data/spec/spec_helper.rb +1 -0
  200. data/spec/unit/agent_spec.rb +11 -0
  201. data/spec/unit/application/lookup_spec.rb +94 -3
  202. data/spec/unit/capability_spec.rb +22 -0
  203. data/spec/unit/configurer_spec.rb +8 -0
  204. data/spec/unit/face/epp_face_spec.rb +22 -3
  205. data/spec/unit/functions/assert_type_spec.rb +3 -3
  206. data/spec/unit/functions/binary_file_spec.rb +46 -0
  207. data/spec/unit/functions/break_spec.rb +89 -0
  208. data/spec/unit/{parser/functions → functions}/contain_spec.rb +68 -3
  209. data/spec/unit/functions/find_file_spec.rb +69 -0
  210. data/spec/unit/functions/include_spec.rb +175 -0
  211. data/spec/unit/functions/logging_spec.rb +54 -0
  212. data/spec/unit/functions/lookup_spec.rb +3 -3
  213. data/spec/unit/functions/new_spec.rb +105 -5
  214. data/spec/unit/functions/next_spec.rb +93 -0
  215. data/spec/unit/functions/require_spec.rb +83 -0
  216. data/spec/unit/functions/return_spec.rb +105 -0
  217. data/spec/unit/{parser/functions → functions}/shared.rb +14 -11
  218. data/spec/unit/functions/strftime_spec.rb +152 -0
  219. data/spec/unit/functions4_spec.rb +22 -0
  220. data/spec/unit/indirector/face_spec.rb +10 -2
  221. data/spec/unit/network/http/error_spec.rb +1 -2
  222. data/spec/unit/network/http/handler_spec.rb +6 -5
  223. data/spec/unit/parser/functions/hiera_array_spec.rb +1 -1
  224. data/spec/unit/parser/functions/hiera_hash_spec.rb +1 -1
  225. data/spec/unit/parser/functions/hiera_include_spec.rb +1 -1
  226. data/spec/unit/parser/functions/hiera_spec.rb +1 -1
  227. data/spec/unit/parser/functions/lookup_spec.rb +1 -1
  228. data/spec/unit/parser/functions/regsubst_spec.rb +1 -1
  229. data/spec/unit/parser/functions/split_spec.rb +1 -1
  230. data/spec/unit/pops/evaluator/access_ops_spec.rb +81 -1
  231. data/spec/unit/pops/evaluator/arithmetic_ops_spec.rb +170 -0
  232. data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +29 -4
  233. data/spec/unit/pops/evaluator/runtime3_converter_spec.rb +112 -4
  234. data/spec/unit/pops/loaders/dependency_loader_spec.rb +12 -0
  235. data/spec/unit/pops/loaders/static_loader_spec.rb +0 -26
  236. data/spec/unit/pops/lookup/context_spec.rb +149 -0
  237. data/spec/unit/pops/parser/parse_functions_spec.rb +19 -0
  238. data/spec/unit/pops/parser/parse_lambda_spec.rb +19 -0
  239. data/spec/unit/pops/puppet_stack_spec.rb +1 -1
  240. data/spec/unit/pops/resource/resource_type_impl_spec.rb +74 -0
  241. data/spec/unit/pops/serialization/packer_spec.rb +34 -14
  242. data/spec/unit/pops/serialization/serialization_spec.rb +67 -5
  243. data/spec/unit/pops/time/timespan_spec.rb +121 -0
  244. data/spec/unit/pops/types/p_binary_type_spec.rb +243 -0
  245. data/spec/unit/pops/types/p_object_type_spec.rb +7 -7
  246. data/spec/unit/pops/types/p_sensitive_type_spec.rb +1 -1
  247. data/spec/unit/pops/types/p_timespan_type_spec.rb +273 -0
  248. data/spec/unit/pops/types/p_timestamp_type_spec.rb +311 -0
  249. data/spec/unit/pops/types/p_type_set_type_spec.rb +13 -13
  250. data/spec/unit/pops/types/ruby_generator_spec.rb +12 -12
  251. data/spec/unit/pops/types/string_converter_spec.rb +89 -0
  252. data/spec/unit/pops/types/type_asserter_spec.rb +3 -3
  253. data/spec/unit/pops/types/type_calculator_spec.rb +113 -5
  254. data/spec/unit/pops/types/type_formatter_spec.rb +40 -0
  255. data/spec/unit/pops/types/type_mismatch_describer_spec.rb +49 -38
  256. data/spec/unit/pops/types/type_parser_spec.rb +87 -4
  257. data/spec/unit/pops/types/types_spec.rb +1 -1
  258. data/spec/unit/pops/validator/validator_spec.rb +23 -0
  259. data/spec/unit/provider/mount/parsed_spec.rb +47 -29
  260. data/spec/unit/provider/package/pkg_spec.rb +109 -99
  261. data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +1 -0
  262. data/spec/unit/provider/user/aix_spec.rb +1 -1
  263. data/spec/unit/provider/user/directoryservice_spec.rb +101 -30
  264. data/spec/unit/resource/capability_finder_spec.rb +29 -7
  265. data/spec/unit/resource/catalog_spec.rb +127 -0
  266. data/spec/unit/ssl/certificate_request_spec.rb +1 -1
  267. data/spec/unit/transaction/additional_resource_generator_spec.rb +30 -0
  268. data/spec/unit/transaction/persistence_spec.rb +1 -6
  269. data/spec/unit/transaction/report_spec.rb +23 -0
  270. data/spec/unit/transaction_spec.rb +38 -0
  271. data/spec/unit/type/mount_spec.rb +5 -0
  272. data/spec/unit/util/plist_spec.rb +14 -2
  273. metadata +71 -12
  274. data/spec/integration/parser/functions/require_spec.rb +0 -43
  275. data/spec/unit/parser/functions/include_spec.rb +0 -55
  276. data/spec/unit/parser/functions/require_spec.rb +0 -68
@@ -71,29 +71,50 @@ describe Puppet::Resource::CapabilityFinder do
71
71
  let(:capability) { Puppet::Resource.new('Cap', 'cap') }
72
72
  let(:code_id) { 'b59e5df0578ef411f773ee6c33d8073c50e7b8fe' }
73
73
 
74
- it 'should search for the resource without including code_id' do
74
+ it 'should search for the resource without including code_id or environment' do
75
75
  resources = [{"type"=>"Cap", "title"=>"cap", "parameters"=>{"host"=>"ahost"}}]
76
- Puppet::Resource::CapabilityFinder.stubs(:search).with('production', nil, capability).returns resources
76
+ Puppet::Resource::CapabilityFinder.stubs(:search).with(nil, nil, capability).returns resources
77
77
 
78
78
  result = Puppet::Resource::CapabilityFinder.find('production', code_id, Puppet::Resource.new('Cap', 'cap'))
79
79
  expect(result['host']).to eq('ahost')
80
80
  end
81
81
 
82
82
  it 'should return nil if no resource is found' do
83
- Puppet::Resource::CapabilityFinder.stubs(:search).with('production', nil, capability).returns []
83
+ Puppet::Resource::CapabilityFinder.stubs(:search).with(nil, nil, capability).returns []
84
84
 
85
85
  result = Puppet::Resource::CapabilityFinder.find('production', code_id, capability)
86
86
  expect(result).to be_nil
87
87
  end
88
88
 
89
- describe 'when multiple results are returned' do
89
+ describe 'when multiple results are returned for different environments' do
90
90
  let(:resources) do
91
- [{"type"=>"Cap", "title"=>"cap", "parameters"=>{"host"=>"ahost"}},
92
- {"type"=>"Cap", "title"=>"cap", "parameters"=>{"host"=>"bhost"}}]
91
+ [{"type"=>"Cap", "title"=>"cap", "parameters"=>{"host"=>"ahost"}, "tags"=>["producer:production"]},
92
+ {"type"=>"Cap", "title"=>"cap", "parameters"=>{"host"=>"bhost"}, "tags"=>["producer:other_env"]}]
93
93
  end
94
94
 
95
95
  before :each do
96
- Puppet::Resource::CapabilityFinder.stubs(:search).with('production', nil, capability).returns resources
96
+ Puppet::Resource::CapabilityFinder.stubs(:search).with(nil, nil, capability).returns resources
97
+ end
98
+
99
+ it 'should return the resource matching environment' do
100
+ result = Puppet::Resource::CapabilityFinder.find('production', code_id, capability)
101
+ expect(result['host']).to eq('ahost')
102
+ end
103
+
104
+ it 'should return nil if no resource matches environment' do
105
+ result = Puppet::Resource::CapabilityFinder.find('bad_env', code_id, capability)
106
+ expect(result).to be_nil
107
+ end
108
+ end
109
+
110
+ describe 'when multiple results are returned for the same environment' do
111
+ let(:resources) do
112
+ [{"type"=>"Cap", "title"=>"cap", "parameters"=>{"host"=>"ahost"}, "tags"=>["producer:production"]},
113
+ {"type"=>"Cap", "title"=>"cap", "parameters"=>{"host"=>"bhost"}, "tags"=>["producer:production"]}]
114
+ end
115
+
116
+ before :each do
117
+ Puppet::Resource::CapabilityFinder.stubs(:search).with(nil, nil, capability).returns resources
97
118
  end
98
119
 
99
120
  it 'should return the resource matching code_id' do
@@ -117,6 +138,7 @@ describe Puppet::Resource::CapabilityFinder do
117
138
  end
118
139
 
119
140
  it 'should fail if no code_id was specified' do
141
+ Puppet::Resource::CapabilityFinder.stubs(:search).with('production', nil, capability).returns resources
120
142
  expect { Puppet::Resource::CapabilityFinder.find('production', nil, capability) }.to raise_error(Puppet::DevError, /expected exactly one resource/)
121
143
  end
122
144
  end
@@ -843,6 +843,133 @@ describe Puppet::Resource::Catalog, "when converting a resource catalog to pson"
843
843
  MANIFEST
844
844
  expect(catalog.to_pson).to validate_against('api/schemas/catalog.json')
845
845
  end
846
+
847
+ context 'when dealing with parameters that have non-Data values' do
848
+ context 'and rich_data is enabled' do
849
+ before(:each) do
850
+ Puppet[:rich_data] = true
851
+ end
852
+
853
+ let(:catalog_w_regexp) { compile_to_catalog("notify {'foo': message => /[a-z]+/ }") }
854
+
855
+ it 'should generate ext_parameters for parameter values that are not Data' do
856
+ expect(catalog_w_regexp.to_json).to include('"ext_parameters":{"message":[48,"[a-z]+"]}')
857
+ end
858
+
859
+ it 'should validate ext_parameters against the schema' do
860
+ expect(catalog_w_regexp.to_json).to validate_against('api/schemas/catalog.json')
861
+ end
862
+
863
+ it 'should read and convert ext_parameters containing Regexp from json' do
864
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog_w_regexp.to_json))
865
+ message = catalog2.resource('notify', 'foo')['message']
866
+ expect(message).to be_a(Regexp)
867
+ expect(message).to eql(/[a-z]+/)
868
+ end
869
+
870
+ it 'should read and convert ext_parameters containing Version from json' do
871
+ catalog = compile_to_catalog("notify {'foo': message => SemVer('1.0.0') }")
872
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
873
+ message = catalog2.resource('notify', 'foo')['message']
874
+ expect(message).to be_a(Semantic::Version)
875
+ expect(message).to eql(Semantic::Version.parse('1.0.0'))
876
+ end
877
+
878
+ it 'should read and convert ext_parameters containing VersionRange from json' do
879
+ catalog = compile_to_catalog("notify {'foo': message => SemVerRange('>=1.0.0') }")
880
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
881
+ message = catalog2.resource('notify', 'foo')['message']
882
+ expect(message).to be_a(Semantic::VersionRange)
883
+ expect(message).to eql(Semantic::VersionRange.parse('>=1.0.0'))
884
+ end
885
+
886
+ it 'should read and convert ext_parameters containing Timespan from json' do
887
+ catalog = compile_to_catalog("notify {'foo': message => Timespan(1234) }")
888
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
889
+ message = catalog2.resource('notify', 'foo')['message']
890
+ expect(message).to be_a(Puppet::Pops::Time::Timespan)
891
+ expect(message).to eql(Puppet::Pops::Time::Timespan.parse('1234', '%S'))
892
+ end
893
+
894
+ it 'should read and convert ext_parameters containing Timestamp from json' do
895
+ catalog = compile_to_catalog("notify {'foo': message => Timestamp('2016-09-15T08:32:16.123 UTC') }")
896
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
897
+ message = catalog2.resource('notify', 'foo')['message']
898
+ expect(message).to be_a(Puppet::Pops::Time::Timestamp)
899
+ expect(message).to eql(Puppet::Pops::Time::Timestamp.parse('2016-09-15T08:32:16.123 UTC'))
900
+ end
901
+
902
+ it 'should read and convert ext_parameters containing hash with rich data from json' do
903
+ catalog = compile_to_catalog("notify {'foo': message => { 'version' => SemVer('1.0.0'), 'time' => Timestamp('2016-09-15T08:32:16.123 UTC') }}")
904
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
905
+ message = catalog2.resource('notify', 'foo')['message']
906
+ expect(message).to be_a(Hash)
907
+ expect(message['version']).to eql(Semantic::Version.parse('1.0.0'))
908
+ expect(message['time']).to eql(Puppet::Pops::Time::Timestamp.parse('2016-09-15T08:32:16.123 UTC'))
909
+ end
910
+
911
+ it 'should read and convert ext_parameters containing an array with rich data from json' do
912
+ catalog = compile_to_catalog("notify {'foo': message => [ SemVer('1.0.0'), Timestamp('2016-09-15T08:32:16.123 UTC') ] }")
913
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
914
+ message = catalog2.resource('notify', 'foo')['message']
915
+ expect(message).to be_a(Array)
916
+ expect(message[0]).to eql(Semantic::Version.parse('1.0.0'))
917
+ expect(message[1]).to eql(Puppet::Pops::Time::Timestamp.parse('2016-09-15T08:32:16.123 UTC'))
918
+ end
919
+ end
920
+
921
+ context 'and rich_data is disabled' do
922
+ before(:each) do
923
+ Puppet[:rich_data] = false
924
+ end
925
+
926
+ let(:catalog_w_regexp) { compile_to_catalog("notify {'foo': message => /[a-z]+/ }") }
927
+
928
+ it 'should not generate ext_parameters for parameter values that are not Data' do
929
+ expect(catalog_w_regexp.to_json).not_to include('"ext_parameters":{"message":[48,"[a-z]+"]}')
930
+ end
931
+
932
+ it 'should convert parameter containing Regexp into strings' do
933
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog_w_regexp.to_json))
934
+ message = catalog2.resource('notify', 'foo')['message']
935
+ expect(message).to be_a(String)
936
+ expect(message).to eql('/[a-z]+/')
937
+ end
938
+
939
+ it 'should convert parameter containing Version into string' do
940
+ catalog = compile_to_catalog("notify {'foo': message => SemVer('1.0.0') }")
941
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
942
+ message = catalog2.resource('notify', 'foo')['message']
943
+ expect(message).to be_a(String)
944
+ expect(message).to eql('1.0.0')
945
+ end
946
+
947
+ it 'should convert parameter containing VersionRange into string' do
948
+ catalog = compile_to_catalog("notify {'foo': message => SemVerRange('>=1.0.0') }")
949
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
950
+ message = catalog2.resource('notify', 'foo')['message']
951
+ expect(message).to be_a(String)
952
+ expect(message).to eql('>=1.0.0')
953
+ end
954
+
955
+ it 'should convert parameter containing Timespan into string' do
956
+ catalog = compile_to_catalog("notify {'foo': message => Timespan(1234) }")
957
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
958
+ message = catalog2.resource('notify', 'foo')['message']
959
+ expect(message).to be_a(String)
960
+ expect(message).to eql('0-00:20:34.0')
961
+ end
962
+
963
+ it 'should convert parameter containing Timestamp into string' do
964
+ catalog = compile_to_catalog("notify {'foo': message => Timestamp('2016-09-15T08:32:16.123 UTC') }")
965
+ catalog2 = Puppet::Resource::Catalog.from_data_hash(JSON.parse(catalog.to_json))
966
+ message = catalog2.resource('notify', 'foo')['message']
967
+ expect(message).to be_a(String)
968
+ expect(message).to eql('2016-09-15T08:32:16.123 UTC')
969
+ end
970
+ end
971
+
972
+ end
846
973
  end
847
974
 
848
975
  describe Puppet::Resource::Catalog, "when converting to pson" do
@@ -287,7 +287,7 @@ describe Puppet::SSL::CertificateRequest do
287
287
  exts = {"thats.no.moon" => "death star"}
288
288
  expect do
289
289
  request.generate(key, :extension_requests => exts)
290
- end.to raise_error Puppet::Error, /Cannot create CSR with extension request thats\.no\.moon.*: first num too large/
290
+ end.to raise_error Puppet::Error, /Cannot create CSR with extension request thats\.no\.moon: first num too large/
291
291
  end
292
292
  end
293
293
 
@@ -299,6 +299,20 @@ describe Puppet::Transaction::AdditionalResourceGenerator do
299
299
  include_in_order("Notify[before]", "Generator[thing]", "Notify[hello]", "Notify[third]", "Notify[after]"))
300
300
  end
301
301
 
302
+ it "sets resources_failed_to_generate to true if resource#eval_generate raises an exception" do
303
+
304
+ catalog = compile_to_ral(<<-MANIFEST)
305
+ notify { 'hello': }
306
+ MANIFEST
307
+
308
+ catalog.resource("Notify[hello]").stubs(:eval_generate).raises(RuntimeError)
309
+ relationship_graph = relationship_graph_for(catalog)
310
+ generator = Puppet::Transaction::AdditionalResourceGenerator.new(catalog, relationship_graph, prioritizer)
311
+ generator.eval_generate(catalog.resource("Notify[hello]"))
312
+
313
+ expect(generator.resources_failed_to_generate).to be_truthy
314
+ end
315
+
302
316
  def relationships_after_eval_generating(manifest, resource_to_generate)
303
317
  catalog = compile_to_ral(manifest)
304
318
  relationship_graph = relationship_graph_for(catalog)
@@ -459,6 +473,22 @@ describe Puppet::Transaction::AdditionalResourceGenerator do
459
473
  "Notify[goodbye]"))
460
474
  end
461
475
 
476
+ it "sets resources_failed_to_generate to true if resource#generate raises an exception" do
477
+
478
+ catalog = compile_to_ral(<<-MANIFEST)
479
+ user { 'foo':
480
+ ensure => present,
481
+ }
482
+ MANIFEST
483
+
484
+ catalog.resource("User[foo]").stubs(:generate).raises(RuntimeError)
485
+ relationship_graph = relationship_graph_for(catalog)
486
+ generator = Puppet::Transaction::AdditionalResourceGenerator.new(catalog, relationship_graph, prioritizer)
487
+ generator.generate_additional_resources(catalog.resource("User[foo]"))
488
+
489
+ expect(generator.resources_failed_to_generate).to be_truthy
490
+ end
491
+
462
492
  def relationships_after_generating(manifest, resource_to_generate)
463
493
  catalog = compile_to_ral(manifest)
464
494
  generate_resources_in(catalog, nil, resource_to_generate)
@@ -148,12 +148,7 @@ describe Puppet::Transaction::Persistence do
148
148
  persistence = Puppet::Transaction::Persistence.new
149
149
 
150
150
  if Puppet.features.microsoft_windows?
151
- expect do
152
- persistence.save
153
- end.to raise_error do |error|
154
- expect(error).to be_a(Puppet::Util::Windows::Error)
155
- expect(error.code).to eq(5) # ERROR_ACCESS_DENIED
156
- end
151
+ expect { persistence.save }.to raise_error(Puppet::Util::Windows::Error, /Access is denied/)
157
152
  else
158
153
  expect { persistence.save }.to raise_error(Errno::EISDIR, /Is a directory/)
159
154
  end
@@ -98,6 +98,17 @@ describe Puppet::Transaction::Report do
98
98
  expect(report.environment).to eq("some environment")
99
99
  end
100
100
 
101
+ it "should be able to set resources_failed_to_generate" do
102
+ report = Puppet::Transaction::Report.new("apply")
103
+ report.resources_failed_to_generate = true
104
+ expect(report.resources_failed_to_generate).to be_truthy
105
+ end
106
+
107
+ it "resources_failed_to_generate should not be true by default" do
108
+ report = Puppet::Transaction::Report.new("apply")
109
+ expect(report.resources_failed_to_generate).to be_falsey
110
+ end
111
+
101
112
  it "should not include whits" do
102
113
  Puppet::FileBucket::File.indirection.stubs(:save)
103
114
 
@@ -270,6 +281,12 @@ describe Puppet::Transaction::Report do
270
281
  @report.finalize_report
271
282
  expect(@report.status).to eq('failed')
272
283
  end
284
+
285
+ it "should mark the report as 'failed' if resources_failed_to_generate" do
286
+ @report.resources_failed_to_generate = true
287
+ @report.finalize_report
288
+ expect(@report.status).to eq('failed')
289
+ end
273
290
  end
274
291
 
275
292
  describe "for changes" do
@@ -455,6 +472,12 @@ describe Puppet::Transaction::Report do
455
472
  report.add_times('config_retrieval', 1.0)
456
473
  expect(report.to_yaml_properties).not_to include('@external_times')
457
474
  end
475
+
476
+ it "should not include @resources_failed_to_generate" do
477
+ report = Puppet::Transaction::Report.new("apply")
478
+ report.resources_failed_to_generate = true
479
+ expect(report.to_yaml_properties).not_to include('@resources_failed_to_generate')
480
+ end
458
481
  end
459
482
 
460
483
  it "defaults to serializing to pson" do
@@ -327,6 +327,44 @@ describe Puppet::Transaction do
327
327
  end
328
328
  end
329
329
 
330
+ describe "after resource traversal" do
331
+ let(:catalog) { Puppet::Resource::Catalog.new }
332
+ let(:prioritizer) { Puppet::Graph::RandomPrioritizer.new }
333
+ let(:report) { Puppet::Transaction::Report.new("apply") }
334
+ let(:transaction) { Puppet::Transaction.new(catalog, report, prioritizer) }
335
+ let(:generator) { Puppet::Transaction::AdditionalResourceGenerator.new(catalog, nil, prioritizer) }
336
+
337
+ before :each do
338
+ generator = Puppet::Transaction::AdditionalResourceGenerator.new(catalog, nil, prioritizer)
339
+ Puppet::Transaction::AdditionalResourceGenerator.stubs(:new).returns(generator)
340
+ end
341
+
342
+ it "should should query the generator for whether resources failed to generate" do
343
+ relationship_graph = Puppet::Graph::RelationshipGraph.new(prioritizer)
344
+ catalog.stubs(:relationship_graph).returns(relationship_graph)
345
+
346
+ sequence = sequence(:traverse_first)
347
+ relationship_graph.expects(:traverse).in_sequence(sequence)
348
+ generator.expects(:resources_failed_to_generate).in_sequence(sequence)
349
+
350
+ transaction.evaluate
351
+ end
352
+
353
+ it "should report that resources failed to generate" do
354
+ generator.expects(:resources_failed_to_generate).returns(true)
355
+ report.expects(:resources_failed_to_generate=).with(true)
356
+
357
+ transaction.evaluate
358
+ end
359
+
360
+ it "should not report that resources failed to generate if none did" do
361
+ generator.expects(:resources_failed_to_generate).returns(false)
362
+ report.expects(:resources_failed_to_generate=).never
363
+
364
+ transaction.evaluate
365
+ end
366
+ end
367
+
330
368
  describe "when performing pre-run checks" do
331
369
  let(:resource) { Puppet::Type.type(:notify).new(:title => "spec") }
332
370
  let(:transaction) { transaction_with_resource(resource) }
@@ -530,6 +530,11 @@ describe Puppet::Type.type(:mount), :unless => Puppet.features.microsoft_windows
530
530
  run_in_catalog(resource)
531
531
  end
532
532
 
533
+ it "should detect out of sync options" do
534
+ resource.provider.property_hash[:live_options] = "foo";
535
+ expect(resource.parameters[:options].insync?('soft')).to eq(false);
536
+ end
537
+
533
538
  it "should umount before flushing changes to disk" do
534
539
  syncorder = sequence('syncorder')
535
540
 
@@ -57,7 +57,10 @@ describe Puppet::Util::Plist, :if => Puppet.features.cfpropertylist? do
57
57
  Take me where I cannot stand
58
58
  I don't care, I'm still free
59
59
  You can't take the sky from me."
60
- end
60
+ end
61
+ let(:binary_data) do
62
+ "\xCF\xFA\xED\xFE\a\u0000\u0000\u0001\u0003\u0000\u0000\x80\u0002\u0000\u0000\u0000\u0012\u0000\u0000\u0000\b"
63
+ end
61
64
  let(:valid_xml_plist_hash) { {"LastUsedPrinters"=>[{"Network"=>"10.85.132.1", "PrinterID"=>"baskerville_corp_puppetlabs_net"}, {"Network"=>"10.14.96.1", "PrinterID"=>"Statler"}]} }
62
65
  let(:plist_path) { file_containing('sample.plist', valid_xml_plist) }
63
66
  let(:binary_plist_magic_number) { 'bplist00' }
@@ -96,7 +99,16 @@ describe Puppet::Util::Plist, :if => Puppet.features.cfpropertylist? do
96
99
  it "returns nil when direct parsing and plutil conversion both fail" do
97
100
  subject.stubs(:read_file_with_offset).with(plist_path, 8).returns('notbinary')
98
101
  subject.stubs(:open_file_with_args).with(plist_path, 'r:UTF-8').returns(non_plist_data)
99
- Puppet.expects(:debug).with(regexp_matches(/^Failed with NoMethodError/))
102
+ Puppet.expects(:debug).with(regexp_matches(/^Failed with (CFFormatError|NoMethodError)/))
103
+ Puppet.expects(:debug).with("Plist #{plist_path} ill-formatted, converting with plutil")
104
+ Puppet::Util::Execution.expects(:execute).with(['/usr/bin/plutil', '-convert', 'xml1', '-o', '/dev/stdout', plist_path],
105
+ {:failonfail => true, :combine => true}).raises(Puppet::ExecutionFailure, 'boom')
106
+ expect(subject.read_plist_file(plist_path)).to eq(nil)
107
+ end
108
+ it "returns nil when file is a non-plist binary blob" do
109
+ subject.stubs(:read_file_with_offset).with(plist_path, 8).returns('notbinary')
110
+ subject.stubs(:open_file_with_args).with(plist_path, 'r:UTF-8').returns(binary_data)
111
+ Puppet.expects(:debug).with(regexp_matches(/^Failed with (CFFormatError|ArgumentError)/))
100
112
  Puppet.expects(:debug).with("Plist #{plist_path} ill-formatted, converting with plutil")
101
113
  Puppet::Util::Execution.expects(:execute).with(['/usr/bin/plutil', '-convert', 'xml1', '-o', '/dev/stdout', plist_path],
102
114
  {:failonfail => true, :combine => true}).raises(Puppet::ExecutionFailure, 'boom')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.7.1
4
+ version: 4.8.0
5
5
  prerelease:
6
6
  platform: x86-mingw32
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-17 00:00:00.000000000 Z
12
+ date: 2016-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: facter
@@ -191,6 +191,7 @@ extensions: []
191
191
  extra_rdoc_files: []
192
192
  files:
193
193
  - CONTRIBUTING.md
194
+ - MAINTAINERS
194
195
  - Rakefile
195
196
  - LICENSE
196
197
  - COMMITTERS.md
@@ -475,6 +476,7 @@ files:
475
476
  - lib/puppet/environments.rb
476
477
  - lib/puppet/functions.rb
477
478
  - lib/puppet/syntax_checkers/json.rb
479
+ - lib/puppet/syntax_checkers/base64.rb
478
480
  - lib/puppet/settings.rb
479
481
  - lib/puppet/confiner.rb
480
482
  - lib/puppet/application/indirection_base.rb
@@ -883,6 +885,7 @@ files:
883
885
  - lib/puppet/parser/functions/regsubst.rb
884
886
  - lib/puppet/parser/functions/include.rb
885
887
  - lib/puppet/parser/functions/epp.rb
888
+ - lib/puppet/parser/functions/find_file.rb
886
889
  - lib/puppet/parser/functions/lest.rb
887
890
  - lib/puppet/parser/functions/sha1.rb
888
891
  - lib/puppet/parser/functions/map.rb
@@ -890,18 +893,22 @@ files:
890
893
  - lib/puppet/parser/functions/defined.rb
891
894
  - lib/puppet/parser/functions/match.rb
892
895
  - lib/puppet/parser/functions/digest.rb
896
+ - lib/puppet/parser/functions/binary_file.rb
893
897
  - lib/puppet/parser/functions/realize.rb
894
898
  - lib/puppet/parser/functions/then.rb
895
899
  - lib/puppet/parser/functions/tagged.rb
896
900
  - lib/puppet/parser/functions/hiera_hash.rb
897
901
  - lib/puppet/parser/functions/filter.rb
898
902
  - lib/puppet/parser/functions/contain.rb
903
+ - lib/puppet/parser/functions/break.rb
899
904
  - lib/puppet/parser/functions/hiera_array.rb
900
905
  - lib/puppet/parser/functions/file.rb
906
+ - lib/puppet/parser/functions/strftime.rb
901
907
  - lib/puppet/parser/functions/reduce.rb
902
908
  - lib/puppet/parser/functions/shellquote.rb
903
909
  - lib/puppet/parser/functions/reverse_each.rb
904
910
  - lib/puppet/parser/functions/sprintf.rb
911
+ - lib/puppet/parser/functions/return.rb
905
912
  - lib/puppet/parser/functions/scanf.rb
906
913
  - lib/puppet/parser/functions/step.rb
907
914
  - lib/puppet/parser/functions/md5.rb
@@ -915,6 +922,7 @@ files:
915
922
  - lib/puppet/parser/functions/tag.rb
916
923
  - lib/puppet/parser/functions/hiera_include.rb
917
924
  - lib/puppet/parser/functions/inline_template.rb
925
+ - lib/puppet/parser/functions/next.rb
918
926
  - lib/puppet/parser/functions/slice.rb
919
927
  - lib/puppet/parser/functions/lookup.rb
920
928
  - lib/puppet/parser/functions/new.rb
@@ -998,10 +1006,13 @@ files:
998
1006
  - lib/puppet/pops/types/type_calculator.rb
999
1007
  - lib/puppet/pops/types/types.rb
1000
1008
  - lib/puppet/pops/types/p_meta_type.rb
1009
+ - lib/puppet/pops/types/p_timespan_type.rb
1001
1010
  - lib/puppet/pops/types/p_object_type.rb
1002
1011
  - lib/puppet/pops/types/implementation_registry.rb
1003
1012
  - lib/puppet/pops/types/p_sem_ver_range_type.rb
1004
1013
  - lib/puppet/pops/types/type_set_reference.rb
1014
+ - lib/puppet/pops/types/p_timestamp_type.rb
1015
+ - lib/puppet/pops/types/p_binary_type.rb
1005
1016
  - lib/puppet/pops/types/ruby_generator.rb
1006
1017
  - lib/puppet/pops/types/p_runtime_type.rb
1007
1018
  - lib/puppet/pops/types/type_formatter.rb
@@ -1021,6 +1032,8 @@ files:
1021
1032
  - lib/puppet/pops/serialization.rb
1022
1033
  - lib/puppet/pops/migration/migration_checker.rb
1023
1034
  - lib/puppet/pops/merge_strategy.rb
1035
+ - lib/puppet/pops/time/timespan.rb
1036
+ - lib/puppet/pops/time/timestamp.rb
1024
1037
  - lib/puppet/pops/loaders.rb
1025
1038
  - lib/puppet/pops/evaluator/literal_evaluator.rb
1026
1039
  - lib/puppet/pops/evaluator/puppet_proc.rb
@@ -1045,6 +1058,7 @@ files:
1045
1058
  - lib/puppet/pops/lookup/explainer.rb
1046
1059
  - lib/puppet/pops/lookup/invocation.rb
1047
1060
  - lib/puppet/pops/lookup/interpolation.rb
1061
+ - lib/puppet/pops/lookup/context.rb
1048
1062
  - lib/puppet/pops/lookup/sub_lookup.rb
1049
1063
  - lib/puppet/pops/pcore.rb
1050
1064
  - lib/puppet/pops/visitable.rb
@@ -1255,19 +1269,31 @@ files:
1255
1269
  - lib/puppet/resource/type.rb
1256
1270
  - lib/puppet/resource/capability_finder.rb
1257
1271
  - lib/puppet/resource/status.rb
1272
+ - lib/puppet/functions/notice.rb
1258
1273
  - lib/puppet/functions/regsubst.rb
1274
+ - lib/puppet/functions/include.rb
1259
1275
  - lib/puppet/functions/epp.rb
1276
+ - lib/puppet/functions/find_file.rb
1260
1277
  - lib/puppet/functions/lest.rb
1261
1278
  - lib/puppet/functions/map.rb
1262
1279
  - lib/puppet/functions/defined.rb
1263
1280
  - lib/puppet/functions/match.rb
1281
+ - lib/puppet/functions/crit.rb
1264
1282
  - lib/puppet/functions/unwrap.rb
1283
+ - lib/puppet/functions/binary_file.rb
1284
+ - lib/puppet/functions/emerg.rb
1265
1285
  - lib/puppet/functions/then.rb
1286
+ - lib/puppet/functions/alert.rb
1266
1287
  - lib/puppet/functions/hiera_hash.rb
1288
+ - lib/puppet/functions/info.rb
1267
1289
  - lib/puppet/functions/filter.rb
1290
+ - lib/puppet/functions/contain.rb
1291
+ - lib/puppet/functions/break.rb
1268
1292
  - lib/puppet/functions/hiera_array.rb
1293
+ - lib/puppet/functions/strftime.rb
1269
1294
  - lib/puppet/functions/reduce.rb
1270
1295
  - lib/puppet/functions/reverse_each.rb
1296
+ - lib/puppet/functions/return.rb
1271
1297
  - lib/puppet/functions/scanf.rb
1272
1298
  - lib/puppet/functions/step.rb
1273
1299
  - lib/puppet/functions/each.rb
@@ -1276,12 +1302,17 @@ files:
1276
1302
  - lib/puppet/functions/hiera.rb
1277
1303
  - lib/puppet/functions/versioncmp.rb
1278
1304
  - lib/puppet/functions/hiera_include.rb
1305
+ - lib/puppet/functions/warning.rb
1306
+ - lib/puppet/functions/next.rb
1279
1307
  - lib/puppet/functions/slice.rb
1280
1308
  - lib/puppet/functions/lookup.rb
1281
1309
  - lib/puppet/functions/import.rb
1282
1310
  - lib/puppet/functions/new.rb
1283
1311
  - lib/puppet/functions/assert_type.rb
1312
+ - lib/puppet/functions/require.rb
1313
+ - lib/puppet/functions/err.rb
1284
1314
  - lib/puppet/functions/dig.rb
1315
+ - lib/puppet/functions/debug.rb
1285
1316
  - lib/puppet/functions/with.rb
1286
1317
  - lib/puppet/functions/inline_epp.rb
1287
1318
  - lib/puppet/external/pson/version.rb
@@ -1619,6 +1650,7 @@ files:
1619
1650
  - spec/lib/puppet_spec/settings.rb
1620
1651
  - spec/lib/puppet_spec/pops.rb
1621
1652
  - spec/lib/puppet_spec/modules.rb
1653
+ - spec/lib/puppet_spec/unindent.rb
1622
1654
  - spec/lib/puppet_spec/language.rb
1623
1655
  - spec/lib/puppet_spec/handler.rb
1624
1656
  - spec/lib/puppet_spec/network.rb
@@ -2103,7 +2135,6 @@ files:
2103
2135
  - spec/integration/parser/catalog_spec.rb
2104
2136
  - spec/integration/parser/compiler_spec.rb
2105
2137
  - spec/integration/parser/environment_spec.rb
2106
- - spec/integration/parser/functions/require_spec.rb
2107
2138
  - spec/integration/parser/scope_spec.rb
2108
2139
  - spec/integration/parser/undef_param_spec.rb
2109
2140
  - spec/integration/module_tool/tar/mini_spec.rb
@@ -2472,7 +2503,6 @@ files:
2472
2503
  - spec/unit/parser/functions/scanf_spec.rb
2473
2504
  - spec/unit/parser/functions/inline_template_spec.rb
2474
2505
  - spec/unit/parser/functions/regsubst_spec.rb
2475
- - spec/unit/parser/functions/require_spec.rb
2476
2506
  - spec/unit/parser/functions/sprintf_spec.rb
2477
2507
  - spec/unit/parser/functions/digest_spec.rb
2478
2508
  - spec/unit/parser/functions/fqdn_rand_spec.rb
@@ -2481,10 +2511,7 @@ files:
2481
2511
  - spec/unit/parser/functions/tag_spec.rb
2482
2512
  - spec/unit/parser/functions/versioncmp_spec.rb
2483
2513
  - spec/unit/parser/functions/template_spec.rb
2484
- - spec/unit/parser/functions/contain_spec.rb
2485
2514
  - spec/unit/parser/functions/file_spec.rb
2486
- - spec/unit/parser/functions/shared.rb
2487
- - spec/unit/parser/functions/include_spec.rb
2488
2515
  - spec/unit/parser/functions/hiera_array_spec.rb
2489
2516
  - spec/unit/parser/functions/fail_spec.rb
2490
2517
  - spec/unit/parser/functions/hiera_spec.rb
@@ -2533,10 +2560,12 @@ files:
2533
2560
  - spec/unit/pops/adaptable_spec.rb
2534
2561
  - spec/unit/pops/label_provider_spec.rb
2535
2562
  - spec/unit/pops/types/type_mismatch_describer_spec.rb
2563
+ - spec/unit/pops/types/p_timespan_type_spec.rb
2536
2564
  - spec/unit/pops/types/recursion_guard_spec.rb
2537
2565
  - spec/unit/pops/types/p_type_set_type_spec.rb
2538
2566
  - spec/unit/pops/types/enumeration_spec.rb
2539
2567
  - spec/unit/pops/types/class_loader_spec.rb
2568
+ - spec/unit/pops/types/p_binary_type_spec.rb
2540
2569
  - spec/unit/pops/types/p_object_type_spec.rb
2541
2570
  - spec/unit/pops/types/type_acceptor_spec.rb
2542
2571
  - spec/unit/pops/types/type_calculator_spec.rb
@@ -2549,10 +2578,12 @@ files:
2549
2578
  - spec/unit/pops/types/p_sem_ver_type_spec.rb
2550
2579
  - spec/unit/pops/types/type_asserter_spec.rb
2551
2580
  - spec/unit/pops/types/type_factory_spec.rb
2581
+ - spec/unit/pops/types/p_timestamp_type_spec.rb
2552
2582
  - spec/unit/pops/types/type_formatter_spec.rb
2553
2583
  - spec/unit/pops/factory_spec.rb
2554
2584
  - spec/unit/pops/validator/validator_spec.rb
2555
2585
  - spec/unit/pops/validation_spec.rb
2586
+ - spec/unit/pops/time/timespan_spec.rb
2556
2587
  - spec/unit/pops/evaluator/runtime3_converter_spec.rb
2557
2588
  - spec/unit/pops/evaluator/conditionals_spec.rb
2558
2589
  - spec/unit/pops/evaluator/variables_spec.rb
@@ -2569,12 +2600,15 @@ files:
2569
2600
  - spec/unit/pops/evaluator/arithmetic_ops_spec.rb
2570
2601
  - spec/unit/pops/puppet_stack_spec.rb
2571
2602
  - spec/unit/pops/containment_spec.rb
2603
+ - spec/unit/pops/lookup/context_spec.rb
2572
2604
  - spec/unit/pops/lookup/interpolation_spec.rb
2573
2605
  - spec/unit/pops/serialization/serialization_spec.rb
2574
2606
  - spec/unit/pops/serialization/packer_spec.rb
2575
2607
  - spec/unit/pops/serialization/rgen_spec.rb
2576
2608
  - spec/unit/pops/issues_spec.rb
2609
+ - spec/unit/pops/parser/parse_functions_spec.rb
2577
2610
  - spec/unit/pops/parser/parse_containers_spec.rb
2611
+ - spec/unit/pops/parser/parse_lambda_spec.rb
2578
2612
  - spec/unit/pops/parser/parse_basic_expressions_spec.rb
2579
2613
  - spec/unit/pops/parser/parse_heredoc_spec.rb
2580
2614
  - spec/unit/pops/parser/source_pos_adapter_spec.rb
@@ -2670,24 +2704,35 @@ files:
2670
2704
  - spec/unit/resource/type_spec.rb
2671
2705
  - spec/unit/functions/split_spec.rb
2672
2706
  - spec/unit/functions/unwrap_spec.rb
2707
+ - spec/unit/functions/logging_spec.rb
2708
+ - spec/unit/functions/binary_file_spec.rb
2673
2709
  - spec/unit/functions/scanf_spec.rb
2674
2710
  - spec/unit/functions/regsubst_spec.rb
2675
2711
  - spec/unit/functions/dig_spec.rb
2712
+ - spec/unit/functions/require_spec.rb
2676
2713
  - spec/unit/functions/reverse_each_spec.rb
2677
2714
  - spec/unit/functions/then_spec.rb
2678
2715
  - spec/unit/functions/with_spec.rb
2716
+ - spec/unit/functions/strftime_spec.rb
2679
2717
  - spec/unit/functions/step_spec.rb
2680
2718
  - spec/unit/functions/defined_spec.rb
2719
+ - spec/unit/functions/return_spec.rb
2681
2720
  - spec/unit/functions/lookup_spec.rb
2682
2721
  - spec/unit/functions/match_spec.rb
2683
2722
  - spec/unit/functions/slice_spec.rb
2723
+ - spec/unit/functions/next_spec.rb
2724
+ - spec/unit/functions/break_spec.rb
2684
2725
  - spec/unit/functions/reduce_spec.rb
2685
2726
  - spec/unit/functions/versioncmp_spec.rb
2686
2727
  - spec/unit/functions/filter_spec.rb
2687
2728
  - spec/unit/functions/assert_type_spec.rb
2729
+ - spec/unit/functions/contain_spec.rb
2688
2730
  - spec/unit/functions/inline_epp_spec.rb
2731
+ - spec/unit/functions/shared.rb
2689
2732
  - spec/unit/functions/lest_spec.rb
2733
+ - spec/unit/functions/find_file_spec.rb
2690
2734
  - spec/unit/functions/type_spec.rb
2735
+ - spec/unit/functions/include_spec.rb
2691
2736
  - spec/unit/functions/map_spec.rb
2692
2737
  - spec/unit/functions/each_spec.rb
2693
2738
  - spec/unit/functions/new_spec.rb
@@ -2864,6 +2909,7 @@ test_files:
2864
2909
  - spec/lib/puppet_spec/settings.rb
2865
2910
  - spec/lib/puppet_spec/pops.rb
2866
2911
  - spec/lib/puppet_spec/modules.rb
2912
+ - spec/lib/puppet_spec/unindent.rb
2867
2913
  - spec/lib/puppet_spec/language.rb
2868
2914
  - spec/lib/puppet_spec/handler.rb
2869
2915
  - spec/lib/puppet_spec/network.rb
@@ -3348,7 +3394,6 @@ test_files:
3348
3394
  - spec/integration/parser/catalog_spec.rb
3349
3395
  - spec/integration/parser/compiler_spec.rb
3350
3396
  - spec/integration/parser/environment_spec.rb
3351
- - spec/integration/parser/functions/require_spec.rb
3352
3397
  - spec/integration/parser/scope_spec.rb
3353
3398
  - spec/integration/parser/undef_param_spec.rb
3354
3399
  - spec/integration/module_tool/tar/mini_spec.rb
@@ -3717,7 +3762,6 @@ test_files:
3717
3762
  - spec/unit/parser/functions/scanf_spec.rb
3718
3763
  - spec/unit/parser/functions/inline_template_spec.rb
3719
3764
  - spec/unit/parser/functions/regsubst_spec.rb
3720
- - spec/unit/parser/functions/require_spec.rb
3721
3765
  - spec/unit/parser/functions/sprintf_spec.rb
3722
3766
  - spec/unit/parser/functions/digest_spec.rb
3723
3767
  - spec/unit/parser/functions/fqdn_rand_spec.rb
@@ -3726,10 +3770,7 @@ test_files:
3726
3770
  - spec/unit/parser/functions/tag_spec.rb
3727
3771
  - spec/unit/parser/functions/versioncmp_spec.rb
3728
3772
  - spec/unit/parser/functions/template_spec.rb
3729
- - spec/unit/parser/functions/contain_spec.rb
3730
3773
  - spec/unit/parser/functions/file_spec.rb
3731
- - spec/unit/parser/functions/shared.rb
3732
- - spec/unit/parser/functions/include_spec.rb
3733
3774
  - spec/unit/parser/functions/hiera_array_spec.rb
3734
3775
  - spec/unit/parser/functions/fail_spec.rb
3735
3776
  - spec/unit/parser/functions/hiera_spec.rb
@@ -3778,10 +3819,12 @@ test_files:
3778
3819
  - spec/unit/pops/adaptable_spec.rb
3779
3820
  - spec/unit/pops/label_provider_spec.rb
3780
3821
  - spec/unit/pops/types/type_mismatch_describer_spec.rb
3822
+ - spec/unit/pops/types/p_timespan_type_spec.rb
3781
3823
  - spec/unit/pops/types/recursion_guard_spec.rb
3782
3824
  - spec/unit/pops/types/p_type_set_type_spec.rb
3783
3825
  - spec/unit/pops/types/enumeration_spec.rb
3784
3826
  - spec/unit/pops/types/class_loader_spec.rb
3827
+ - spec/unit/pops/types/p_binary_type_spec.rb
3785
3828
  - spec/unit/pops/types/p_object_type_spec.rb
3786
3829
  - spec/unit/pops/types/type_acceptor_spec.rb
3787
3830
  - spec/unit/pops/types/type_calculator_spec.rb
@@ -3794,10 +3837,12 @@ test_files:
3794
3837
  - spec/unit/pops/types/p_sem_ver_type_spec.rb
3795
3838
  - spec/unit/pops/types/type_asserter_spec.rb
3796
3839
  - spec/unit/pops/types/type_factory_spec.rb
3840
+ - spec/unit/pops/types/p_timestamp_type_spec.rb
3797
3841
  - spec/unit/pops/types/type_formatter_spec.rb
3798
3842
  - spec/unit/pops/factory_spec.rb
3799
3843
  - spec/unit/pops/validator/validator_spec.rb
3800
3844
  - spec/unit/pops/validation_spec.rb
3845
+ - spec/unit/pops/time/timespan_spec.rb
3801
3846
  - spec/unit/pops/evaluator/runtime3_converter_spec.rb
3802
3847
  - spec/unit/pops/evaluator/conditionals_spec.rb
3803
3848
  - spec/unit/pops/evaluator/variables_spec.rb
@@ -3814,12 +3859,15 @@ test_files:
3814
3859
  - spec/unit/pops/evaluator/arithmetic_ops_spec.rb
3815
3860
  - spec/unit/pops/puppet_stack_spec.rb
3816
3861
  - spec/unit/pops/containment_spec.rb
3862
+ - spec/unit/pops/lookup/context_spec.rb
3817
3863
  - spec/unit/pops/lookup/interpolation_spec.rb
3818
3864
  - spec/unit/pops/serialization/serialization_spec.rb
3819
3865
  - spec/unit/pops/serialization/packer_spec.rb
3820
3866
  - spec/unit/pops/serialization/rgen_spec.rb
3821
3867
  - spec/unit/pops/issues_spec.rb
3868
+ - spec/unit/pops/parser/parse_functions_spec.rb
3822
3869
  - spec/unit/pops/parser/parse_containers_spec.rb
3870
+ - spec/unit/pops/parser/parse_lambda_spec.rb
3823
3871
  - spec/unit/pops/parser/parse_basic_expressions_spec.rb
3824
3872
  - spec/unit/pops/parser/parse_heredoc_spec.rb
3825
3873
  - spec/unit/pops/parser/source_pos_adapter_spec.rb
@@ -3915,24 +3963,35 @@ test_files:
3915
3963
  - spec/unit/resource/type_spec.rb
3916
3964
  - spec/unit/functions/split_spec.rb
3917
3965
  - spec/unit/functions/unwrap_spec.rb
3966
+ - spec/unit/functions/logging_spec.rb
3967
+ - spec/unit/functions/binary_file_spec.rb
3918
3968
  - spec/unit/functions/scanf_spec.rb
3919
3969
  - spec/unit/functions/regsubst_spec.rb
3920
3970
  - spec/unit/functions/dig_spec.rb
3971
+ - spec/unit/functions/require_spec.rb
3921
3972
  - spec/unit/functions/reverse_each_spec.rb
3922
3973
  - spec/unit/functions/then_spec.rb
3923
3974
  - spec/unit/functions/with_spec.rb
3975
+ - spec/unit/functions/strftime_spec.rb
3924
3976
  - spec/unit/functions/step_spec.rb
3925
3977
  - spec/unit/functions/defined_spec.rb
3978
+ - spec/unit/functions/return_spec.rb
3926
3979
  - spec/unit/functions/lookup_spec.rb
3927
3980
  - spec/unit/functions/match_spec.rb
3928
3981
  - spec/unit/functions/slice_spec.rb
3982
+ - spec/unit/functions/next_spec.rb
3983
+ - spec/unit/functions/break_spec.rb
3929
3984
  - spec/unit/functions/reduce_spec.rb
3930
3985
  - spec/unit/functions/versioncmp_spec.rb
3931
3986
  - spec/unit/functions/filter_spec.rb
3932
3987
  - spec/unit/functions/assert_type_spec.rb
3988
+ - spec/unit/functions/contain_spec.rb
3933
3989
  - spec/unit/functions/inline_epp_spec.rb
3990
+ - spec/unit/functions/shared.rb
3934
3991
  - spec/unit/functions/lest_spec.rb
3992
+ - spec/unit/functions/find_file_spec.rb
3935
3993
  - spec/unit/functions/type_spec.rb
3994
+ - spec/unit/functions/include_spec.rb
3936
3995
  - spec/unit/functions/map_spec.rb
3937
3996
  - spec/unit/functions/each_spec.rb
3938
3997
  - spec/unit/functions/new_spec.rb