puppet 4.8.2-x86-mingw32 → 4.9.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.
- checksums.yaml +15 -0
- data/CONTRIBUTING.md +25 -1
- data/Gemfile +6 -0
- data/Rakefile +1 -0
- data/ext/project_data.yaml +5 -1
- data/ext/windows/service/daemon.rb +2 -1
- data/install.rb +43 -6
- data/lib/hiera/puppet_function.rb +15 -17
- data/lib/hiera/scope.rb +12 -14
- data/lib/puppet.rb +52 -0
- data/lib/puppet/application/face_base.rb +4 -0
- data/lib/puppet/application/lookup.rb +4 -2
- data/lib/puppet/application/resource.rb +1 -1
- data/lib/puppet/data_providers.rb +6 -3
- data/lib/puppet/data_providers/data_adapter.rb +6 -0
- data/lib/puppet/data_providers/data_function_support.rb +7 -0
- data/lib/puppet/data_providers/function_env_data_provider.rb +7 -0
- data/lib/puppet/data_providers/function_module_data_provider.rb +6 -0
- data/lib/puppet/data_providers/hiera_config.rb +31 -10
- data/lib/puppet/data_providers/hiera_env_data_provider.rb +6 -0
- data/lib/puppet/data_providers/hiera_interpolate.rb +2 -1
- data/lib/puppet/data_providers/hiera_module_data_provider.rb +6 -0
- data/lib/puppet/data_providers/hiera_support.rb +6 -0
- data/lib/puppet/data_providers/json_data_provider_factory.rb +12 -0
- data/lib/puppet/data_providers/yaml_data_provider_factory.rb +12 -0
- data/lib/puppet/defaults.rb +25 -4
- data/lib/puppet/face/ca.rb +2 -0
- data/lib/puppet/face/certificate_request.rb +2 -0
- data/lib/puppet/face/certificate_revocation_list.rb +2 -0
- data/lib/puppet/face/file.rb +3 -0
- data/lib/puppet/face/help.rb +19 -17
- data/lib/puppet/face/help/face.erb +3 -0
- data/lib/puppet/face/key.rb +1 -0
- data/lib/puppet/face/man.rb +4 -2
- data/lib/puppet/face/module/generate.rb +1 -1
- data/lib/puppet/face/status.rb +2 -0
- data/lib/puppet/feature/base.rb +9 -2
- data/lib/puppet/feature/hocon.rb +3 -0
- data/lib/puppet/file_system.rb +15 -3
- data/lib/puppet/file_system/windows.rb +8 -0
- data/lib/puppet/forge.rb +6 -6
- data/lib/puppet/forge/repository.rb +1 -2
- data/lib/puppet/functions/binary_file.rb +4 -10
- data/lib/puppet/functions/hiera_array.rb +1 -1
- data/lib/puppet/functions/hiera_include.rb +1 -1
- data/lib/puppet/functions/hocon_data.rb +24 -0
- data/lib/puppet/functions/json_data.rb +18 -0
- data/lib/puppet/functions/yaml_data.rb +21 -0
- data/lib/puppet/generate/type.rb +1 -1
- data/lib/puppet/graph/simple_graph.rb +4 -2
- data/lib/puppet/indirector/file_bucket_file/file.rb +10 -2
- data/lib/puppet/indirector/request.rb +5 -1
- data/lib/puppet/interface.rb +14 -2
- data/lib/puppet/interface/face_collection.rb +1 -1
- data/lib/puppet/module.rb +14 -2
- data/lib/puppet/module_tool.rb +4 -4
- data/lib/puppet/module_tool/applications/builder.rb +3 -2
- data/lib/puppet/module_tool/applications/installer.rb +14 -14
- data/lib/puppet/module_tool/applications/upgrader.rb +13 -13
- data/lib/puppet/module_tool/installed_modules.rb +7 -7
- data/lib/puppet/module_tool/local_tarball.rb +3 -3
- data/lib/puppet/module_tool/metadata.rb +1 -1
- data/lib/puppet/network/http/connection.rb +2 -0
- data/lib/puppet/network/http/webrick.rb +2 -1
- data/lib/puppet/parser/functions/hiera.rb +14 -0
- data/lib/puppet/parser/functions/hiera_array.rb +14 -0
- data/lib/puppet/parser/functions/hiera_hash.rb +14 -0
- data/lib/puppet/parser/functions/hiera_include.rb +14 -0
- data/lib/puppet/parser/scope.rb +14 -20
- data/lib/puppet/plugins/data_providers.rb +2 -0
- data/lib/puppet/plugins/data_providers/data_provider.rb +108 -17
- data/lib/puppet/plugins/data_providers/registry.rb +2 -36
- data/lib/puppet/pops.rb +6 -9
- data/lib/puppet/pops/adaptable.rb +0 -3
- data/lib/puppet/pops/binder/producers.rb +3 -3
- data/lib/puppet/pops/evaluator/access_operator.rb +4 -4
- data/lib/puppet/pops/evaluator/closure.rb +1 -1
- data/lib/puppet/pops/evaluator/compare_operator.rb +4 -4
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +1 -1
- data/lib/puppet/pops/issues.rb +4 -0
- data/lib/puppet/pops/label_provider.rb +14 -0
- data/lib/puppet/pops/loader/loader_paths.rb +3 -1
- data/lib/puppet/pops/loader/module_loaders.rb +21 -7
- data/lib/puppet/pops/loader/typed_name.rb +0 -2
- data/lib/puppet/pops/loaders.rb +31 -12
- data/lib/puppet/pops/lookup.rb +4 -3
- data/lib/puppet/pops/lookup/configured_data_provider.rb +87 -0
- data/lib/puppet/pops/lookup/context.rb +121 -71
- data/lib/puppet/pops/lookup/data_adapter.rb +27 -0
- data/lib/puppet/pops/lookup/data_dig_function_provider.rb +55 -0
- data/lib/puppet/pops/lookup/data_hash_function_provider.rb +111 -0
- data/lib/puppet/pops/lookup/data_provider.rb +102 -0
- data/lib/puppet/pops/lookup/environment_data_provider.rb +27 -0
- data/lib/puppet/pops/lookup/explainer.rb +122 -82
- data/lib/puppet/pops/lookup/function_provider.rb +82 -0
- data/lib/puppet/pops/lookup/global_data_provider.rb +49 -0
- data/lib/puppet/pops/lookup/hiera_config.rb +601 -0
- data/lib/puppet/pops/lookup/interpolation.rb +56 -35
- data/lib/puppet/pops/lookup/invocation.rb +179 -101
- data/lib/puppet/pops/lookup/location_resolver.rb +72 -0
- data/lib/puppet/pops/lookup/lookup_adapter.rb +451 -0
- data/lib/puppet/pops/lookup/lookup_key.rb +99 -0
- data/lib/puppet/pops/lookup/lookup_key_function_provider.rb +119 -0
- data/lib/puppet/pops/lookup/module_data_provider.rb +58 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +8 -4
- data/lib/puppet/pops/merge_strategy.rb +120 -39
- data/lib/puppet/pops/parser/egrammar.ra +2 -0
- data/lib/puppet/pops/parser/eparser.rb +816 -808
- data/lib/puppet/pops/parser/locator.rb +3 -3
- data/lib/puppet/pops/parser/slurp_support.rb +4 -3
- data/lib/puppet/pops/pcore.rb +21 -12
- data/lib/puppet/pops/serialization/abstract_reader.rb +17 -7
- data/lib/puppet/pops/serialization/abstract_writer.rb +27 -12
- data/lib/puppet/pops/serialization/deserializer.rb +17 -4
- data/lib/puppet/pops/serialization/extension.rb +37 -8
- data/lib/puppet/pops/serialization/object.rb +14 -6
- data/lib/puppet/pops/serialization/rgen.rb +2 -1
- data/lib/puppet/pops/serialization/serializer.rb +30 -7
- data/lib/puppet/pops/types/implementation_registry.rb +1 -1
- data/lib/puppet/pops/types/p_object_type.rb +55 -12
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +27 -27
- data/lib/puppet/pops/types/p_sem_ver_type.rb +12 -12
- data/lib/puppet/pops/types/p_timespan_type.rb +6 -6
- data/lib/puppet/pops/types/p_timestamp_type.rb +2 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +7 -16
- data/lib/puppet/pops/types/recursion_guard.rb +64 -20
- data/lib/puppet/pops/types/ruby_generator.rb +10 -0
- data/lib/puppet/pops/types/type_calculator.rb +23 -13
- data/lib/puppet/pops/types/type_factory.rb +20 -9
- data/lib/puppet/pops/types/type_formatter.rb +37 -17
- data/lib/puppet/pops/types/type_mismatch_describer.rb +7 -6
- data/lib/puppet/pops/types/type_parser.rb +6 -0
- data/lib/puppet/pops/types/types.rb +225 -132
- data/lib/puppet/pops/validation.rb +1 -1
- data/lib/puppet/pops/validation/checker4_0.rb +12 -2
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -0
- data/lib/puppet/pops/visitor.rb +4 -3
- data/lib/puppet/provider/mcx/mcxcontent.rb +2 -1
- data/lib/puppet/provider/nameservice.rb +15 -0
- data/lib/puppet/provider/package/appdmg.rb +1 -1
- data/lib/puppet/provider/package/dnf.rb +1 -1
- data/lib/puppet/provider/package/pkg.rb +1 -1
- data/lib/puppet/provider/package/pkgdmg.rb +1 -1
- data/lib/puppet/provider/package/pkgng.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +2 -2
- data/lib/puppet/provider/service/smf.rb +3 -3
- data/lib/puppet/provider/service/systemd.rb +5 -1
- data/lib/puppet/provider/user/directoryservice.rb +1 -0
- data/lib/puppet/provider/user/user_role_add.rb +15 -0
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -2
- data/lib/puppet/provider/zone/solaris.rb +4 -1
- data/lib/puppet/reference/indirection.rb +1 -1
- data/lib/puppet/resource.rb +2 -3
- data/lib/puppet/resource/catalog.rb +12 -4
- data/lib/puppet/resource/type.rb +3 -3
- data/lib/puppet/settings.rb +1 -1
- data/lib/puppet/settings/config_file.rb +2 -1
- data/lib/puppet/settings/directory_setting.rb +6 -0
- data/lib/puppet/settings/environment_conf.rb +6 -2
- data/lib/puppet/settings/file_or_directory_setting.rb +6 -0
- data/lib/puppet/settings/file_setting.rb +10 -0
- data/lib/puppet/ssl/certificate_authority.rb +13 -2
- data/lib/puppet/ssl/host.rb +23 -1
- data/lib/puppet/transaction/additional_resource_generator.rb +7 -0
- data/lib/puppet/type/user.rb +16 -3
- data/lib/puppet/util.rb +1 -0
- data/lib/puppet/util/execution.rb +3 -3
- data/lib/puppet/util/filetype.rb +11 -5
- data/lib/puppet/util/logging.rb +2 -1
- data/lib/puppet/util/network_device/config.rb +1 -1
- data/lib/puppet/util/plist.rb +6 -0
- data/lib/puppet/util/profiler/aggregate.rb +1 -1
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +2 -2
- data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +2 -1
- data/lib/puppet/util/windows/adsi.rb +15 -12
- data/lib/puppet/vendor/load_semantic_puppet.rb +1 -0
- data/lib/puppet/vendor/pathspec/lib/pathspec.rb +2 -1
- data/lib/puppet/vendor/require_vendored.rb +0 -1
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet.rb +17 -0
- data/lib/puppet/vendor/{semantic/lib/semantic → semantic_puppet/lib/semantic_puppet}/dependency.rb +7 -7
- data/lib/puppet/vendor/{semantic/lib/semantic → semantic_puppet/lib/semantic_puppet}/dependency/graph.rb +2 -2
- data/lib/puppet/vendor/{semantic/lib/semantic → semantic_puppet/lib/semantic_puppet}/dependency/graph_node.rb +2 -2
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/dependency/module_release.rb +58 -0
- data/lib/puppet/vendor/{semantic/lib/semantic → semantic_puppet/lib/semantic_puppet}/dependency/source.rb +2 -2
- data/lib/puppet/vendor/{semantic/lib/semantic → semantic_puppet/lib/semantic_puppet}/dependency/unsatisfiable_graph.rb +2 -2
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/gem_version.rb +3 -0
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/locales/config.yaml +21 -0
- data/lib/puppet/vendor/{semantic/lib/semantic → semantic_puppet/lib/semantic_puppet}/version.rb +48 -21
- data/lib/puppet/vendor/{semantic/lib/semantic → semantic_puppet/lib/semantic_puppet}/version_range.rb +15 -17
- data/lib/puppet/version.rb +1 -1
- data/lib/semver.rb +19 -12
- data/locales/config.yaml +29 -0
- data/locales/puppet.pot +79 -0
- data/man/man5/puppet.conf.5 +1 -1
- data/spec/fixtures/unit/application/environments/puppet_func_provider/functions/{data.pp → environment/data.pp} +0 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_misc/data/common.yaml +2 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_modules/modules/two/data/common.yaml +1 -1
- data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/hiera.yaml +5 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/lib/puppet/bindings/backend/default.rb +9 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/lib/puppet_x/backend/special_data_provider_factory.rb +23 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/manifests/init.pp +5 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/backend/metadata.json +9 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb +1 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/manifests/init.pp +1 -1
- data/spec/fixtures/unit/functions/lookup/data/common.yaml +19 -0
- data/spec/fixtures/unit/functions/lookup_fixture/data/common.yaml +19 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/environment.conf +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/lib/puppet/functions/environment/data.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/abc/lib/puppet/functions/abc/data.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/abc/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/bad_data/lib/puppet/bindings/bad_data/default.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/bad_data/lib/puppet/functions/bad_data/data.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/bad_data/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/bca/lib/puppet/bindings/bca/default.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/bca/lib/puppet/functions/bca/data.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/bca/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_json/data/empty.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_json/hiera.yaml +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_json/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_json/metadata.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_json/data/empty_key.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_json/hiera.yaml +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_json/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_json/metadata.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_yaml/data/empty_key.yaml +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_yaml/hiera.yaml +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_yaml/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_key_yaml/metadata.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_yaml/data/empty.yaml +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_yaml/hiera.yaml +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_yaml/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/empty_yaml/metadata.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/hieraprovider/data/first.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/hieraprovider/hiera.yaml +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/hieraprovider/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/hieraprovider/metadata.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/meta/lib/puppet/functions/meta/data.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/meta/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/meta/metadata.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/metawcp/lib/puppet/bindings/metawcp/default.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/metawcp/lib/puppet_x/thallgren/sample_module_data.rb +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/metawcp/manifests/init.pp +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/metawcp/metadata.json +0 -0
- data/spec/fixtures/unit/functions/{lookup → lookup_fixture}/environments/production/modules/no_provider/manifests/init.pp +0 -0
- data/spec/integration/application/apply_spec.rb +88 -2
- data/spec/integration/application/lookup_spec.rb +155 -0
- data/spec/integration/data_binding_spec.rb +5 -5
- data/spec/integration/defaults_spec.rb +13 -0
- data/spec/integration/environments/default_manifest_spec.rb +16 -16
- data/spec/integration/environments/setting_hooks_spec.rb +1 -1
- data/spec/integration/test/test_helper_spec.rb +6 -2
- data/spec/integration/transaction_spec.rb +74 -0
- data/spec/integration/util/execution_spec.rb +8 -0
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +2 -2
- data/spec/lib/puppet_spec/module_tool/stub_source.rb +1 -1
- data/spec/lib/puppet_spec/unindent.rb +2 -2
- data/spec/unit/application/face_base_spec.rb +16 -0
- data/spec/unit/application/lookup_spec.rb +262 -227
- data/spec/unit/data_providers/{sample_data_provider_spec.rb → custom_data_provider_spec.rb} +14 -16
- data/spec/unit/data_providers/function_data_provider_spec.rb +2 -2
- data/spec/unit/data_providers/hiera_data_provider_spec.rb +60 -97
- data/spec/unit/defaults_spec.rb +1 -1
- data/spec/unit/face/ca_spec.rb +10 -0
- data/spec/unit/face/certificate_request_spec.rb +10 -0
- data/spec/unit/face/certificate_revocation_list_spec.rb +10 -0
- data/spec/unit/face/file_spec.rb +4 -0
- data/spec/unit/face/help_spec.rb +17 -0
- data/spec/unit/face/key_spec.rb +10 -0
- data/spec/unit/face/status_spec.rb +10 -0
- data/spec/unit/file_system_spec.rb +143 -6
- data/spec/unit/functions/binary_file_spec.rb +1 -1
- data/spec/unit/functions/hiera_spec.rb +257 -47
- data/spec/unit/functions/lookup_fixture_spec.rb +693 -0
- data/spec/unit/functions/lookup_spec.rb +1319 -608
- data/spec/unit/functions/new_spec.rb +3 -3
- data/spec/unit/graph/rb_tree_map_spec.rb +1 -1
- data/spec/unit/graph/simple_graph_spec.rb +1 -1
- data/spec/unit/hiera/scope_spec.rb +4 -4
- data/spec/unit/indirector/request_spec.rb +9 -0
- data/spec/unit/interface_spec.rb +27 -0
- data/spec/unit/man_spec.rb +1 -1
- data/spec/unit/module_spec.rb +1 -1
- data/spec/unit/module_tool/applications/builder_spec.rb +16 -1
- data/spec/unit/module_tool/applications/installer_spec.rb +1 -1
- data/spec/unit/module_tool/applications/upgrader_spec.rb +1 -1
- data/spec/unit/module_tool/installed_modules_spec.rb +6 -6
- data/spec/unit/module_tool_spec.rb +3 -3
- data/spec/unit/network/http/connection_spec.rb +10 -0
- data/spec/unit/network/http/webrick_spec.rb +1 -1
- data/spec/unit/pops/evaluator/access_ops_spec.rb +2 -2
- data/spec/unit/pops/evaluator/runtime3_converter_spec.rb +9 -9
- data/spec/unit/pops/loaders/environment_loader_spec.rb +172 -0
- data/spec/unit/pops/lookup/context_spec.rb +45 -16
- data/spec/unit/pops/lookup/interpolation_spec.rb +28 -20
- data/spec/unit/pops/lookup/lookup_spec.rb +197 -0
- data/spec/unit/pops/merge_strategy_spec.rb +18 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +16 -1
- data/spec/unit/pops/parser/parse_site_spec.rb +4 -0
- data/spec/unit/pops/serialization/packer_spec.rb +4 -23
- data/spec/unit/pops/serialization/serialization_spec.rb +32 -8
- data/spec/unit/pops/types/p_object_type_spec.rb +68 -3
- data/spec/unit/pops/types/p_sem_ver_type_spec.rb +4 -4
- data/spec/unit/pops/types/p_type_set_type_spec.rb +31 -2
- data/spec/unit/pops/types/type_acceptor_spec.rb +18 -17
- data/spec/unit/pops/types/type_calculator_spec.rb +39 -40
- data/spec/unit/pops/types/type_factory_spec.rb +3 -3
- data/spec/unit/pops/types/type_formatter_spec.rb +7 -3
- data/spec/unit/pops/types/type_mismatch_describer_spec.rb +13 -2
- data/spec/unit/pops/types/types_spec.rb +25 -2
- data/spec/unit/pops/validator/validator_spec.rb +60 -4
- data/spec/unit/provider/nameservice_spec.rb +42 -0
- data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +22 -0
- data/spec/unit/provider/package/pkgng_spec.rb +12 -0
- data/spec/unit/provider/package/rpm_spec.rb +8 -8
- data/spec/unit/provider/service/smf_spec.rb +13 -11
- data/spec/unit/provider/service/systemd_spec.rb +8 -1
- data/spec/unit/provider/user/useradd_spec.rb +1 -0
- data/spec/unit/puppet_spec.rb +14 -0
- data/spec/unit/resource/catalog_spec.rb +15 -9
- data/spec/unit/resource_spec.rb +20 -17
- data/spec/unit/semver_spec.rb +14 -0
- data/spec/unit/ssl/certificate_authority_spec.rb +12 -1
- data/spec/unit/transaction/additional_resource_generator_spec.rb +11 -0
- data/spec/unit/type/user_spec.rb +32 -6
- data/spec/unit/util/filetype_spec.rb +3 -3
- data/spec/unit/util/yaml_spec.rb +1 -1
- data/spec/unit/util_spec.rb +10 -2
- data/tasks/i18n.rake +20 -0
- metadata +2661 -2607
- data/lib/puppet/data_providers/lookup_adapter.rb +0 -254
- data/lib/puppet/vendor/load_semantic.rb +0 -1
- data/lib/puppet/vendor/semantic/Gemfile +0 -20
- data/lib/puppet/vendor/semantic/PUPPET_README.md +0 -6
- data/lib/puppet/vendor/semantic/Rakefile +0 -69
- data/lib/puppet/vendor/semantic/lib/semantic.rb +0 -7
- data/lib/puppet/vendor/semantic/lib/semantic/dependency/module_release.rb +0 -60
- data/lib/puppet/vendor/semantic/spec/spec_helper.rb +0 -24
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_node_spec.rb +0 -141
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/graph_spec.rb +0 -162
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/module_release_spec.rb +0 -143
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/source_spec.rb +0 -5
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency/unsatisfiable_graph_spec.rb +0 -44
- data/lib/puppet/vendor/semantic/spec/unit/semantic/dependency_spec.rb +0 -383
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_range_spec.rb +0 -307
- data/lib/puppet/vendor/semantic/spec/unit/semantic/version_spec.rb +0 -608
- data/spec/fixtures/unit/data_providers/environments/sample/manifests/site.pp +0 -6
@@ -1,4 +1,6 @@
|
|
1
|
+
# TODO: API 5.0, remove this module
|
1
2
|
# @api private
|
3
|
+
# @deprecated
|
2
4
|
module Puppet::Plugins::DataProviders
|
3
5
|
class Registry
|
4
6
|
def self.register_extensions(extensions)
|
@@ -38,47 +40,11 @@ module Puppet::Plugins::DataProviders
|
|
38
40
|
to_instance(ENV_DATA_PROVIDERS_TYPE)
|
39
41
|
end
|
40
42
|
|
41
|
-
default_bindings.bind do
|
42
|
-
name('function')
|
43
|
-
in_multibind(ENV_DATA_PROVIDERS_KEY)
|
44
|
-
to_instance('Puppet::DataProviders::FunctionEnvDataProvider')
|
45
|
-
end
|
46
|
-
|
47
|
-
default_bindings.bind do
|
48
|
-
name('hiera')
|
49
|
-
in_multibind(ENV_DATA_PROVIDERS_KEY)
|
50
|
-
to_instance('Puppet::DataProviders::HieraEnvDataProvider')
|
51
|
-
end
|
52
|
-
|
53
43
|
default_bindings.bind do
|
54
44
|
name('none')
|
55
45
|
in_multibind(MODULE_DATA_PROVIDERS_KEY)
|
56
46
|
to_instance(MODULE_DATA_PROVIDERS_TYPE)
|
57
47
|
end
|
58
|
-
|
59
|
-
default_bindings.bind do
|
60
|
-
name('function')
|
61
|
-
in_multibind(MODULE_DATA_PROVIDERS_KEY)
|
62
|
-
to_instance('Puppet::DataProviders::FunctionModuleDataProvider')
|
63
|
-
end
|
64
|
-
|
65
|
-
default_bindings.bind do
|
66
|
-
name('hiera')
|
67
|
-
in_multibind(MODULE_DATA_PROVIDERS_KEY)
|
68
|
-
to_instance('Puppet::DataProviders::HieraModuleDataProvider')
|
69
|
-
end
|
70
|
-
|
71
|
-
default_bindings.bind do
|
72
|
-
name('json')
|
73
|
-
in_multibind(PATH_BASED_DATA_PROVIDER_FACTORIES_KEY)
|
74
|
-
to_instance('Puppet::DataProviders::JsonDataProviderFactory')
|
75
|
-
end
|
76
|
-
|
77
|
-
default_bindings.bind do
|
78
|
-
name('yaml')
|
79
|
-
in_multibind(PATH_BASED_DATA_PROVIDER_FACTORIES_KEY)
|
80
|
-
to_instance('Puppet::DataProviders::YamlDataProviderFactory')
|
81
|
-
end
|
82
48
|
end
|
83
49
|
end
|
84
50
|
end
|
data/lib/puppet/pops.rb
CHANGED
@@ -10,11 +10,14 @@ module Puppet
|
|
10
10
|
#
|
11
11
|
# @api public
|
12
12
|
module Pops
|
13
|
-
|
13
|
+
EMPTY_HASH = {}.freeze
|
14
14
|
EMPTY_ARRAY = [].freeze
|
15
15
|
EMPTY_STRING = ''.freeze
|
16
16
|
|
17
|
-
|
17
|
+
DOUBLE_COLON = '::'.freeze
|
18
|
+
USCORE = '_'.freeze
|
19
|
+
|
20
|
+
require 'semantic_puppet'
|
18
21
|
|
19
22
|
require 'puppet/pops/patterns'
|
20
23
|
require 'puppet/pops/utils'
|
@@ -33,12 +36,6 @@ module Puppet
|
|
33
36
|
require 'puppet/pops/label_provider'
|
34
37
|
require 'puppet/pops/validation'
|
35
38
|
require 'puppet/pops/issue_reporter'
|
36
|
-
require 'puppet/pops/lookup'
|
37
|
-
require 'puppet/pops/lookup/interpolation'
|
38
|
-
require 'puppet/pops/lookup/invocation'
|
39
|
-
require 'puppet/pops/lookup/sub_lookup'
|
40
|
-
require 'puppet/pops/lookup/explainer'
|
41
|
-
|
42
39
|
require 'puppet/pops/model/model'
|
43
40
|
|
44
41
|
require 'puppet/pops/time/timespan'
|
@@ -47,7 +44,7 @@ module Puppet
|
|
47
44
|
# (the Types module initializes itself)
|
48
45
|
require 'puppet/pops/types/types'
|
49
46
|
require 'puppet/pops/types/string_converter'
|
50
|
-
require 'puppet/pops/lookup
|
47
|
+
require 'puppet/pops/lookup'
|
51
48
|
|
52
49
|
require 'puppet/pops/merge_strategy'
|
53
50
|
|
@@ -176,9 +176,6 @@ module Adaptable
|
|
176
176
|
adapter
|
177
177
|
end
|
178
178
|
|
179
|
-
DOUBLE_COLON = '::'
|
180
|
-
USCORE = '_'
|
181
|
-
|
182
179
|
# Returns a suitable instance variable name given a class name.
|
183
180
|
# The returned string is the fully qualified name of a class with '::' replaced by '_' since
|
184
181
|
# '::' is not allowed in an instance variable name.
|
@@ -722,7 +722,7 @@ module Producers
|
|
722
722
|
end
|
723
723
|
|
724
724
|
if uniq || flatten || conflict_resolution.to_s == 'append'
|
725
|
-
etype = binding.type.
|
725
|
+
etype = binding.type.value_type
|
726
726
|
unless etype.class == Types::PDataType || etype.is_a?(Types::PArrayType)
|
727
727
|
detail = []
|
728
728
|
detail << ":uniq" if uniq
|
@@ -818,10 +818,10 @@ module Producers
|
|
818
818
|
raise ArgumentError, "Entry contributing to multibind hash with id '#{binding.id}' must have a name."
|
819
819
|
end
|
820
820
|
|
821
|
-
unless tc.instance?(binding.type.
|
821
|
+
unless tc.instance?(binding.type.value_type, value)
|
822
822
|
raise ArgumentError, ["Type Error: value contribution to #{binding.name}['#{key}'] ",
|
823
823
|
"is incompatible, ",
|
824
|
-
type_error_detail(binding.type.
|
824
|
+
type_error_detail(binding.type.value_type, value)].join()
|
825
825
|
end
|
826
826
|
end
|
827
827
|
end
|
@@ -158,7 +158,7 @@ class AccessOperator
|
|
158
158
|
|
159
159
|
def access_PSemVerType(o, scope, keys)
|
160
160
|
keys.flatten!
|
161
|
-
assert_keys(keys, o, 1, Float::INFINITY, String,
|
161
|
+
assert_keys(keys, o, 1, Float::INFINITY, String, SemanticPuppet::VersionRange)
|
162
162
|
Types::TypeFactory.sem_ver(*keys)
|
163
163
|
end
|
164
164
|
|
@@ -284,7 +284,7 @@ class AccessOperator
|
|
284
284
|
type = keys[0]
|
285
285
|
unless type.is_a?(Types::PAnyType)
|
286
286
|
if type.is_a?(String)
|
287
|
-
type = Types::TypeFactory.string(
|
287
|
+
type = Types::TypeFactory.string(type)
|
288
288
|
else
|
289
289
|
fail(Issues::BAD_TYPE_SLICE_TYPE, @semantic.keys[0], {:base_type => 'Optional-Type', :actual => type.class})
|
290
290
|
end
|
@@ -335,7 +335,7 @@ class AccessOperator
|
|
335
335
|
type = keys[0]
|
336
336
|
case type
|
337
337
|
when String
|
338
|
-
type = Types::TypeFactory.string(
|
338
|
+
type = Types::TypeFactory.string(type)
|
339
339
|
when Types::PAnyType
|
340
340
|
type = nil if type.class == Types::PAnyType
|
341
341
|
else
|
@@ -460,7 +460,7 @@ class AccessOperator
|
|
460
460
|
fail(Issues::BAD_TYPE_SLICE_ARITY, @semantic,
|
461
461
|
{:base_type => 'Collection-Type', :min => 1, :max => 2, :actual => keys.size})
|
462
462
|
end
|
463
|
-
Types::PCollectionType.new(
|
463
|
+
Types::PCollectionType.new(size_t)
|
464
464
|
end
|
465
465
|
|
466
466
|
# An Array can create a new Array type. It is not possible to create a collection of Array types.
|
@@ -311,7 +311,7 @@ class Closure < CallableSignature
|
|
311
311
|
|
312
312
|
parameters.each do |param|
|
313
313
|
arg_type, param_range = create_param_type(param, closure_scope)
|
314
|
-
key_type = type_factory.string(
|
314
|
+
key_type = type_factory.string(param.name.to_s)
|
315
315
|
key_type = type_factory.optional(key_type) unless param.value.nil?
|
316
316
|
members[key_type] = arg_type
|
317
317
|
end
|
@@ -103,7 +103,7 @@ class CompareOperator
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def cmp_Version(a, b)
|
106
|
-
raise ArgumentError.new('Versions not comparable to non Versions') unless b.is_a?(
|
106
|
+
raise ArgumentError.new('Versions not comparable to non Versions') unless b.is_a?(SemanticPuppet::Version)
|
107
107
|
a <=> b
|
108
108
|
end
|
109
109
|
|
@@ -172,7 +172,7 @@ class CompareOperator
|
|
172
172
|
# Always set match data, a "not found" should not keep old match data visible
|
173
173
|
set_match_data(matched, scope) # creates ephemeral
|
174
174
|
return !!matched
|
175
|
-
when String,
|
175
|
+
when String, SemanticPuppet::Version
|
176
176
|
a.any? { |element| match(b, element, scope) }
|
177
177
|
when Types::PAnyType
|
178
178
|
a.each {|element| return true if b.instance?(element) }
|
@@ -206,11 +206,11 @@ class CompareOperator
|
|
206
206
|
|
207
207
|
# Matches against semvers and strings
|
208
208
|
def match_Version(version, left, scope)
|
209
|
-
if left.is_a?(
|
209
|
+
if left.is_a?(SemanticPuppet::Version)
|
210
210
|
version == left
|
211
211
|
elsif left.is_a? String
|
212
212
|
begin
|
213
|
-
version ==
|
213
|
+
version == SemanticPuppet::Version.parse(left)
|
214
214
|
rescue ArgumentError
|
215
215
|
false
|
216
216
|
end
|
@@ -570,7 +570,7 @@ class EvaluatorImpl
|
|
570
570
|
return o.operator == :'=~' ? !!matched : !matched
|
571
571
|
end
|
572
572
|
|
573
|
-
if pattern.is_a?(
|
573
|
+
if pattern.is_a?(SemanticPuppet::VersionRange)
|
574
574
|
# evaluate if range includes version
|
575
575
|
matched = Types::PSemVerRangeType.include?(pattern, left)
|
576
576
|
return o.operator == :'=~' ? matched : !matched
|
data/lib/puppet/pops/issues.rb
CHANGED
@@ -619,6 +619,10 @@ module Issues
|
|
619
619
|
"The key '#{key}' is declared more than once"
|
620
620
|
end
|
621
621
|
|
622
|
+
DUPLICATE_DEFAULT = issue :DUPLICATE_DEFAULT, :container do
|
623
|
+
"This #{label.label(container)} already has a 'default' entry - this is a duplicate"
|
624
|
+
end
|
625
|
+
|
622
626
|
RESERVED_PARAMETER = hard_issue :RESERVED_PARAMETER, :container, :param_name do
|
623
627
|
"The parameter $#{param_name} redefines a built in parameter in #{label.the(container)}"
|
624
628
|
end
|
@@ -40,6 +40,20 @@ module Puppet::Pops::LabelProvider
|
|
40
40
|
count == 1 ? text : "#{text}s"
|
41
41
|
end
|
42
42
|
|
43
|
+
# Combines several strings using commas and a final conjunction
|
44
|
+
def combine_strings(strings, conjunction = 'or')
|
45
|
+
case strings.size
|
46
|
+
when 0
|
47
|
+
''
|
48
|
+
when 1
|
49
|
+
strings[0]
|
50
|
+
when 2
|
51
|
+
"#{strings[0]} #{conjunction} #{strings[1]}"
|
52
|
+
else
|
53
|
+
"#{strings[0...-1].join(', ')}, #{conjunction} #{strings.last}"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
43
57
|
# Produces an *indefinite article* (a/an) for the given text ('a' if
|
44
58
|
# it starts with a vowel) This is obviously flawed in the general
|
45
59
|
# sense as may labels have punctuation at the start and this method
|
@@ -109,7 +109,9 @@ module Puppet::Pops::Loader::LoaderPaths
|
|
109
109
|
def effective_path(typed_name, start_index_in_name)
|
110
110
|
# Puppet name to path always skips the name-space as that is part of the generic path
|
111
111
|
# i.e. <module>/mymodule/functions/foo.pp is the function mymodule::foo
|
112
|
-
|
112
|
+
parts = typed_name.name_parts
|
113
|
+
parts = parts[start_index_in_name..-1] if parts.size > 1
|
114
|
+
"#{File.join(generic_path, parts)}.pp"
|
113
115
|
end
|
114
116
|
end
|
115
117
|
|
@@ -21,6 +21,8 @@ module Loader
|
|
21
21
|
# @api private
|
22
22
|
#
|
23
23
|
module ModuleLoaders
|
24
|
+
ENVIRONMENT = 'environment'.freeze
|
25
|
+
|
24
26
|
def self.system_loader_from(parent_loader, loaders)
|
25
27
|
# Puppet system may be installed in a fixed location via RPM, installed as a Gem, via source etc.
|
26
28
|
# The only way to find this across the different ways puppet can be installed is
|
@@ -37,6 +39,15 @@ module ModuleLoaders
|
|
37
39
|
)
|
38
40
|
end
|
39
41
|
|
42
|
+
def self.environment_loader_from(parent_loader, loaders, env_path)
|
43
|
+
ModuleLoaders::FileBased.new(parent_loader,
|
44
|
+
loaders,
|
45
|
+
ENVIRONMENT,
|
46
|
+
File.join(env_path, 'lib'),
|
47
|
+
ENVIRONMENT
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
40
51
|
def self.module_loader_from(parent_loader, loaders, module_name, module_path)
|
41
52
|
ModuleLoaders::FileBased.new(parent_loader,
|
42
53
|
loaders,
|
@@ -107,7 +118,6 @@ module ModuleLoaders
|
|
107
118
|
return nil unless typed_name.name_authority == Pcore::RUNTIME_NAME_AUTHORITY
|
108
119
|
|
109
120
|
# Assume it is a global name, and that all parts of the name should be used when looking up
|
110
|
-
name_part_index = 0
|
111
121
|
name_parts = typed_name.name_parts
|
112
122
|
|
113
123
|
# Certain types and names can be disqualified up front
|
@@ -119,10 +129,6 @@ module ModuleLoaders
|
|
119
129
|
# ok since such a "module" cannot have namespaced content).
|
120
130
|
#
|
121
131
|
return nil unless name_parts[0] == module_name
|
122
|
-
|
123
|
-
# Skip the first part of the name when computing the path since the path already contains the name of the
|
124
|
-
# module
|
125
|
-
name_part_index = 1
|
126
132
|
else
|
127
133
|
# The name is in the global name space.
|
128
134
|
|
@@ -144,7 +150,7 @@ module ModuleLoaders
|
|
144
150
|
# Find the file to instantiate, and instantiate the entity if file is found
|
145
151
|
origin = nil
|
146
152
|
if (smart_path = smart_paths.effective_paths(typed_name.type).find do |sp|
|
147
|
-
origin = sp.effective_path(typed_name,
|
153
|
+
origin = sp.effective_path(typed_name, global? ? 0 : 1)
|
148
154
|
existing_path(origin)
|
149
155
|
end)
|
150
156
|
value = smart_path.instantiator.create(self, typed_name, origin, get_contents(origin))
|
@@ -200,12 +206,20 @@ module ModuleLoaders
|
|
200
206
|
raise NotImplementedError.new
|
201
207
|
end
|
202
208
|
|
209
|
+
# Answers the question if this loader represents a global component (true for resource type loader and environment loader)
|
210
|
+
#
|
211
|
+
# @return [Boolean] `true` if this loader represents a global component
|
212
|
+
#
|
213
|
+
def global?
|
214
|
+
module_name.nil? || module_name == ENVIRONMENT
|
215
|
+
end
|
216
|
+
|
203
217
|
# Produces the private loader for the module. If this module is not already resolved, this will trigger resolution
|
204
218
|
#
|
205
219
|
def private_loader
|
206
220
|
# The system loader has a nil module_name and it does not have a private_loader as there are no functions
|
207
221
|
# that can only by called by puppet runtime - if so, it acts as the private loader directly.
|
208
|
-
@private_loader ||= (
|
222
|
+
@private_loader ||= (global? ? self : @loaders.private_loader_for_module(module_name))
|
209
223
|
end
|
210
224
|
end
|
211
225
|
|
data/lib/puppet/pops/loaders.rb
CHANGED
@@ -17,16 +17,16 @@ class Loaders
|
|
17
17
|
attr_reader :private_environment_loader
|
18
18
|
attr_reader :implementation_registry
|
19
19
|
|
20
|
-
def self.new(environment)
|
20
|
+
def self.new(environment, for_agent = false)
|
21
21
|
obj = environment.loaders
|
22
22
|
if obj.nil?
|
23
23
|
obj = self.allocate
|
24
|
-
obj.send(:initialize, environment)
|
24
|
+
obj.send(:initialize, environment, for_agent)
|
25
25
|
end
|
26
26
|
obj
|
27
27
|
end
|
28
28
|
|
29
|
-
def initialize(environment)
|
29
|
+
def initialize(environment, for_agent)
|
30
30
|
# Protect against environment havoc
|
31
31
|
raise ArgumentError.new("Attempt to redefine already initialized loaders for environment") unless environment.loaders.nil?
|
32
32
|
environment.loaders = self
|
@@ -47,12 +47,16 @@ class Loaders
|
|
47
47
|
# concept of environment the same way as when running as a master (except when doing apply).
|
48
48
|
# The creation mechanisms should probably differ between the two.
|
49
49
|
#
|
50
|
-
@private_environment_loader =
|
50
|
+
@private_environment_loader = if for_agent
|
51
|
+
add_loader_by_name(Loader::SimpleEnvironmentLoader.new(@puppet_system_loader, 'agent environment'))
|
52
|
+
else
|
53
|
+
create_environment_loader(environment)
|
54
|
+
end
|
51
55
|
|
52
56
|
# 3. The implementation registry maintains mappings between Puppet types and Runtime types for
|
53
57
|
# the current environment
|
54
58
|
@implementation_registry = Types::ImplementationRegistry.new(@private_environment_loader)
|
55
|
-
Pcore.init(@puppet_system_loader, @implementation_registry)
|
59
|
+
Pcore.init(@puppet_system_loader, @implementation_registry, for_agent)
|
56
60
|
|
57
61
|
# 4. module loaders are set up from the create_environment_loader, they register themselves
|
58
62
|
end
|
@@ -106,15 +110,30 @@ class Loaders
|
|
106
110
|
# @api private
|
107
111
|
def self.register_runtime3_type(name, origin)
|
108
112
|
loaders = Puppet.lookup(:loaders) { nil }
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
113
|
+
return nil if loaders.nil?
|
114
|
+
|
115
|
+
rt3_loader = loaders.runtime3_type_loader
|
116
|
+
return nil if rt3_loader.nil?
|
117
|
+
|
118
|
+
name = name.to_s
|
119
|
+
caps_name = Types::TypeFormatter.singleton.capitalize_segments(name)
|
120
|
+
typed_name = Loader::TypedName.new(:type, name.downcase)
|
121
|
+
rt3_loader.set_entry(typed_name, Types::PResourceType.new(caps_name), origin)
|
115
122
|
nil
|
116
123
|
end
|
117
124
|
|
125
|
+
# Finds a loader to use when deserializing a catalog and then subsequenlty use user
|
126
|
+
# defined types found in that catalog.
|
127
|
+
#
|
128
|
+
def self.catalog_loader
|
129
|
+
loaders = Puppet.lookup(:loaders) { nil }
|
130
|
+
if loaders.nil?
|
131
|
+
loaders = Loaders.new(Puppet.lookup(:current_environment), true)
|
132
|
+
Puppet.push_context(:loaders => loaders)
|
133
|
+
end
|
134
|
+
loaders.find_loader(nil)
|
135
|
+
end
|
136
|
+
|
118
137
|
# Finds the `Loaders` instance by looking up the :loaders in the global Puppet context
|
119
138
|
#
|
120
139
|
# @return [Loaders] the loaders instance
|
@@ -241,7 +260,7 @@ class Loaders
|
|
241
260
|
loader = add_loader_by_name(Loader::SimpleEnvironmentLoader.new(@runtime3_type_loader, loader_name))
|
242
261
|
else
|
243
262
|
# View the environment as a module to allow loading from it - this module is always called 'environment'
|
244
|
-
loader = Loader::ModuleLoaders.
|
263
|
+
loader = Loader::ModuleLoaders.environment_loader_from(@runtime3_type_loader, self, env_path)
|
245
264
|
end
|
246
265
|
|
247
266
|
# An environment has a module path even if it has a null loader
|
data/lib/puppet/pops/lookup.rb
CHANGED
@@ -20,7 +20,6 @@ module Lookup
|
|
20
20
|
# @return [Object] The found value
|
21
21
|
#
|
22
22
|
def self.lookup(name, value_type, default_value, has_default, merge, lookup_invocation)
|
23
|
-
value_type = Types::PDataType::DEFAULT if value_type.nil?
|
24
23
|
names = name.is_a?(Array) ? name : [name]
|
25
24
|
|
26
25
|
# find first name that yields a non-nil result and wrap it in a two element array
|
@@ -74,11 +73,11 @@ module Lookup
|
|
74
73
|
|
75
74
|
# @api private
|
76
75
|
def self.search_and_merge(name, lookup_invocation, merge)
|
77
|
-
|
76
|
+
lookup_invocation.lookup_adapter.lookup(name, lookup_invocation, merge)
|
78
77
|
end
|
79
78
|
|
80
79
|
def self.assert_type(subject, type, value)
|
81
|
-
Types::TypeAsserter.assert_instance_of(subject, type, value)
|
80
|
+
type ? Types::TypeAsserter.assert_instance_of(subject, type, value) : value
|
82
81
|
end
|
83
82
|
private_class_method :assert_type
|
84
83
|
|
@@ -89,3 +88,5 @@ module Lookup
|
|
89
88
|
private_class_method :fail_lookup
|
90
89
|
end
|
91
90
|
end
|
91
|
+
|
92
|
+
require_relative 'lookup/lookup_adapter'
|