puppet 5.0.1 → 5.1.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.
- checksums.yaml +4 -4
- data/lib/puppet/agent.rb +1 -0
- data/lib/puppet/defaults.rb +1 -1
- data/lib/puppet/functions.rb +6 -7
- data/lib/puppet/functions/all.rb +100 -0
- data/lib/puppet/functions/any.rb +105 -0
- data/lib/puppet/functions/defined.rb +3 -3
- data/lib/puppet/functions/new.rb +2 -1
- data/lib/puppet/functions/reduce.rb +31 -0
- data/lib/puppet/functions/tree_each.rb +200 -0
- data/lib/puppet/module.rb +30 -0
- data/lib/puppet/parser/functions/new.rb +67 -0
- data/lib/puppet/parser/functions/reduce.rb +31 -0
- data/lib/puppet/parser/relationship.rb +2 -2
- data/lib/puppet/parser/resource.rb +39 -10
- data/lib/puppet/parser/scope.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +11 -4
- data/lib/puppet/pops/evaluator/collector_transformer.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +4 -4
- data/lib/puppet/pops/evaluator/relationship_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +3 -3
- data/lib/puppet/pops/evaluator/runtime3_resource_support.rb +1 -1
- data/lib/puppet/pops/loader/module_loaders.rb +1 -1
- data/lib/puppet/pops/loader/static_loader.rb +1 -2
- data/lib/puppet/pops/loaders.rb +1 -2
- data/lib/puppet/pops/lookup/context.rb +1 -1
- data/lib/puppet/pops/lookup/lookup_adapter.rb +2 -1
- data/lib/puppet/pops/model/ast.rb +440 -436
- data/lib/puppet/pops/model/factory.rb +140 -140
- data/lib/puppet/pops/pcore.rb +1 -2
- data/lib/puppet/pops/resource/param.rb +1 -1
- data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/lib/puppet/pops/serialization/from_data_converter.rb +0 -12
- data/lib/puppet/pops/time/timestamp.rb +29 -17
- data/lib/puppet/pops/types/annotatable.rb +2 -2
- data/lib/puppet/pops/types/annotation.rb +8 -8
- data/lib/puppet/pops/types/class_loader.rb +3 -3
- data/lib/puppet/pops/types/implementation_registry.rb +1 -1
- data/lib/puppet/pops/types/iterable.rb +2 -2
- data/lib/puppet/pops/types/p_binary_type.rb +2 -2
- data/lib/puppet/pops/types/p_init_type.rb +238 -0
- data/lib/puppet/pops/types/p_meta_type.rb +14 -11
- data/lib/puppet/pops/types/p_object_type.rb +15 -15
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +2 -2
- data/lib/puppet/pops/types/p_sem_ver_type.rb +2 -2
- data/lib/puppet/pops/types/p_sensitive_type.rb +2 -2
- data/lib/puppet/pops/types/p_timespan_type.rb +6 -6
- data/lib/puppet/pops/types/p_timestamp_type.rb +6 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +10 -9
- data/lib/puppet/pops/types/ruby_generator.rb +6 -5
- data/lib/puppet/pops/types/ruby_method.rb +2 -2
- data/lib/puppet/pops/types/string_converter.rb +1 -1
- data/lib/puppet/pops/types/tree_iterators.rb +250 -0
- data/lib/puppet/pops/types/type_calculator.rb +13 -13
- data/lib/puppet/pops/types/type_factory.rb +26 -7
- data/lib/puppet/pops/types/type_formatter.rb +9 -4
- data/lib/puppet/pops/types/type_parser.rb +8 -3
- data/lib/puppet/pops/types/type_set_reference.rb +2 -2
- data/lib/puppet/pops/types/types.rb +168 -109
- data/lib/puppet/provider/package/gem.rb +10 -9
- data/lib/puppet/provider/package/pip.rb +12 -3
- data/lib/puppet/provider/package/yum.rb +9 -1
- data/lib/puppet/resource/capability_finder.rb +30 -11
- data/lib/puppet/type/file.rb +21 -13
- data/lib/puppet/util/execution.rb +67 -14
- data/lib/puppet/util/suidmanager.rb +1 -0
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +130 -66
- data/man/man5/puppet.conf.5 +1 -1
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt +1 -0
- data/spec/integration/parser/collection_spec.rb +40 -1
- data/spec/shared_contexts/types_setup.rb +41 -2
- data/spec/unit/agent_spec.rb +11 -0
- data/spec/unit/file_bucket/dipper_spec.rb +13 -4
- data/spec/unit/functions/all_spec.rb +97 -0
- data/spec/unit/functions/any_spec.rb +109 -0
- data/spec/unit/functions/hiera_spec.rb +5 -0
- data/spec/unit/functions/new_spec.rb +66 -0
- data/spec/unit/functions/tree_each_spec.rb +444 -0
- data/spec/unit/module_spec.rb +29 -0
- data/spec/unit/pops/serialization/serialization_spec.rb +2 -2
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +2 -2
- data/spec/unit/pops/types/iterable_spec.rb +9 -9
- data/spec/unit/pops/types/p_init_type_spec.rb +285 -0
- data/spec/unit/pops/types/p_object_type_spec.rb +8 -8
- data/spec/unit/pops/types/p_sensitive_type_spec.rb +4 -0
- data/spec/unit/pops/types/p_timespan_type_spec.rb +14 -0
- data/spec/unit/pops/types/p_timestamp_type_spec.rb +19 -1
- data/spec/unit/pops/types/p_type_set_type_spec.rb +2 -2
- data/spec/unit/pops/types/ruby_generator_spec.rb +9 -22
- data/spec/unit/pops/types/string_converter_spec.rb +2 -2
- data/spec/unit/pops/types/type_acceptor_spec.rb +2 -2
- data/spec/unit/pops/types/type_calculator_spec.rb +43 -38
- data/spec/unit/pops/types/type_factory_spec.rb +6 -6
- data/spec/unit/pops/types/type_formatter_spec.rb +6 -6
- data/spec/unit/pops/types/types_spec.rb +16 -4
- data/spec/unit/provider/package/gem_spec.rb +6 -6
- data/spec/unit/provider/package/pip_spec.rb +44 -23
- data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
- data/spec/unit/provider/package/yum_spec.rb +8 -0
- data/spec/unit/resource/capability_finder_spec.rb +4 -5
- data/spec/unit/type/file_spec.rb +19 -14
- data/spec/unit/util/execution_spec.rb +216 -82
- data/tasks/generate_ast_model.rake +10 -2
- metadata +15 -2
@@ -22,7 +22,7 @@ else
|
|
22
22
|
ruby = Types::RubyGenerator.new.module_definition_from_typeset(ast_model)
|
23
23
|
|
24
24
|
# Replace ref() constructs to known Pcore types with directly initialized types. ref() cannot be used
|
25
|
-
# since it requires a parser (
|
25
|
+
# since it requires a parser (chicken-and-egg problem)
|
26
26
|
ruby.gsub!(/^module Parser\nmodule Locator\n.*\nend\nend\nmodule Model\n/m, "module Model\n")
|
27
27
|
|
28
28
|
# Remove generated RubyMethod annotations. The ruby methods are there now, no need to also have
|
@@ -34,7 +34,11 @@ else
|
|
34
34
|
ruby.gsub!(/ref\('Array\[([0-9A-Za-z_]+)\]'\)/, 'Types::PArrayType.new(Types::P\1Type::DEFAULT)')
|
35
35
|
ruby.gsub!(/ref\('Optional\[Array\[([0-9A-Za-z_]+)\]\]'\)/,
|
36
36
|
'Types::POptionalType.new(Types::PArrayType.new(Types::P\1Type::DEFAULT))')
|
37
|
-
ruby.gsub!(/ref\(
|
37
|
+
ruby.gsub!(/ref\('Enum(\[[^\]]+\])'\)/) do |match|
|
38
|
+
params = $1
|
39
|
+
params.gsub!(/\\'/, '\'')
|
40
|
+
"Types::PEnumType.new(#{params})"
|
41
|
+
end
|
38
42
|
|
39
43
|
# Replace ref() constructs with references to _pcore_type of the types in the module namespace
|
40
44
|
ruby.gsub!(/ref\('Puppet::AST::Locator'\)/, 'Parser::Locator::Locator19._pcore_type')
|
@@ -47,10 +51,14 @@ else
|
|
47
51
|
# Remove the generated ref() method. It's not needed by this model
|
48
52
|
ruby.gsub!(/ def self\.ref\(type_string\)\n.*\n end\n\n/, '')
|
49
53
|
|
54
|
+
# Add Program#current method for backward compatibility
|
55
|
+
ruby.gsub!(/(attr_reader :body\n attr_reader :definitions\n attr_reader :locator)/, "\\1\n\n def current\n self\n end")
|
56
|
+
|
50
57
|
# Replace the generated registration with a registration that uses the static loader. This will
|
51
58
|
# become part of the Puppet bootstrap code and there will be no other loader until we have a
|
52
59
|
# parser.
|
53
60
|
ruby.gsub!(/^Puppet::Pops::Pcore.register_implementations\((\[[^\]]+\])\)/, <<-RUBY)
|
61
|
+
|
54
62
|
module Model
|
55
63
|
@@pcore_ast_initialized = false
|
56
64
|
def self.register_pcore_types
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0
|
4
|
+
version: 5.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -394,7 +394,9 @@ files:
|
|
394
394
|
- lib/puppet/forge/repository.rb
|
395
395
|
- lib/puppet/functions.rb
|
396
396
|
- lib/puppet/functions/alert.rb
|
397
|
+
- lib/puppet/functions/all.rb
|
397
398
|
- lib/puppet/functions/annotate.rb
|
399
|
+
- lib/puppet/functions/any.rb
|
398
400
|
- lib/puppet/functions/assert_type.rb
|
399
401
|
- lib/puppet/functions/binary_file.rb
|
400
402
|
- lib/puppet/functions/break.rb
|
@@ -439,6 +441,7 @@ files:
|
|
439
441
|
- lib/puppet/functions/step.rb
|
440
442
|
- lib/puppet/functions/strftime.rb
|
441
443
|
- lib/puppet/functions/then.rb
|
444
|
+
- lib/puppet/functions/tree_each.rb
|
442
445
|
- lib/puppet/functions/type.rb
|
443
446
|
- lib/puppet/functions/unique.rb
|
444
447
|
- lib/puppet/functions/unwrap.rb
|
@@ -852,6 +855,7 @@ files:
|
|
852
855
|
- lib/puppet/pops/types/implementation_registry.rb
|
853
856
|
- lib/puppet/pops/types/iterable.rb
|
854
857
|
- lib/puppet/pops/types/p_binary_type.rb
|
858
|
+
- lib/puppet/pops/types/p_init_type.rb
|
855
859
|
- lib/puppet/pops/types/p_meta_type.rb
|
856
860
|
- lib/puppet/pops/types/p_object_type.rb
|
857
861
|
- lib/puppet/pops/types/p_runtime_type.rb
|
@@ -866,6 +870,7 @@ files:
|
|
866
870
|
- lib/puppet/pops/types/ruby_generator.rb
|
867
871
|
- lib/puppet/pops/types/ruby_method.rb
|
868
872
|
- lib/puppet/pops/types/string_converter.rb
|
873
|
+
- lib/puppet/pops/types/tree_iterators.rb
|
869
874
|
- lib/puppet/pops/types/type_acceptor.rb
|
870
875
|
- lib/puppet/pops/types/type_asserter.rb
|
871
876
|
- lib/puppet/pops/types/type_assertion_error.rb
|
@@ -1958,7 +1963,9 @@ files:
|
|
1958
1963
|
- spec/unit/forge/module_release_spec.rb
|
1959
1964
|
- spec/unit/forge/repository_spec.rb
|
1960
1965
|
- spec/unit/forge_spec.rb
|
1966
|
+
- spec/unit/functions/all_spec.rb
|
1961
1967
|
- spec/unit/functions/annotate_spec.rb
|
1968
|
+
- spec/unit/functions/any_spec.rb
|
1962
1969
|
- spec/unit/functions/assert_type_spec.rb
|
1963
1970
|
- spec/unit/functions/binary_file_spec.rb
|
1964
1971
|
- spec/unit/functions/break_spec.rb
|
@@ -1993,6 +2000,7 @@ files:
|
|
1993
2000
|
- spec/unit/functions/step_spec.rb
|
1994
2001
|
- spec/unit/functions/strftime_spec.rb
|
1995
2002
|
- spec/unit/functions/then_spec.rb
|
2003
|
+
- spec/unit/functions/tree_each_spec.rb
|
1996
2004
|
- spec/unit/functions/type_spec.rb
|
1997
2005
|
- spec/unit/functions/unique_spec.rb
|
1998
2006
|
- spec/unit/functions/unwrap_spec.rb
|
@@ -2252,6 +2260,7 @@ files:
|
|
2252
2260
|
- spec/unit/pops/types/enumeration_spec.rb
|
2253
2261
|
- spec/unit/pops/types/iterable_spec.rb
|
2254
2262
|
- spec/unit/pops/types/p_binary_type_spec.rb
|
2263
|
+
- spec/unit/pops/types/p_init_type_spec.rb
|
2255
2264
|
- spec/unit/pops/types/p_object_type_spec.rb
|
2256
2265
|
- spec/unit/pops/types/p_sem_ver_type_spec.rb
|
2257
2266
|
- spec/unit/pops/types/p_sensitive_type_spec.rb
|
@@ -3228,7 +3237,9 @@ test_files:
|
|
3228
3237
|
- spec/unit/forge/module_release_spec.rb
|
3229
3238
|
- spec/unit/forge/repository_spec.rb
|
3230
3239
|
- spec/unit/forge_spec.rb
|
3240
|
+
- spec/unit/functions/all_spec.rb
|
3231
3241
|
- spec/unit/functions/annotate_spec.rb
|
3242
|
+
- spec/unit/functions/any_spec.rb
|
3232
3243
|
- spec/unit/functions/assert_type_spec.rb
|
3233
3244
|
- spec/unit/functions/binary_file_spec.rb
|
3234
3245
|
- spec/unit/functions/break_spec.rb
|
@@ -3263,6 +3274,7 @@ test_files:
|
|
3263
3274
|
- spec/unit/functions/step_spec.rb
|
3264
3275
|
- spec/unit/functions/strftime_spec.rb
|
3265
3276
|
- spec/unit/functions/then_spec.rb
|
3277
|
+
- spec/unit/functions/tree_each_spec.rb
|
3266
3278
|
- spec/unit/functions/type_spec.rb
|
3267
3279
|
- spec/unit/functions/unique_spec.rb
|
3268
3280
|
- spec/unit/functions/unwrap_spec.rb
|
@@ -3522,6 +3534,7 @@ test_files:
|
|
3522
3534
|
- spec/unit/pops/types/enumeration_spec.rb
|
3523
3535
|
- spec/unit/pops/types/iterable_spec.rb
|
3524
3536
|
- spec/unit/pops/types/p_binary_type_spec.rb
|
3537
|
+
- spec/unit/pops/types/p_init_type_spec.rb
|
3525
3538
|
- spec/unit/pops/types/p_object_type_spec.rb
|
3526
3539
|
- spec/unit/pops/types/p_sem_ver_type_spec.rb
|
3527
3540
|
- spec/unit/pops/types/p_sensitive_type_spec.rb
|