puppet 4.4.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CONTRIBUTING.md +5 -5
- data/Gemfile +2 -2
- data/LICENSE +2 -2
- data/README.md +5 -0
- data/conf/puppet.conf +1 -1
- data/ext/project_data.yaml +2 -0
- data/ext/redhat/puppet.spec.erb +0 -9
- data/ext/upload_facts.rb +1 -1
- data/lib/hiera_puppet.rb +6 -14
- data/lib/puppet/application/agent.rb +3 -4
- data/lib/puppet/application/apply.rb +1 -1
- data/lib/puppet/application/ca.rb +1 -0
- data/lib/puppet/application/cert.rb +1 -1
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +2 -2
- data/lib/puppet/application/lookup.rb +8 -20
- data/lib/puppet/application/master.rb +1 -1
- data/lib/puppet/application/resource.rb +1 -5
- data/lib/puppet/data_providers/hiera_config.rb +2 -4
- data/lib/puppet/data_providers/hiera_interpolate.rb +12 -105
- data/lib/puppet/data_providers/json_data_provider_factory.rb +1 -8
- data/lib/puppet/data_providers/yaml_data_provider_factory.rb +2 -8
- data/lib/puppet/defaults.rb +104 -25
- data/lib/puppet/face/config.rb +1 -1
- data/lib/puppet/face/help/man.erb +1 -1
- data/lib/puppet/file_system/uniquefile.rb +2 -2
- data/lib/puppet/file_system/windows.rb +1 -15
- data/lib/puppet/functions/assert_type.rb +1 -1
- data/lib/puppet/functions/dig.rb +39 -0
- data/lib/puppet/functions/hiera_include.rb +2 -2
- data/lib/puppet/functions/inline_epp.rb +1 -1
- data/lib/puppet/functions/lest.rb +53 -0
- data/lib/puppet/functions/lookup.rb +40 -30
- data/lib/puppet/functions/new.rb +502 -0
- data/lib/puppet/functions/regsubst.rb +11 -10
- data/lib/puppet/functions/then.rb +74 -0
- data/lib/puppet/functions/type.rb +4 -4
- data/lib/puppet/functions/with.rb +1 -1
- data/lib/puppet/functions.rb +69 -0
- data/lib/puppet/indirector/catalog/compiler.rb +4 -1
- data/lib/puppet/indirector/msgpack.rb +1 -1
- data/lib/puppet/indirector/resource_type/parser.rb +5 -0
- data/lib/puppet/indirector/rest.rb +5 -1
- data/lib/puppet/indirector/terminus.rb +4 -4
- data/lib/puppet/loaders.rb +2 -0
- data/lib/puppet/metatype/manager.rb +19 -2
- data/lib/puppet/module.rb +3 -3
- data/lib/puppet/module_tool/applications/application.rb +1 -1
- data/lib/puppet/module_tool/applications/builder.rb +2 -2
- data/lib/puppet/module_tool/skeleton/templates/generator/Gemfile +6 -2
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +19 -4
- data/lib/puppet/module_tool/skeleton/templates/generator/{tests → examples}/init.pp.erb +1 -1
- data/lib/puppet/module_tool/skeleton/templates/generator/spec/classes/init_spec.rb.erb +0 -1
- data/lib/puppet/network/auth_config_parser.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +0 -2
- data/lib/puppet/network/http/api/master/v3/environment.rb +6 -2
- data/lib/puppet/network/http/rack/rest.rb +10 -1
- data/lib/puppet/parser/ast/pops_bridge.rb +20 -3
- data/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb +24 -2
- data/lib/puppet/parser/e4_parser_adapter.rb +13 -12
- data/lib/puppet/parser/environment_compiler.rb +2 -2
- data/lib/puppet/parser/functions/hiera_include.rb +2 -2
- data/lib/puppet/parser/functions/inline_epp.rb +1 -1
- data/lib/puppet/parser/functions/lookup.rb +0 -3
- data/lib/puppet/parser/resource.rb +14 -5
- data/lib/puppet/parser/scope.rb +18 -15
- data/lib/puppet/plugins/data_providers/data_provider.rb +19 -8
- data/lib/puppet/pops/adapters.rb +5 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +77 -15
- data/lib/puppet/pops/evaluator/closure.rb +10 -5
- data/lib/puppet/pops/evaluator/compare_operator.rb +34 -4
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +75 -22
- data/lib/puppet/pops/evaluator/literal_evaluator.rb +7 -6
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +13 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +14 -4
- data/lib/puppet/pops/functions/dispatcher.rb +1 -1
- data/lib/puppet/pops/issues.rb +18 -2
- data/lib/puppet/pops/loader/base_loader.rb +48 -7
- data/lib/puppet/pops/loader/dependency_loader.rb +27 -2
- data/lib/puppet/pops/loader/loader.rb +12 -0
- data/lib/puppet/pops/loader/predefined_loader.rb +29 -0
- data/lib/puppet/pops/loader/runtime3_type_loader.rb +57 -0
- data/lib/puppet/pops/loader/static_loader.rb +92 -5
- data/lib/puppet/pops/loader/type_definition_instantiator.rb +25 -3
- data/lib/puppet/pops/loaders.rb +84 -14
- data/lib/puppet/pops/lookup/explainer.rb +38 -1
- data/lib/puppet/pops/lookup/interpolation.rb +115 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +86 -0
- data/lib/puppet/pops/merge_strategy.rb +0 -10
- data/lib/puppet/pops/model/ast_transformer.rb +8 -1
- data/lib/puppet/pops/model/factory.rb +31 -8
- data/lib/puppet/pops/model/model.rb +8 -0
- data/lib/puppet/pops/model/model_label_provider.rb +1 -0
- data/lib/puppet/pops/model/model_meta.rb +7 -1
- data/lib/puppet/pops/model/model_tree_dumper.rb +4 -0
- data/lib/puppet/pops/parser/egrammar.ra +24 -7
- data/lib/puppet/pops/parser/eparser.rb +863 -798
- data/lib/puppet/pops/parser/evaluating_parser.rb +4 -0
- data/lib/puppet/pops/parser/locator.rb +8 -4
- data/lib/puppet/pops/pcore.rb +30 -0
- data/lib/puppet/pops/types/class_loader.rb +2 -4
- data/lib/puppet/pops/types/implementation_registry.rb +146 -0
- data/lib/puppet/pops/types/iterable.rb +4 -4
- data/lib/puppet/pops/types/p_object_type.rb +846 -0
- data/lib/puppet/pops/types/p_runtime_type.rb +102 -0
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +164 -0
- data/lib/puppet/pops/types/p_sem_ver_type.rb +113 -0
- data/lib/puppet/pops/types/puppet_object.rb +21 -0
- data/lib/puppet/pops/types/recursion_guard.rb +10 -0
- data/lib/puppet/pops/types/ruby_generator.rb +258 -0
- data/lib/puppet/pops/types/string_converter.rb +922 -0
- data/lib/puppet/pops/types/type_asserter.rb +2 -2
- data/lib/puppet/pops/types/type_calculator.rb +30 -6
- data/lib/puppet/pops/types/type_conversion_error.rb +15 -0
- data/lib/puppet/pops/types/type_factory.rb +49 -16
- data/lib/puppet/pops/types/type_formatter.rb +341 -106
- data/lib/puppet/pops/types/type_mismatch_describer.rb +132 -41
- data/lib/puppet/pops/types/type_parser.rb +205 -197
- data/lib/puppet/pops/types/types.rb +722 -202
- data/lib/puppet/pops/validation/checker4_0.rb +66 -4
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -0
- data/lib/puppet/pops/validation.rb +1 -1
- data/lib/puppet/pops/visitor.rb +3 -1
- data/lib/puppet/pops.rb +6 -0
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/provider/augeas/augeas.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +64 -20
- data/lib/puppet/provider/package/pip3.rb +2 -0
- data/lib/puppet/provider/package/puppet_gem.rb +0 -0
- data/lib/puppet/provider/package/rpm.rb +112 -0
- data/lib/puppet/provider/package/yum.rb +7 -68
- data/lib/puppet/provider/service/daemontools.rb +3 -3
- data/lib/puppet/provider/service/init.rb +4 -2
- data/lib/puppet/provider/service/runit.rb +3 -3
- data/lib/puppet/provider/service/smf.rb +6 -3
- data/lib/puppet/provider/service/systemd.rb +59 -73
- data/lib/puppet/provider/user/user_role_add.rb +3 -1
- data/lib/puppet/reference/providers.rb +2 -3
- data/lib/puppet/resource/catalog.rb +34 -30
- data/lib/puppet/resource/type_collection.rb +23 -8
- data/lib/puppet/resource.rb +54 -37
- data/lib/puppet/settings/base_setting.rb +9 -3
- data/lib/puppet/settings/symbolic_enum_setting.rb +17 -0
- data/lib/puppet/settings.rb +5 -3
- data/lib/puppet/ssl/oids.rb +24 -2
- data/lib/puppet/test/test_helper.rb +0 -1
- data/lib/puppet/transaction.rb +0 -24
- data/lib/puppet/type/exec.rb +17 -17
- data/lib/puppet/type/file/content.rb +8 -8
- data/lib/puppet/type/file/ensure.rb +4 -4
- data/lib/puppet/type/file/source.rb +4 -4
- data/lib/puppet/type/file/target.rb +2 -2
- data/lib/puppet/type/file.rb +15 -5
- data/lib/puppet/type/filebucket.rb +1 -1
- data/lib/puppet/type/mount.rb +18 -1
- data/lib/puppet/type/package.rb +3 -3
- data/lib/puppet/type/schedule.rb +5 -5
- data/lib/puppet/type/service.rb +15 -0
- data/lib/puppet/type/sshkey.rb +5 -3
- data/lib/puppet/type/stage.rb +1 -1
- data/lib/puppet/type/tidy.rb +3 -3
- data/lib/puppet/type/zone.rb +5 -5
- data/lib/puppet/type.rb +13 -7
- data/lib/puppet/util/feature.rb +1 -1
- data/lib/puppet/util/monkey_patches.rb +18 -5
- data/lib/puppet/util/network_device/cisco/device.rb +16 -6
- data/lib/puppet/util/network_device/cisco/interface.rb +5 -6
- data/lib/puppet/util/plist.rb +3 -3
- data/lib/puppet/util/windows/file.rb +40 -10
- data/lib/puppet/util/windows.rb +1 -0
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/unit/application/environments/production/data/common.yaml +13 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/data1/third_utf8.json +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/data1/utf8.yaml +3 -0
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/hiera.yaml +5 -1
- data/spec/fixtures/unit/data_providers/environments/hiera_env_config/manifests/site.pp +2 -2
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb +2 -1
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/manifests/init.pp +2 -1
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_json/data/empty_key.json +1 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_json/hiera.yaml +5 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_json/manifests/init.pp +2 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_json/metadata.json +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_yaml/data/empty_key.yaml +1 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_yaml/hiera.yaml +5 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_yaml/manifests/init.pp +2 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_key_yaml/metadata.json +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/empty_yaml/data/empty.yaml +1 -0
- data/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp +0 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/usee/lib/puppet/type/usee_type.rb +5 -0
- data/spec/fixtures/unit/pops/loaders/loaders/dependent_modules_with_metadata/modules/user/manifests/init.pp +6 -0
- data/spec/fixtures/unit/pops/parser/lexer/subclass_name_duplication.pp +0 -0
- data/spec/fixtures/unit/provider/service/smf/svcs.out +4 -3
- data/spec/integration/agent/logging_spec.rb +0 -0
- data/spec/integration/application/apply_spec.rb +0 -0
- data/spec/integration/application/doc_spec.rb +0 -0
- data/spec/integration/configurer_spec.rb +0 -0
- data/spec/integration/data_binding_spec.rb +0 -34
- data/spec/integration/defaults_spec.rb +0 -0
- data/spec/integration/faces/ca_spec.rb +0 -0
- data/spec/integration/faces/documentation_spec.rb +0 -0
- data/spec/integration/file_serving/fileset_spec.rb +0 -0
- data/spec/integration/file_serving/terminus_helper_spec.rb +0 -0
- data/spec/integration/indirector/catalog/compiler_spec.rb +0 -0
- data/spec/integration/indirector/direct_file_server_spec.rb +0 -0
- data/spec/integration/indirector/file_content/file_server_spec.rb +0 -0
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +0 -0
- data/spec/integration/indirector/node/ldap_spec.rb +0 -0
- data/spec/integration/module_tool/tar/mini_spec.rb +27 -27
- data/spec/integration/network/formats_spec.rb +0 -0
- data/spec/integration/node/environment_spec.rb +0 -0
- data/spec/integration/node/facts_spec.rb +0 -0
- data/spec/integration/node_spec.rb +0 -0
- data/spec/integration/parser/catalog_spec.rb +14 -2
- data/spec/integration/parser/collection_spec.rb +0 -0
- data/spec/integration/parser/compiler_spec.rb +94 -3
- data/spec/integration/parser/functions/require_spec.rb +0 -0
- data/spec/integration/parser/parameter_defaults_spec.rb +19 -1
- data/spec/integration/parser/resource_expressions_spec.rb +1 -1
- data/spec/integration/provider/mailalias/aliases_spec.rb +0 -0
- data/spec/integration/provider/mount_spec.rb +0 -0
- data/spec/integration/provider/service/init_spec.rb +0 -0
- data/spec/integration/provider/ssh_authorized_key_spec.rb +0 -0
- data/spec/integration/reference/providers_spec.rb +0 -0
- data/spec/integration/reports_spec.rb +0 -0
- data/spec/integration/resource/catalog_spec.rb +0 -0
- data/spec/integration/resource/type_collection_spec.rb +8 -0
- data/spec/integration/ssl/certificate_authority_spec.rb +0 -0
- data/spec/integration/ssl/certificate_request_spec.rb +0 -0
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +0 -0
- data/spec/integration/ssl/host_spec.rb +0 -0
- data/spec/integration/transaction/report_spec.rb +0 -0
- data/spec/integration/transaction_spec.rb +0 -0
- data/spec/integration/type/exec_spec.rb +0 -0
- data/spec/integration/type/file_spec.rb +0 -0
- data/spec/integration/type/package_spec.rb +0 -0
- data/spec/integration/type/tidy_spec.rb +0 -0
- data/spec/integration/type_spec.rb +0 -0
- data/spec/integration/util/autoload_spec.rb +0 -0
- data/spec/integration/util/rdoc/parser_spec.rb +0 -0
- data/spec/integration/util/settings_spec.rb +26 -0
- data/spec/integration/util/windows/registry_spec.rb +0 -0
- data/spec/integration/util/windows/security_spec.rb +0 -0
- data/spec/integration/util/windows/user_spec.rb +0 -0
- data/spec/integration/util_spec.rb +0 -0
- data/spec/lib/puppet/face/1.0.0/huzzah.rb +0 -0
- data/spec/lib/puppet/face/basetest.rb +0 -0
- data/spec/lib/puppet/face/huzzah.rb +0 -0
- data/spec/lib/puppet_spec/compiler.rb +11 -4
- data/spec/lib/puppet_spec/files.rb +0 -0
- data/spec/lib/puppet_spec/fixtures.rb +0 -0
- data/spec/lib/puppet_spec/verbose.rb +0 -0
- data/spec/shared_behaviours/all_parsedfile_providers.rb +0 -0
- data/spec/shared_behaviours/file_server_terminus.rb +0 -0
- data/spec/shared_behaviours/file_serving.rb +0 -0
- data/spec/shared_behaviours/memory_terminus.rb +0 -0
- data/spec/shared_behaviours/path_parameters.rb +0 -0
- data/spec/shared_behaviours/things_that_declare_options.rb +0 -0
- data/spec/shared_contexts/types_setup.rb +4 -0
- data/spec/spec_helper.rb +0 -0
- data/spec/unit/agent/locker_spec.rb +0 -0
- data/spec/unit/agent_spec.rb +0 -0
- data/spec/unit/application/agent_spec.rb +0 -0
- data/spec/unit/application/apply_spec.rb +0 -0
- data/spec/unit/application/cert_spec.rb +0 -0
- data/spec/unit/application/certificate_spec.rb +0 -0
- data/spec/unit/application/config_spec.rb +0 -0
- data/spec/unit/application/describe_spec.rb +0 -0
- data/spec/unit/application/device_spec.rb +0 -0
- data/spec/unit/application/doc_spec.rb +0 -0
- data/spec/unit/application/face_base_spec.rb +0 -0
- data/spec/unit/application/facts_spec.rb +0 -0
- data/spec/unit/application/filebucket_spec.rb +0 -0
- data/spec/unit/application/indirection_base_spec.rb +0 -0
- data/spec/unit/application/inspect_spec.rb +19 -8
- data/spec/unit/application/lookup_spec.rb +92 -10
- data/spec/unit/application/master_spec.rb +0 -0
- data/spec/unit/application/resource_spec.rb +0 -0
- data/spec/unit/application_spec.rb +0 -0
- data/spec/unit/appmgmt_spec.rb +44 -35
- data/spec/unit/capability_spec.rb +33 -53
- data/spec/unit/configurer/downloader_factory_spec.rb +0 -0
- data/spec/unit/configurer/downloader_spec.rb +0 -0
- data/spec/unit/configurer/fact_handler_spec.rb +0 -0
- data/spec/unit/configurer/plugin_handler_spec.rb +0 -0
- data/spec/unit/configurer_spec.rb +0 -0
- data/spec/unit/confine/exists_spec.rb +0 -0
- data/spec/unit/confine/false_spec.rb +0 -0
- data/spec/unit/confine/feature_spec.rb +0 -0
- data/spec/unit/confine/true_spec.rb +0 -0
- data/spec/unit/confine/variable_spec.rb +0 -0
- data/spec/unit/confine_collection_spec.rb +0 -0
- data/spec/unit/confine_spec.rb +0 -0
- data/spec/unit/confiner_spec.rb +0 -0
- data/spec/unit/daemon_spec.rb +0 -0
- data/spec/unit/data_providers/function_data_provider_spec.rb +19 -1
- data/spec/unit/data_providers/hiera_data_provider_spec.rb +2 -2
- data/spec/unit/defaults_spec.rb +18 -0
- data/spec/unit/external/pson_spec.rb +0 -0
- data/spec/unit/face/catalog_spec.rb +0 -0
- data/spec/unit/face/certificate_spec.rb +0 -0
- data/spec/unit/face/config_spec.rb +0 -0
- data/spec/unit/face/facts_spec.rb +0 -0
- data/spec/unit/face/file_spec.rb +0 -0
- data/spec/unit/face/help_spec.rb +0 -0
- data/spec/unit/face/node_spec.rb +0 -0
- data/spec/unit/face/plugin_spec.rb +0 -0
- data/spec/unit/face_spec.rb +0 -0
- data/spec/unit/file_bucket/dipper_spec.rb +0 -0
- data/spec/unit/file_bucket/file_spec.rb +0 -0
- data/spec/unit/file_serving/base_spec.rb +0 -0
- data/spec/unit/file_serving/configuration/parser_spec.rb +0 -0
- data/spec/unit/file_serving/configuration_spec.rb +0 -0
- data/spec/unit/file_serving/content_spec.rb +0 -0
- data/spec/unit/file_serving/fileset_spec.rb +0 -0
- data/spec/unit/file_serving/metadata_spec.rb +0 -0
- data/spec/unit/file_serving/mount/file_spec.rb +0 -0
- data/spec/unit/file_serving/mount/modules_spec.rb +0 -0
- data/spec/unit/file_serving/mount/pluginfacts_spec.rb +0 -0
- data/spec/unit/file_serving/mount/plugins_spec.rb +0 -0
- data/spec/unit/file_serving/mount_spec.rb +0 -0
- data/spec/unit/file_serving/terminus_helper_spec.rb +0 -0
- data/spec/unit/file_serving/terminus_selector_spec.rb +0 -0
- data/spec/unit/file_system/uniquefile_spec.rb +20 -0
- data/spec/unit/file_system_spec.rb +61 -0
- data/spec/unit/functions/assert_type_spec.rb +8 -0
- data/spec/unit/functions/defined_spec.rb +0 -0
- data/spec/unit/functions/dig_spec.rb +58 -0
- data/spec/unit/functions/hiera_spec.rb +0 -0
- data/spec/unit/functions/lest_spec.rb +34 -0
- data/spec/unit/functions/lookup_spec.rb +109 -3
- data/spec/unit/functions/new_spec.rb +543 -0
- data/spec/unit/functions/regsubst_spec.rb +8 -0
- data/spec/unit/functions/split_spec.rb +0 -0
- data/spec/unit/functions/then_spec.rb +40 -0
- data/spec/unit/functions/versioncmp_spec.rb +0 -0
- data/spec/unit/functions4_spec.rb +78 -10
- data/spec/unit/graph/relationship_graph_spec.rb +0 -0
- data/spec/unit/graph/simple_graph_spec.rb +0 -0
- data/spec/unit/hiera_puppet_spec.rb +49 -8
- data/spec/unit/indirector/catalog/compiler_spec.rb +7 -0
- data/spec/unit/indirector/catalog/json_spec.rb +0 -0
- data/spec/unit/indirector/catalog/msgpack_spec.rb +0 -0
- data/spec/unit/indirector/catalog/rest_spec.rb +0 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +0 -0
- data/spec/unit/indirector/catalog/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/catalog/yaml_spec.rb +0 -0
- data/spec/unit/indirector/certificate/ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate/file_spec.rb +0 -0
- data/spec/unit/indirector/certificate/rest_spec.rb +0 -0
- data/spec/unit/indirector/certificate_request/ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_request/file_spec.rb +0 -0
- data/spec/unit/indirector/certificate_request/rest_spec.rb +0 -0
- data/spec/unit/indirector/certificate_revocation_list/ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_revocation_list/file_spec.rb +0 -0
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +0 -0
- data/spec/unit/indirector/certificate_status/file_spec.rb +0 -0
- data/spec/unit/indirector/certificate_status/rest_spec.rb +0 -0
- data/spec/unit/indirector/code_spec.rb +0 -0
- data/spec/unit/indirector/direct_file_server_spec.rb +0 -0
- data/spec/unit/indirector/envelope_spec.rb +0 -0
- data/spec/unit/indirector/exec_spec.rb +0 -0
- data/spec/unit/indirector/face_spec.rb +0 -0
- data/spec/unit/indirector/facts/facter_spec.rb +0 -0
- data/spec/unit/indirector/facts/network_device_spec.rb +0 -0
- data/spec/unit/indirector/facts/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/facts/yaml_spec.rb +0 -0
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +0 -0
- data/spec/unit/indirector/file_bucket_file/rest_spec.rb +0 -0
- data/spec/unit/indirector/file_content/file_server_spec.rb +0 -0
- data/spec/unit/indirector/file_content/file_spec.rb +0 -0
- data/spec/unit/indirector/file_content/rest_spec.rb +0 -0
- data/spec/unit/indirector/file_metadata/file_server_spec.rb +0 -0
- data/spec/unit/indirector/file_metadata/file_spec.rb +0 -0
- data/spec/unit/indirector/file_metadata/rest_spec.rb +0 -0
- data/spec/unit/indirector/file_server_spec.rb +0 -0
- data/spec/unit/indirector/indirection_spec.rb +0 -0
- data/spec/unit/indirector/json_spec.rb +0 -0
- data/spec/unit/indirector/key/ca_spec.rb +0 -0
- data/spec/unit/indirector/key/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/key/file_spec.rb +0 -0
- data/spec/unit/indirector/ldap_spec.rb +0 -0
- data/spec/unit/indirector/memory_spec.rb +0 -0
- data/spec/unit/indirector/msgpack_spec.rb +11 -1
- data/spec/unit/indirector/node/exec_spec.rb +0 -0
- data/spec/unit/indirector/node/ldap_spec.rb +0 -0
- data/spec/unit/indirector/node/memory_spec.rb +0 -0
- data/spec/unit/indirector/node/msgpack_spec.rb +0 -0
- data/spec/unit/indirector/node/plain_spec.rb +0 -0
- data/spec/unit/indirector/node/rest_spec.rb +0 -0
- data/spec/unit/indirector/node/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/node/yaml_spec.rb +0 -0
- data/spec/unit/indirector/plain_spec.rb +0 -0
- data/spec/unit/indirector/report/msgpack_spec.rb +0 -0
- data/spec/unit/indirector/report/processor_spec.rb +0 -0
- data/spec/unit/indirector/report/rest_spec.rb +0 -0
- data/spec/unit/indirector/report/yaml_spec.rb +0 -0
- data/spec/unit/indirector/request_spec.rb +0 -0
- data/spec/unit/indirector/resource/ral_spec.rb +0 -0
- data/spec/unit/indirector/resource/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/resource_type/parser_spec.rb +5 -0
- data/spec/unit/indirector/resource_type/rest_spec.rb +0 -0
- data/spec/unit/indirector/rest_spec.rb +12 -0
- data/spec/unit/indirector/ssl_file_spec.rb +0 -0
- data/spec/unit/indirector/status/rest_spec.rb +0 -0
- data/spec/unit/indirector/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/terminus_spec.rb +0 -0
- data/spec/unit/indirector/yaml_spec.rb +0 -0
- data/spec/unit/indirector_spec.rb +0 -0
- data/spec/unit/interface/action_builder_spec.rb +0 -0
- data/spec/unit/interface/action_manager_spec.rb +0 -0
- data/spec/unit/interface/action_spec.rb +0 -0
- data/spec/unit/interface/documentation_spec.rb +0 -0
- data/spec/unit/interface/face_collection_spec.rb +0 -0
- data/spec/unit/interface/option_builder_spec.rb +0 -0
- data/spec/unit/interface/option_spec.rb +0 -0
- data/spec/unit/interface_spec.rb +0 -0
- data/spec/unit/man_spec.rb +0 -0
- data/spec/unit/module_spec.rb +30 -6
- data/spec/unit/module_tool/applications/builder_spec.rb +23 -3
- data/spec/unit/module_tool_spec.rb +0 -0
- data/spec/unit/network/auth_config_parser_spec.rb +16 -0
- data/spec/unit/network/authconfig_spec.rb +0 -0
- data/spec/unit/network/authstore_spec.rb +0 -0
- data/spec/unit/network/format_handler_spec.rb +0 -0
- data/spec/unit/network/format_spec.rb +0 -0
- data/spec/unit/network/formats_spec.rb +0 -0
- data/spec/unit/network/http/api/indirected_routes_spec.rb +21 -13
- data/spec/unit/network/http/api/master/v3/environment_spec.rb +60 -0
- data/spec/unit/network/http/api/master/v3_spec.rb +0 -0
- data/spec/unit/network/http/compression_spec.rb +0 -0
- data/spec/unit/network/http/connection_spec.rb +0 -0
- data/spec/unit/network/http/factory_spec.rb +0 -0
- data/spec/unit/network/http/handler_spec.rb +0 -0
- data/spec/unit/network/http/nocache_pool_spec.rb +0 -0
- data/spec/unit/network/http/pool_spec.rb +0 -0
- data/spec/unit/network/http/rack/rest_spec.rb +7 -0
- data/spec/unit/network/http/rack_spec.rb +0 -0
- data/spec/unit/network/http/session_spec.rb +0 -0
- data/spec/unit/network/http/site_spec.rb +0 -0
- data/spec/unit/network/http/webrick/rest_spec.rb +0 -0
- data/spec/unit/network/http/webrick_spec.rb +0 -0
- data/spec/unit/network/http_pool_spec.rb +0 -0
- data/spec/unit/network/http_spec.rb +0 -0
- data/spec/unit/network/resolver_spec.rb +0 -0
- data/spec/unit/network/rights_spec.rb +0 -0
- data/spec/unit/network/server_spec.rb +0 -0
- data/spec/unit/node/environment_spec.rb +10 -0
- data/spec/unit/node/facts_spec.rb +0 -0
- data/spec/unit/node_spec.rb +0 -0
- data/spec/unit/other/selinux_spec.rb +0 -0
- data/spec/unit/parameter/path_spec.rb +0 -0
- data/spec/unit/parameter/value_collection_spec.rb +0 -0
- data/spec/unit/parameter/value_spec.rb +0 -0
- data/spec/unit/parameter_spec.rb +0 -0
- data/spec/unit/parser/ast/leaf_spec.rb +0 -0
- data/spec/unit/parser/compiler_spec.rb +20 -1
- data/spec/unit/parser/files_spec.rb +0 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +2 -2
- data/spec/unit/parser/functions/defined_spec.rb +0 -0
- data/spec/unit/parser/functions/digest_spec.rb +0 -0
- data/spec/unit/parser/functions/fail_spec.rb +0 -0
- data/spec/unit/parser/functions/file_spec.rb +0 -0
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +0 -0
- data/spec/unit/parser/functions/generate_spec.rb +0 -0
- data/spec/unit/parser/functions/hiera_spec.rb +0 -0
- data/spec/unit/parser/functions/include_spec.rb +0 -0
- data/spec/unit/parser/functions/inline_template_spec.rb +0 -0
- data/spec/unit/parser/functions/realize_spec.rb +0 -0
- data/spec/unit/parser/functions/regsubst_spec.rb +0 -0
- data/spec/unit/parser/functions/require_spec.rb +0 -0
- data/spec/unit/parser/functions/scanf_spec.rb +0 -0
- data/spec/unit/parser/functions/shared.rb +1 -1
- data/spec/unit/parser/functions/shellquote_spec.rb +0 -0
- data/spec/unit/parser/functions/split_spec.rb +0 -0
- data/spec/unit/parser/functions/sprintf_spec.rb +0 -0
- data/spec/unit/parser/functions/tag_spec.rb +0 -0
- data/spec/unit/parser/functions/template_spec.rb +0 -0
- data/spec/unit/parser/functions/versioncmp_spec.rb +0 -0
- data/spec/unit/parser/functions_spec.rb +0 -0
- data/spec/unit/parser/relationship_spec.rb +0 -0
- data/spec/unit/parser/resource/param_spec.rb +0 -0
- data/spec/unit/parser/resource_spec.rb +8 -1
- data/spec/unit/parser/scope_spec.rb +45 -0
- data/spec/unit/parser/templatewrapper_spec.rb +0 -0
- data/spec/unit/parser/type_loader_spec.rb +0 -0
- data/spec/unit/pops/evaluator/access_ops_spec.rb +14 -0
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +13 -5
- data/spec/unit/pops/loaders/loaders_spec.rb +8 -8
- data/spec/unit/pops/loaders/static_loader_spec.rb +92 -1
- data/spec/unit/pops/lookup/interpolation_spec.rb +313 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +2 -9
- data/spec/unit/pops/parser/parse_application_spec.rb +3 -8
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +19 -0
- data/spec/unit/pops/parser/parse_capabilities_spec.rb +3 -10
- data/spec/unit/pops/parser/parse_site_spec.rb +19 -10
- data/spec/unit/pops/parser/parser_rspec_helper.rb +0 -4
- data/spec/unit/pops/types/enumeration_spec.rb +13 -12
- data/spec/unit/pops/types/iterable_spec.rb +2 -2
- data/spec/unit/pops/types/p_object_type_spec.rb +1060 -0
- data/spec/unit/pops/types/p_sem_ver_type_spec.rb +285 -0
- data/spec/unit/pops/types/recursion_guard_spec.rb +19 -17
- data/spec/unit/pops/types/ruby_generator_spec.rb +261 -0
- data/spec/unit/pops/types/string_converter_spec.rb +904 -0
- data/spec/unit/pops/types/type_asserter_spec.rb +3 -3
- data/spec/unit/pops/types/type_calculator_spec.rb +462 -412
- data/spec/unit/pops/types/type_factory_spec.rb +129 -88
- data/spec/unit/pops/types/type_formatter_spec.rb +80 -8
- data/spec/unit/pops/types/type_mismatch_describer_spec.rb +27 -2
- data/spec/unit/pops/types/type_parser_spec.rb +55 -16
- data/spec/unit/pops/types/types_spec.rb +320 -0
- data/spec/unit/pops/validator/validator_spec.rb +84 -10
- data/spec/unit/property/ensure_spec.rb +0 -0
- data/spec/unit/property/keyvalue_spec.rb +0 -0
- data/spec/unit/property/list_spec.rb +0 -0
- data/spec/unit/property/ordered_list_spec.rb +0 -0
- data/spec/unit/property_spec.rb +0 -0
- data/spec/unit/provider/augeas/augeas_spec.rb +0 -0
- data/spec/unit/provider/cisco_spec.rb +0 -0
- data/spec/unit/provider/command_spec.rb +0 -0
- data/spec/unit/provider/cron/crontab_spec.rb +0 -0
- data/spec/unit/provider/exec/posix_spec.rb +0 -0
- data/spec/unit/provider/exec/shell_spec.rb +0 -0
- data/spec/unit/provider/exec/windows_spec.rb +0 -0
- data/spec/unit/provider/exec_spec.rb +0 -0
- data/spec/unit/provider/file/posix_spec.rb +0 -0
- data/spec/unit/provider/file/windows_spec.rb +0 -0
- data/spec/unit/provider/group/groupadd_spec.rb +0 -0
- data/spec/unit/provider/group/ldap_spec.rb +0 -0
- data/spec/unit/provider/group/pw_spec.rb +0 -0
- data/spec/unit/provider/group/windows_adsi_spec.rb +0 -0
- data/spec/unit/provider/host/parsed_spec.rb +0 -0
- data/spec/unit/provider/interface/cisco_spec.rb +0 -0
- data/spec/unit/provider/ldap_spec.rb +0 -0
- data/spec/unit/provider/macauthorization_spec.rb +0 -0
- data/spec/unit/provider/mcx/mcxcontent_spec.rb +0 -0
- data/spec/unit/provider/mount/parsed_spec.rb +0 -0
- data/spec/unit/provider/mount_spec.rb +0 -0
- data/spec/unit/provider/naginator_spec.rb +0 -0
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +0 -0
- data/spec/unit/provider/nameservice_spec.rb +0 -0
- data/spec/unit/provider/network_device_spec.rb +0 -0
- data/spec/unit/provider/package/aix_spec.rb +0 -0
- data/spec/unit/provider/package/appdmg_spec.rb +0 -0
- data/spec/unit/provider/package/apt_spec.rb +0 -0
- data/spec/unit/provider/package/aptitude_spec.rb +0 -0
- data/spec/unit/provider/package/aptrpm_spec.rb +0 -0
- data/spec/unit/provider/package/dpkg_spec.rb +0 -0
- data/spec/unit/provider/package/freebsd_spec.rb +0 -0
- data/spec/unit/provider/package/gem_spec.rb +0 -0
- data/spec/unit/provider/package/hpux_spec.rb +0 -0
- data/spec/unit/provider/package/macports_spec.rb +0 -0
- data/spec/unit/provider/package/nim_spec.rb +0 -0
- data/spec/unit/provider/package/openbsd_spec.rb +0 -0
- data/spec/unit/provider/package/opkg_spec.rb +0 -0
- data/spec/unit/provider/package/pacman_spec.rb +0 -0
- data/spec/unit/provider/package/pip3_spec.rb +9 -262
- data/spec/unit/provider/package/pip_spec.rb +85 -22
- data/spec/unit/provider/package/pkg_spec.rb +0 -0
- data/spec/unit/provider/package/pkgutil_spec.rb +0 -0
- data/spec/unit/provider/package/puppet_gem_spec.rb +0 -0
- data/spec/unit/provider/package/rpm_spec.rb +160 -3
- data/spec/unit/provider/package/sun_spec.rb +0 -0
- data/spec/unit/provider/package/windows/package_spec.rb +0 -0
- data/spec/unit/provider/package/windows_spec.rb +0 -0
- data/spec/unit/provider/package/yum_spec.rb +23 -134
- data/spec/unit/provider/package/zypper_spec.rb +0 -0
- data/spec/unit/provider/parsedfile_spec.rb +0 -0
- data/spec/unit/provider/selboolean_spec.rb +0 -0
- data/spec/unit/provider/selmodule_spec.rb +0 -0
- data/spec/unit/provider/service/base_spec.rb +0 -0
- data/spec/unit/provider/service/bsd_spec.rb +0 -0
- data/spec/unit/provider/service/daemontools_spec.rb +0 -0
- data/spec/unit/provider/service/debian_spec.rb +0 -0
- data/spec/unit/provider/service/freebsd_spec.rb +0 -0
- data/spec/unit/provider/service/gentoo_spec.rb +0 -0
- data/spec/unit/provider/service/init_spec.rb +0 -0
- data/spec/unit/provider/service/launchd_spec.rb +0 -0
- data/spec/unit/provider/service/openbsd_spec.rb +0 -0
- data/spec/unit/provider/service/openrc_spec.rb +0 -0
- data/spec/unit/provider/service/openwrt_spec.rb +0 -0
- data/spec/unit/provider/service/rcng_spec.rb +0 -0
- data/spec/unit/provider/service/redhat_spec.rb +0 -0
- data/spec/unit/provider/service/runit_spec.rb +0 -0
- data/spec/unit/provider/service/smf_spec.rb +14 -2
- data/spec/unit/provider/service/src_spec.rb +0 -0
- data/spec/unit/provider/service/systemd_spec.rb +34 -42
- data/spec/unit/provider/service/upstart_spec.rb +0 -0
- data/spec/unit/provider/service/windows_spec.rb +0 -0
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +0 -0
- data/spec/unit/provider/sshkey/parsed_spec.rb +0 -0
- data/spec/unit/provider/user/directoryservice_spec.rb +0 -0
- data/spec/unit/provider/user/hpux_spec.rb +0 -0
- data/spec/unit/provider/user/ldap_spec.rb +0 -0
- data/spec/unit/provider/user/openbsd_spec.rb +0 -0
- data/spec/unit/provider/user/pw_spec.rb +0 -0
- data/spec/unit/provider/user/user_role_add_spec.rb +0 -0
- data/spec/unit/provider/user/useradd_spec.rb +0 -0
- data/spec/unit/provider/user/windows_adsi_spec.rb +0 -0
- data/spec/unit/provider/vlan/cisco_spec.rb +0 -0
- data/spec/unit/provider/zfs/zfs_spec.rb +0 -0
- data/spec/unit/provider/zone/solaris_spec.rb +0 -0
- data/spec/unit/provider/zpool/zpool_spec.rb +0 -0
- data/spec/unit/provider_spec.rb +0 -0
- data/spec/unit/puppet_spec.rb +0 -0
- data/spec/unit/relationship_spec.rb +0 -0
- data/spec/unit/reports/http_spec.rb +0 -0
- data/spec/unit/reports/store_spec.rb +0 -0
- data/spec/unit/reports_spec.rb +0 -0
- data/spec/unit/resource/capability_finder_spec.rb +10 -2
- data/spec/unit/resource/catalog_spec.rb +27 -0
- data/spec/unit/resource/status_spec.rb +0 -0
- data/spec/unit/resource/type_collection_helper_spec.rb +0 -0
- data/spec/unit/resource/type_collection_spec.rb +0 -0
- data/spec/unit/resource/type_spec.rb +0 -0
- data/spec/unit/resource_spec.rb +0 -0
- data/spec/unit/settings/directory_setting_spec.rb +0 -0
- data/spec/unit/settings/duration_setting_spec.rb +0 -0
- data/spec/unit/settings/file_setting_spec.rb +6 -0
- data/spec/unit/settings/path_setting_spec.rb +0 -0
- data/spec/unit/settings/priority_setting_spec.rb +0 -0
- data/spec/unit/settings_spec.rb +1 -1
- data/spec/unit/ssl/base_spec.rb +0 -0
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +0 -0
- data/spec/unit/ssl/certificate_authority_spec.rb +0 -0
- data/spec/unit/ssl/certificate_factory_spec.rb +0 -0
- data/spec/unit/ssl/certificate_request_spec.rb +0 -0
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +0 -0
- data/spec/unit/ssl/certificate_spec.rb +0 -0
- data/spec/unit/ssl/configuration_spec.rb +0 -0
- data/spec/unit/ssl/host_spec.rb +0 -0
- data/spec/unit/ssl/inventory_spec.rb +0 -0
- data/spec/unit/ssl/key_spec.rb +0 -0
- data/spec/unit/status_spec.rb +0 -0
- data/spec/unit/transaction/additional_resource_generator_spec.rb +80 -65
- data/spec/unit/transaction/event_manager_spec.rb +0 -0
- data/spec/unit/transaction/event_spec.rb +0 -0
- data/spec/unit/transaction/report_spec.rb +0 -0
- data/spec/unit/transaction/resource_harness_spec.rb +0 -0
- data/spec/unit/transaction_spec.rb +0 -0
- data/spec/unit/type/augeas_spec.rb +0 -0
- data/spec/unit/type/component_spec.rb +0 -0
- data/spec/unit/type/computer_spec.rb +0 -0
- data/spec/unit/type/cron_spec.rb +0 -0
- data/spec/unit/type/exec_spec.rb +0 -0
- data/spec/unit/type/file/checksum_spec.rb +0 -0
- data/spec/unit/type/file/checksum_value_spec.rb +0 -0
- data/spec/unit/type/file/content_spec.rb +0 -0
- data/spec/unit/type/file/ctime_spec.rb +0 -0
- data/spec/unit/type/file/ensure_spec.rb +0 -0
- data/spec/unit/type/file/group_spec.rb +0 -0
- data/spec/unit/type/file/mode_spec.rb +0 -0
- data/spec/unit/type/file/mtime_spec.rb +0 -0
- data/spec/unit/type/file/owner_spec.rb +0 -0
- data/spec/unit/type/file/selinux_spec.rb +0 -0
- data/spec/unit/type/file/source_spec.rb +0 -0
- data/spec/unit/type/file/type_spec.rb +0 -0
- data/spec/unit/type/file_spec.rb +0 -0
- data/spec/unit/type/filebucket_spec.rb +0 -0
- data/spec/unit/type/group_spec.rb +0 -0
- data/spec/unit/type/host_spec.rb +0 -0
- data/spec/unit/type/interface_spec.rb +0 -0
- data/spec/unit/type/k5login_spec.rb +0 -0
- data/spec/unit/type/macauthorization_spec.rb +0 -0
- data/spec/unit/type/mailalias_spec.rb +0 -0
- data/spec/unit/type/maillist_spec.rb +0 -0
- data/spec/unit/type/mcx_spec.rb +0 -0
- data/spec/unit/type/mount_spec.rb +51 -10
- data/spec/unit/type/nagios_spec.rb +0 -0
- data/spec/unit/type/noop_metaparam_spec.rb +0 -0
- data/spec/unit/type/package/package_settings_spec.rb +0 -0
- data/spec/unit/type/package_spec.rb +0 -0
- data/spec/unit/type/resources_spec.rb +0 -0
- data/spec/unit/type/schedule_spec.rb +0 -0
- data/spec/unit/type/selboolean_spec.rb +0 -0
- data/spec/unit/type/selmodule_spec.rb +0 -0
- data/spec/unit/type/service_spec.rb +16 -0
- data/spec/unit/type/ssh_authorized_key_spec.rb +0 -0
- data/spec/unit/type/sshkey_spec.rb +0 -0
- data/spec/unit/type/stage_spec.rb +0 -0
- data/spec/unit/type/tidy_spec.rb +0 -0
- data/spec/unit/type/user_spec.rb +0 -0
- data/spec/unit/type/vlan_spec.rb +0 -0
- data/spec/unit/type/whit_spec.rb +0 -0
- data/spec/unit/type/yumrepo_spec.rb +0 -0
- data/spec/unit/type/zfs_spec.rb +0 -0
- data/spec/unit/type/zone_spec.rb +0 -0
- data/spec/unit/type/zpool_spec.rb +0 -0
- data/spec/unit/type_spec.rb +14 -0
- data/spec/unit/util/autoload_spec.rb +0 -0
- data/spec/unit/util/backups_spec.rb +0 -0
- data/spec/unit/util/checksums_spec.rb +0 -0
- data/spec/unit/util/colors_spec.rb +0 -0
- data/spec/unit/util/command_line_spec.rb +0 -0
- data/spec/unit/util/constant_inflector_spec.rb +0 -0
- data/spec/unit/util/diff_spec.rb +0 -0
- data/spec/unit/util/errors_spec.rb +0 -0
- data/spec/unit/util/execution_spec.rb +0 -0
- data/spec/unit/util/execution_stub_spec.rb +0 -0
- data/spec/unit/util/feature_spec.rb +1 -1
- data/spec/unit/util/filetype_spec.rb +0 -0
- data/spec/unit/util/ldap/connection_spec.rb +0 -0
- data/spec/unit/util/ldap/generator_spec.rb +0 -0
- data/spec/unit/util/ldap/manager_spec.rb +0 -0
- data/spec/unit/util/log/destinations_spec.rb +0 -0
- data/spec/unit/util/log_spec.rb +0 -0
- data/spec/unit/util/logging_spec.rb +0 -0
- data/spec/unit/util/metric_spec.rb +0 -0
- data/spec/unit/util/monkey_patches_spec.rb +79 -3
- data/spec/unit/util/nagios_maker_spec.rb +0 -0
- data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
- data/spec/unit/util/network_device/cisco/facts_spec.rb +0 -0
- data/spec/unit/util/network_device/cisco/interface_spec.rb +0 -0
- data/spec/unit/util/network_device/config_spec.rb +0 -0
- data/spec/unit/util/network_device/ipcalc_spec.rb +0 -0
- data/spec/unit/util/network_device/transport/base_spec.rb +0 -0
- data/spec/unit/util/network_device/transport/ssh_spec.rb +0 -0
- data/spec/unit/util/network_device/transport/telnet_spec.rb +0 -0
- data/spec/unit/util/package_spec.rb +0 -0
- data/spec/unit/util/posix_spec.rb +0 -0
- data/spec/unit/util/rdoc_spec.rb +0 -0
- data/spec/unit/util/resource_template_spec.rb +0 -0
- data/spec/unit/util/retry_action_spec.rb +0 -0
- data/spec/unit/util/run_mode_spec.rb +0 -0
- data/spec/unit/util/selinux_spec.rb +0 -0
- data/spec/unit/util/storage_spec.rb +0 -0
- data/spec/unit/util/suidmanager_spec.rb +0 -0
- data/spec/unit/util/symbolic_file_mode_spec.rb +0 -0
- data/spec/unit/util/tagging_spec.rb +0 -0
- data/spec/unit/util/user_attr_spec.rb +0 -0
- data/spec/unit/util/warnings_spec.rb +0 -0
- data/spec/unit/util/windows/adsi_spec.rb +0 -0
- data/spec/unit/util/windows/file_spec.rb +34 -0
- data/spec/unit/util/windows/root_certs_spec.rb +0 -0
- data/spec/unit/util/windows/sid_spec.rb +0 -0
- data/spec/unit/util_spec.rb +0 -0
- data/spec/watchr.rb +0 -0
- metadata +3402 -3337
- checksums.yaml +0 -7
- data/ext/puppet-nm-dispatcher +0 -13
- data/lib/puppet/pops/types/types_meta.rb +0 -0
- data/spec/integration/provider/package_spec.rb +0 -35
- data/spec/unit/data_providers/hiera_interpolation_spec.rb +0 -57
|
@@ -82,7 +82,7 @@ module Runtime3Support
|
|
|
82
82
|
# Must convert :undef back to nil - this can happen when an undefined variable is used in a
|
|
83
83
|
# parameter's default value expression - there nil must be :undef to work with the rest of 3x.
|
|
84
84
|
# Now that the value comes back to 4x it is changed to nil.
|
|
85
|
-
return
|
|
85
|
+
return :undef == x ? nil : x
|
|
86
86
|
}
|
|
87
87
|
# It is always ok to reference numeric variables even if they are not assigned. They are always undef
|
|
88
88
|
# if not set by a match expression.
|
|
@@ -90,7 +90,7 @@ module Runtime3Support
|
|
|
90
90
|
unless name =~ Puppet::Pops::Patterns::NUMERIC_VAR_NAME
|
|
91
91
|
optionally_fail(Puppet::Pops::Issues::UNKNOWN_VARIABLE, o, {:name => name})
|
|
92
92
|
end
|
|
93
|
-
nil # in case unknown variable is configured as a warning
|
|
93
|
+
nil # in case unknown variable is configured as a warning or ignore
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
# Returns true if the variable of the given name is set in the given most nested scope. True is returned even if
|
|
@@ -497,7 +497,17 @@ module Runtime3Support
|
|
|
497
497
|
p[Issues::EMPTY_RESOURCE_SPECIALIZATION] = :ignore
|
|
498
498
|
end
|
|
499
499
|
|
|
500
|
-
|
|
500
|
+
# if strict variables are on, an error is raised
|
|
501
|
+
# if strict variables are off, the Puppet[strict] defines what is done
|
|
502
|
+
#
|
|
503
|
+
if Puppet[:strict_variables]
|
|
504
|
+
p[Issues::UNKNOWN_VARIABLE] = :error
|
|
505
|
+
elsif Puppet[:strict] == :off
|
|
506
|
+
p[Issues::UNKNOWN_VARIABLE] = :ignore
|
|
507
|
+
else
|
|
508
|
+
Puppet[:strict_variables]
|
|
509
|
+
p[Issues::UNKNOWN_VARIABLE] = Puppet[:strict]
|
|
510
|
+
end
|
|
501
511
|
|
|
502
512
|
# Store config issues, ignore or warning
|
|
503
513
|
p[Issues::RT_NO_STORECONFIGS_EXPORT] = Puppet[:storeconfigs] ? :ignore : :warning
|
|
@@ -510,7 +520,7 @@ module Runtime3Support
|
|
|
510
520
|
def accept(diagnostic)
|
|
511
521
|
super
|
|
512
522
|
IssueReporter.assert_and_report(self, {
|
|
513
|
-
:message => "Evaluation Error:",
|
|
523
|
+
:message => "Evaluation Error:",
|
|
514
524
|
:emit_warnings => true, # log warnings
|
|
515
525
|
:exception_class => Puppet::PreformattedError
|
|
516
526
|
})
|
|
@@ -49,7 +49,7 @@ class Puppet::Pops::Functions::Dispatcher
|
|
|
49
49
|
add(Puppet::Pops::Functions::Dispatch.new(type, method_name, param_names, block_name, injections, weaving, last_captures))
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
# Adds a dispatch directly to the set of
|
|
52
|
+
# Adds a dispatch directly to the set of dispatchers.
|
|
53
53
|
# @api private
|
|
54
54
|
def add(a_dispatch)
|
|
55
55
|
@dispatchers << a_dispatch
|
data/lib/puppet/pops/issues.rb
CHANGED
|
@@ -228,6 +228,10 @@ module Issues
|
|
|
228
228
|
"No value for required key '#{key}' in assignment to variables from hash"
|
|
229
229
|
end
|
|
230
230
|
|
|
231
|
+
MISSING_MULTI_ASSIGNMENT_VARIABLE = hard_issue :MISSING_MULTI_ASSIGNMENT_VARIABLE, :name do
|
|
232
|
+
"No value for required variable '$#{name}' in assignment to variables from class reference"
|
|
233
|
+
end
|
|
234
|
+
|
|
231
235
|
APPENDS_DELETES_NO_LONGER_SUPPORTED = hard_issue :APPENDS_DELETES_NO_LONGER_SUPPORTED, :operator do
|
|
232
236
|
"The operator '#{operator}' is no longer supported. See http://links.puppetlabs.com/remove-plus-equals"
|
|
233
237
|
end
|
|
@@ -280,6 +284,14 @@ module Issues
|
|
|
280
284
|
"Illegal name. The given name '#{name}' does not conform to the naming rule /^((::)?[a-z_]\w*)(::[a-z]\\w*)*$/"
|
|
281
285
|
end
|
|
282
286
|
|
|
287
|
+
ILLEGAL_SINGLE_TYPE_MAPPING = hard_issue :ILLEGAL_TYPE_MAPPING, :expression do
|
|
288
|
+
"Illegal type mapping. Expected a Type on the left side, got #{label.a_an_uc(semantic)}"
|
|
289
|
+
end
|
|
290
|
+
|
|
291
|
+
ILLEGAL_REGEXP_TYPE_MAPPING = hard_issue :ILLEGAL_TYPE_MAPPING, :expression do
|
|
292
|
+
"Illegal type mapping. Expected a Tuple[Regexp,String] on the left side, got #{label.a_an_uc(semantic)}"
|
|
293
|
+
end
|
|
294
|
+
|
|
283
295
|
ILLEGAL_PARAM_NAME = hard_issue :ILLEGAL_PARAM_NAME, :name do
|
|
284
296
|
"Illegal parameter name. The given name '#{name}' does not conform to the naming rule /^[a-z_]\\w*$/"
|
|
285
297
|
end
|
|
@@ -494,7 +506,7 @@ module Issues
|
|
|
494
506
|
end
|
|
495
507
|
|
|
496
508
|
UNKNOWN_RESOURCE_TYPE = issue :UNKNOWN_RESOURCE_TYPE, :type_name do
|
|
497
|
-
"Resource type not found: #{type_name
|
|
509
|
+
"Resource type not found: #{type_name}"
|
|
498
510
|
end
|
|
499
511
|
|
|
500
512
|
ILLEGAL_RESOURCE_TYPE = hard_issue :ILLEGAL_RESOURCE_TYPE, :actual do
|
|
@@ -526,7 +538,7 @@ module Issues
|
|
|
526
538
|
end
|
|
527
539
|
|
|
528
540
|
UNKNOWN_RESOURCE = issue :UNKNOWN_RESOURCE, :type_name, :title do
|
|
529
|
-
"Resource not found: #{type_name
|
|
541
|
+
"Resource not found: #{type_name}['#{title}']"
|
|
530
542
|
end
|
|
531
543
|
|
|
532
544
|
UNKNOWN_RESOURCE_PARAMETER = issue :UNKNOWN_RESOURCE_PARAMETER, :type_name, :title, :param_name do
|
|
@@ -594,6 +606,10 @@ module Issues
|
|
|
594
606
|
"The parameter '#{param_name}' is declared more than once in the parameter list"
|
|
595
607
|
end
|
|
596
608
|
|
|
609
|
+
DUPLICATE_KEY = issue :DUPLICATE_KEY, :key do
|
|
610
|
+
"The key '#{key}' is declared more than once"
|
|
611
|
+
end
|
|
612
|
+
|
|
597
613
|
RESERVED_PARAMETER = hard_issue :RESERVED_PARAMETER, :container, :param_name do
|
|
598
614
|
"The parameter $#{param_name} redefines a built in parameter in #{label.the(container)}"
|
|
599
615
|
end
|
|
@@ -38,6 +38,18 @@ class Puppet::Pops::Loader::BaseLoader < Puppet::Pops::Loader::Loader
|
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
+
# @api public
|
|
42
|
+
#
|
|
43
|
+
def loaded_entry(typed_name, check_dependencies = false)
|
|
44
|
+
if @named_values.has_key?(typed_name)
|
|
45
|
+
@named_values[typed_name]
|
|
46
|
+
elsif parent
|
|
47
|
+
parent.loaded_entry(typed_name, check_dependencies)
|
|
48
|
+
else
|
|
49
|
+
nil
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
41
53
|
# This method is final (subclasses should not override it)
|
|
42
54
|
#
|
|
43
55
|
# @api private
|
|
@@ -49,8 +61,24 @@ class Puppet::Pops::Loader::BaseLoader < Puppet::Pops::Loader::Loader
|
|
|
49
61
|
# @api private
|
|
50
62
|
#
|
|
51
63
|
def set_entry(typed_name, value, origin = nil)
|
|
52
|
-
|
|
53
|
-
|
|
64
|
+
|
|
65
|
+
# It is never ok to redefine in the very same loader unless redefining a 'not found'
|
|
66
|
+
if entry = @named_values[typed_name]
|
|
67
|
+
fail_redefine(entry) unless entry.value.nil?
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Check if new entry shadows existing entry and fail
|
|
71
|
+
# (unless special loader allows shadowing)
|
|
72
|
+
if typed_name.type == :type && !allow_shadowing?
|
|
73
|
+
entry = loaded_entry(typed_name)
|
|
74
|
+
if entry
|
|
75
|
+
fail_redefine(entry) unless entry.value.nil? #|| entry.value == value
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
@last_result = Puppet::Pops::Loader::Loader::NamedEntry.new(typed_name, value, origin)
|
|
80
|
+
@last_name = typed_name
|
|
81
|
+
@named_values[typed_name] = @last_result
|
|
54
82
|
end
|
|
55
83
|
|
|
56
84
|
# @api private
|
|
@@ -69,25 +97,35 @@ class Puppet::Pops::Loader::BaseLoader < Puppet::Pops::Loader::Loader
|
|
|
69
97
|
@named_values[typed_name] = named_entry
|
|
70
98
|
end
|
|
71
99
|
|
|
100
|
+
protected
|
|
101
|
+
|
|
102
|
+
def allow_shadowing?
|
|
103
|
+
false
|
|
104
|
+
end
|
|
105
|
+
|
|
72
106
|
private
|
|
73
107
|
|
|
74
108
|
def fail_redefine(entry)
|
|
75
|
-
origin_info = entry.origin ? "
|
|
76
|
-
raise ArgumentError, "Attempt to redefine entity '#{entry.typed_name}'
|
|
109
|
+
origin_info = entry.origin ? "Originally set #{origin_label(entry.origin)}." : "Set at unknown location"
|
|
110
|
+
raise ArgumentError, "Attempt to redefine entity '#{entry.typed_name}'. #{origin_info}"
|
|
77
111
|
end
|
|
78
112
|
|
|
79
113
|
# TODO: Should not really be here?? - TODO: A Label provider ? semantics for the URI?
|
|
80
114
|
#
|
|
81
115
|
def origin_label(origin)
|
|
82
116
|
if origin && origin.is_a?(URI)
|
|
83
|
-
origin
|
|
117
|
+
format_uri(origin)
|
|
84
118
|
elsif origin.respond_to?(:uri)
|
|
85
|
-
origin.uri
|
|
119
|
+
format_uri(origin.uri)
|
|
86
120
|
else
|
|
87
121
|
origin
|
|
88
122
|
end
|
|
89
123
|
end
|
|
90
124
|
|
|
125
|
+
def format_uri(uri)
|
|
126
|
+
(uri.scheme == 'puppet' ? 'by ' : 'at ') + uri.to_s.sub(/^puppet:/,'')
|
|
127
|
+
end
|
|
128
|
+
|
|
91
129
|
# loads in priority order:
|
|
92
130
|
# 1. already loaded here
|
|
93
131
|
# 2. load from parent
|
|
@@ -96,7 +134,10 @@ class Puppet::Pops::Loader::BaseLoader < Puppet::Pops::Loader::Loader
|
|
|
96
134
|
#
|
|
97
135
|
def internal_load(typed_name)
|
|
98
136
|
# avoid calling get_entry, by looking it up
|
|
99
|
-
@named_values[typed_name]
|
|
137
|
+
te = @named_values[typed_name]
|
|
138
|
+
te = parent.load_typed(typed_name) if te.nil? || te.value.nil?
|
|
139
|
+
te = find(typed_name) if te.nil? || te.value.nil?
|
|
140
|
+
te
|
|
100
141
|
end
|
|
101
142
|
|
|
102
143
|
end
|
|
@@ -48,13 +48,38 @@ class Puppet::Pops::Loader::DependencyLoader < Puppet::Pops::Loader::BaseLoader
|
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
# @api public
|
|
52
|
+
#
|
|
53
|
+
def loaded_entry(typed_name, check_dependencies = false)
|
|
54
|
+
super || (check_dependencies ? loaded_entry_in_dependency(typed_name, check_dependencies) : nil)
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def to_s
|
|
52
58
|
"(DependencyLoader '#{@loader_name}' [" + @dependency_loaders.map {|loader| loader.to_s }.join(' ,') + "])"
|
|
53
59
|
end
|
|
54
60
|
|
|
55
61
|
private
|
|
56
62
|
|
|
57
|
-
def
|
|
63
|
+
def loaded_entry_in_dependency(typed_name, check_dependencies)
|
|
64
|
+
if typed_name.qualified?
|
|
65
|
+
if l = index[typed_name.name_parts[0]]
|
|
66
|
+
l.loaded_entry(typed_name)
|
|
67
|
+
else
|
|
68
|
+
# no module entered as dependency with name matching first segment of wanted name
|
|
69
|
+
nil
|
|
70
|
+
end
|
|
71
|
+
else
|
|
72
|
+
# a non name-spaced name, have to search since it can be anywhere.
|
|
73
|
+
# (Note: superclass caches the result in this loader as it would have to repeat this search for every
|
|
74
|
+
# lookup otherwise).
|
|
75
|
+
@dependency_loaders.reduce(nil) do |previous, loader|
|
|
76
|
+
break previous if !previous.nil?
|
|
77
|
+
loader.loaded_entry(typed_name, check_dependencies)
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def index
|
|
58
83
|
@index ||= @dependency_loaders.reduce({}) { |index, loader| index[loader.module_name] = loader; index }
|
|
59
84
|
end
|
|
60
85
|
end
|
|
@@ -55,6 +55,18 @@ class Puppet::Pops::Loader::Loader
|
|
|
55
55
|
raise NotImplementedError.new
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
+
# Returns an already loaded entry if one exists, or nil. This does not trigger loading
|
|
59
|
+
# of the given type/name.
|
|
60
|
+
#
|
|
61
|
+
# @param typed_name [TypedName] - the type, name combination to lookup
|
|
62
|
+
# @param check_dependencies [Boolean] - if dependencies should be checked in additiona to here and parent
|
|
63
|
+
# @return [NamedEntry, nil] the entry containing the loaded value, or nil if not found
|
|
64
|
+
# @api public
|
|
65
|
+
#
|
|
66
|
+
def loaded_entry(typed_name, check_dependencies = false)
|
|
67
|
+
raise NotImplementedError.new(self.class)
|
|
68
|
+
end
|
|
69
|
+
|
|
58
70
|
# Produces the value associated with the given name if defined **in this loader**, or nil if not defined.
|
|
59
71
|
# This lookup does not trigger any loading, or search of the given name.
|
|
60
72
|
# An implementor of this method may not search or look up in any other loader, and it may not
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module Puppet::Pops::Loader
|
|
2
|
+
|
|
3
|
+
# A PredefinedLoader is a loader that is manually populated with loaded elements
|
|
4
|
+
# before being used. It never loads anything on its own.
|
|
5
|
+
# When searching for a type, it must exist or an error is raised
|
|
6
|
+
#
|
|
7
|
+
class PredefinedLoader < BaseLoader
|
|
8
|
+
def find(typed_name)
|
|
9
|
+
if typed_name.type == :type
|
|
10
|
+
raise Puppet::Pops::Loaders::LoaderError, "Cannot load undefined type '#{typed_name.name.capitalize}'"
|
|
11
|
+
else
|
|
12
|
+
nil
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def to_s()
|
|
17
|
+
"(PredefinedLoader '#{loader_name}')"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Allows shadowing since this loader is used internally for things like function local types
|
|
21
|
+
# And they should win as there is otherwise a risk that the local types clash with built in types
|
|
22
|
+
# that were added after the function was written, or by resource types loaded by the 3x auto loader.
|
|
23
|
+
#
|
|
24
|
+
def allow_shadowing?
|
|
25
|
+
true
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
module Puppet::Pops
|
|
2
|
+
module Loader
|
|
3
|
+
|
|
4
|
+
# Runtime3TypeLoader
|
|
5
|
+
# ===
|
|
6
|
+
# Loads a resource type using the 3.x type loader
|
|
7
|
+
#
|
|
8
|
+
# @api private
|
|
9
|
+
class Runtime3TypeLoader < BaseLoader
|
|
10
|
+
def initialize(parent_loader, environment)
|
|
11
|
+
super(parent_loader, environment.name)
|
|
12
|
+
@environment = environment
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def to_s()
|
|
16
|
+
"(Runtime3TypeLoader '#{loader_name()}')"
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
# Finds typed/named entity in this module
|
|
20
|
+
# @param typed_name [TypedName] the type/name to find
|
|
21
|
+
# @return [Loader::NamedEntry, nil found/created entry, or nil if not found
|
|
22
|
+
#
|
|
23
|
+
def find(typed_name)
|
|
24
|
+
return nil unless typed_name.type == :type
|
|
25
|
+
|
|
26
|
+
name = typed_name.name
|
|
27
|
+
value = @environment.known_resource_types.find_definition(name)
|
|
28
|
+
if value.nil?
|
|
29
|
+
# Look for Puppet::Type
|
|
30
|
+
value = Puppet::Type.type(name)
|
|
31
|
+
if value.nil?
|
|
32
|
+
# Cache the fact that it wasn't found
|
|
33
|
+
set_entry(typed_name, nil)
|
|
34
|
+
return nil
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Loaded types doesn't have the same life cycle as this loader, so we must start by
|
|
39
|
+
# checking if the type was created. If it was, an entry will already be stored in
|
|
40
|
+
# this loader. If not, then it was created before this loader was instantiated and
|
|
41
|
+
# we must therefore add it.
|
|
42
|
+
te = get_entry(typed_name)
|
|
43
|
+
te = set_entry(typed_name, Types::TypeFactory.resource(value.name.to_s)) if te.nil? || te.value.nil?
|
|
44
|
+
te
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Allows shadowing since this loader is populalted with all loaded resource types at time
|
|
48
|
+
# of loading. This loading will, for built in types override the aliases configured in the static
|
|
49
|
+
# loader.
|
|
50
|
+
#
|
|
51
|
+
def allow_shadowing?
|
|
52
|
+
true
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
# Static Loader contains constants, basic data types and other types required for the system
|
|
2
2
|
# to boot.
|
|
3
3
|
#
|
|
4
|
-
|
|
4
|
+
module Puppet::Pops
|
|
5
|
+
module Loader
|
|
6
|
+
class StaticLoader < Loader
|
|
5
7
|
|
|
6
8
|
attr_reader :loaded
|
|
7
9
|
def initialize
|
|
8
10
|
@loaded = {}
|
|
9
11
|
create_logging_functions()
|
|
12
|
+
create_built_in_types()
|
|
13
|
+
create_resource_type_references()
|
|
10
14
|
end
|
|
11
15
|
|
|
12
16
|
def load_typed(typed_name)
|
|
@@ -29,14 +33,17 @@ class Puppet::Pops::Loader::StaticLoader < Puppet::Pops::Loader::Loader
|
|
|
29
33
|
def to_s()
|
|
30
34
|
"(StaticLoader)"
|
|
31
35
|
end
|
|
32
|
-
private
|
|
33
36
|
|
|
34
|
-
def
|
|
37
|
+
def loaded_entry(typed_name, _)
|
|
35
38
|
@loaded[typed_name]
|
|
36
39
|
end
|
|
37
40
|
|
|
38
41
|
private
|
|
39
42
|
|
|
43
|
+
def load_constant(typed_name)
|
|
44
|
+
@loaded[typed_name]
|
|
45
|
+
end
|
|
46
|
+
|
|
40
47
|
# Creates a function for each of the specified log levels
|
|
41
48
|
#
|
|
42
49
|
def create_logging_functions()
|
|
@@ -70,10 +77,90 @@ class Puppet::Pops::Loader::StaticLoader < Puppet::Pops::Loader::Loader
|
|
|
70
77
|
end
|
|
71
78
|
end
|
|
72
79
|
|
|
73
|
-
typed_name =
|
|
80
|
+
typed_name = TypedName.new(:function, level)
|
|
74
81
|
# TODO:closure scope is fake (an empty hash) - waiting for new global scope to be available via lookup of :scopes
|
|
75
82
|
func = fc.new({},self)
|
|
76
|
-
@loaded[ typed_name ] =
|
|
83
|
+
@loaded[ typed_name ] = NamedEntry.new(typed_name, func, __FILE__)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
def create_built_in_types
|
|
88
|
+
origin_uri = URI("puppet:Puppet-Type-System/Static-Loader")
|
|
89
|
+
type_map = Puppet::Pops::Types::TypeParser.type_map
|
|
90
|
+
type_map.each do |name, type|
|
|
91
|
+
typed_name = TypedName.new(:type, name)
|
|
92
|
+
@loaded[ typed_name ] = NamedEntry.new(typed_name, type, origin_uri)#__FILE__)
|
|
77
93
|
end
|
|
78
94
|
end
|
|
95
|
+
|
|
96
|
+
def create_resource_type_references()
|
|
97
|
+
# These needs to be done quickly and we do not want to scan the file system for these
|
|
98
|
+
# We are also not interested in their definition only that they exist.
|
|
99
|
+
# These types are in all environments.
|
|
100
|
+
#
|
|
101
|
+
%w{
|
|
102
|
+
Auegas
|
|
103
|
+
Component
|
|
104
|
+
Computer
|
|
105
|
+
Cron
|
|
106
|
+
Exec
|
|
107
|
+
File
|
|
108
|
+
Filebucket
|
|
109
|
+
Group
|
|
110
|
+
Host
|
|
111
|
+
Interface
|
|
112
|
+
K5login
|
|
113
|
+
Macauthorization
|
|
114
|
+
Mailalias
|
|
115
|
+
Maillist
|
|
116
|
+
Mcx
|
|
117
|
+
Mount
|
|
118
|
+
Nagios_command
|
|
119
|
+
Nagios_contact
|
|
120
|
+
Nagios_contactgroup
|
|
121
|
+
Nagios_host
|
|
122
|
+
Nagios_hostdependency
|
|
123
|
+
Nagios_hostescalation
|
|
124
|
+
Nagios_hostgroup
|
|
125
|
+
Nagios_hostextinfo
|
|
126
|
+
Nagios_service
|
|
127
|
+
Nagios_servicedependency
|
|
128
|
+
Nagios_serviceescalation
|
|
129
|
+
Nagios_serviceextinfo
|
|
130
|
+
Nagios_servicegroup
|
|
131
|
+
Nagios_timeperiod
|
|
132
|
+
Notify
|
|
133
|
+
Package
|
|
134
|
+
Resources
|
|
135
|
+
Router
|
|
136
|
+
Schedule
|
|
137
|
+
Scheduled_task
|
|
138
|
+
Selboolean
|
|
139
|
+
Selmodule
|
|
140
|
+
Service
|
|
141
|
+
Ssh_authorized_key
|
|
142
|
+
Sshkey
|
|
143
|
+
Stage
|
|
144
|
+
Tidy
|
|
145
|
+
User
|
|
146
|
+
Vlan
|
|
147
|
+
Whit
|
|
148
|
+
Yumrepo
|
|
149
|
+
Zfs
|
|
150
|
+
Zone
|
|
151
|
+
Zpool
|
|
152
|
+
}.each { |name| create_resource_type_reference(name) }
|
|
153
|
+
|
|
154
|
+
if Puppet[:app_management]
|
|
155
|
+
create_resource_type_reference('Node')
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
def create_resource_type_reference(name)
|
|
160
|
+
typed_name = TypedName.new(:type, name.downcase)
|
|
161
|
+
type = Puppet::Pops::Types::TypeFactory.resource(name)
|
|
162
|
+
@loaded[ typed_name ] = NamedEntry.new(typed_name, type, __FILE__)
|
|
163
|
+
end
|
|
164
|
+
end
|
|
165
|
+
end
|
|
79
166
|
end
|
|
@@ -42,14 +42,36 @@ class TypeDefinitionInstantiator
|
|
|
42
42
|
# the loader is known - hence this mechanism
|
|
43
43
|
private_loader = loader.private_loader
|
|
44
44
|
Adapters::LoaderAdapter.adapt(type_definition).loader = private_loader
|
|
45
|
-
|
|
46
|
-
Types::PTypeAliasType.new(name, type_definition.type_expr)
|
|
45
|
+
create_type(type_definition, loader)
|
|
47
46
|
end
|
|
48
47
|
|
|
49
48
|
def self.create_from_model(type_definition, loader)
|
|
49
|
+
typed_name = Loader::TypedName.new(:type, type_definition.name.downcase)
|
|
50
|
+
type = create_type(type_definition, loader)
|
|
51
|
+
loader.set_entry(
|
|
52
|
+
typed_name,
|
|
53
|
+
type,
|
|
54
|
+
Adapters::SourcePosAdapter.adapt(type_definition).to_uri)
|
|
55
|
+
type
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.create_type(type_definition, loader)
|
|
59
|
+
type_expr = type_definition.type_expr
|
|
50
60
|
name = type_definition.name
|
|
51
|
-
|
|
61
|
+
if object_definition?(type_expr)
|
|
62
|
+
# No need for an alias. The Object type itself will receive the name instead
|
|
63
|
+
i12n_hash_expr = type_expr.keys.empty? ? nil : type_expr.keys[0]
|
|
64
|
+
Types::PObjectType.new(name, i12n_hash_expr)
|
|
65
|
+
else
|
|
66
|
+
Types::PTypeAliasType.new(name, type_expr)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
private_class_method :create_type
|
|
70
|
+
|
|
71
|
+
def self.object_definition?(te)
|
|
72
|
+
te.is_a?(Model::AccessExpression) && (left = te.left_expr).is_a?(Model::QualifiedReference) && left.cased_value == 'Object'
|
|
52
73
|
end
|
|
74
|
+
private_class_method :object_definition?
|
|
53
75
|
end
|
|
54
76
|
end
|
|
55
77
|
end
|
data/lib/puppet/pops/loaders.rb
CHANGED
|
@@ -6,10 +6,9 @@ class Loaders
|
|
|
6
6
|
attr_reader :puppet_system_loader
|
|
7
7
|
attr_reader :public_environment_loader
|
|
8
8
|
attr_reader :private_environment_loader
|
|
9
|
+
attr_reader :implementation_registry
|
|
9
10
|
|
|
10
11
|
def initialize(environment)
|
|
11
|
-
# The static loader can only be changed after a reboot
|
|
12
|
-
@@static_loader ||= Loader::StaticLoader.new()
|
|
13
12
|
|
|
14
13
|
# Create the set of loaders
|
|
15
14
|
# 1. Puppet, loads from the "running" puppet - i.e. bundled functions, types, extension points and extensions
|
|
@@ -26,28 +25,81 @@ class Loaders
|
|
|
26
25
|
#
|
|
27
26
|
@private_environment_loader = create_environment_loader(environment)
|
|
28
27
|
|
|
29
|
-
# 3.
|
|
28
|
+
# 3. The implementation registry maintains mappings between Puppet types and Runtime types for
|
|
29
|
+
# the current environment
|
|
30
|
+
@implementation_registry = Types::ImplementationRegistry.new(@private_environment_loader)
|
|
31
|
+
Pcore.init(@puppet_system_loader, @implementation_registry)
|
|
32
|
+
|
|
33
|
+
# 4. module loaders are set up from the create_environment_loader, they register themselves
|
|
30
34
|
end
|
|
31
35
|
|
|
32
36
|
# Clears the cached static and puppet_system loaders (to enable testing)
|
|
33
37
|
#
|
|
34
38
|
def self.clear
|
|
35
39
|
@@static_loader = nil
|
|
36
|
-
@puppet_system_loader = nil
|
|
37
40
|
end
|
|
38
41
|
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
# is `nil` or empty.
|
|
42
|
+
# Calls {#loaders} to obtain the {{Loaders}} instance and then uses it to find the appropriate loader
|
|
43
|
+
# for the given `module_name`, or for the environment in case `module_name` is `nil` or empty.
|
|
42
44
|
#
|
|
43
45
|
# @param module_name [String,nil] the name of the module
|
|
44
46
|
# @return [Loader::Loader] the found loader
|
|
45
47
|
# @raise [Puppet::ParseError] if no loader can be found
|
|
46
48
|
# @api private
|
|
47
49
|
def self.find_loader(module_name)
|
|
50
|
+
loaders.find_loader(module_name)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def self.static_loader
|
|
54
|
+
# The static loader can only be changed after a reboot
|
|
55
|
+
@@static_loader ||= Loader::StaticLoader.new()
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def self.implementation_registry
|
|
59
|
+
loaders = Puppet.lookup(:loaders) { nil }
|
|
60
|
+
loaders.nil? ? nil : loaders.implementation_registry
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def register_implementations(*obj_classes)
|
|
64
|
+
loader = @private_environment_loader
|
|
65
|
+
types = obj_classes.map do |obj_class|
|
|
66
|
+
type = obj_class._ptype
|
|
67
|
+
typed_name = Loader::Loader::TypedName.new(:type, type.name.downcase)
|
|
68
|
+
entry = loader.loaded_entry(typed_name)
|
|
69
|
+
loader.set_entry(typed_name, type, obj_class._plocation) if entry.nil? || entry.value.nil?
|
|
70
|
+
type
|
|
71
|
+
end
|
|
72
|
+
# Resolve lazy so that all types can cross reference eachother
|
|
73
|
+
parser = Types::TypeParser.new
|
|
74
|
+
types.each { |type| type.resolve(parser, loader) }
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# Register the given type with the Runtime3TypeLoader. The registration will not happen unless
|
|
78
|
+
# the type system has been initialized.
|
|
79
|
+
#
|
|
80
|
+
# @param name [String,Symbol] the name of the entity being set
|
|
81
|
+
# @param origin [URI] the origin or the source where the type is defined
|
|
82
|
+
# @api private
|
|
83
|
+
def self.register_runtime3_type(name, origin)
|
|
84
|
+
loaders = Puppet.lookup(:loaders) { nil }
|
|
85
|
+
unless loaders.nil?
|
|
86
|
+
name = name.to_s
|
|
87
|
+
caps_name = Types::TypeFormatter.singleton.capitalize_segments(name)
|
|
88
|
+
typed_name = Loader::Loader::TypedName.new(:type, name.downcase)
|
|
89
|
+
loaders.runtime3_type_loader.set_entry(typed_name, Types::PResourceType.new(caps_name), origin)
|
|
90
|
+
end
|
|
91
|
+
nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Finds the `Loaders` instance by looking up the :loaders in the global Puppet context
|
|
95
|
+
#
|
|
96
|
+
# @return [Loaders] the loaders instance
|
|
97
|
+
# @raise [Puppet::ParseError] if loader has been bound to the global context
|
|
98
|
+
# @api private
|
|
99
|
+
def self.loaders
|
|
48
100
|
loaders = Puppet.lookup(:loaders) { nil }
|
|
49
101
|
raise Puppet::ParseError, "Internal Error: Puppet Context ':loaders' missing" if loaders.nil?
|
|
50
|
-
loaders
|
|
102
|
+
loaders
|
|
51
103
|
end
|
|
52
104
|
|
|
53
105
|
# Finds the appropriate loader for the given `module_name`, or for the environment in case `module_name`
|
|
@@ -77,13 +129,17 @@ class Loaders
|
|
|
77
129
|
end
|
|
78
130
|
|
|
79
131
|
def static_loader
|
|
80
|
-
|
|
132
|
+
self.class.static_loader
|
|
81
133
|
end
|
|
82
134
|
|
|
83
135
|
def puppet_system_loader
|
|
84
136
|
@puppet_system_loader
|
|
85
137
|
end
|
|
86
138
|
|
|
139
|
+
def runtime3_type_loader
|
|
140
|
+
@runtime3_type_loader
|
|
141
|
+
end
|
|
142
|
+
|
|
87
143
|
def public_loader_for_module(module_name)
|
|
88
144
|
md = @module_resolver[module_name] || (return nil)
|
|
89
145
|
# Note, this loader is not resolved until there is interest in the visibility of entities from the
|
|
@@ -130,12 +186,16 @@ class Loaders
|
|
|
130
186
|
module_name = nil
|
|
131
187
|
loader_name = "environment:#{environment.name}"
|
|
132
188
|
env_conf = Puppet.lookup(:environments).get_conf(environment.name)
|
|
189
|
+
|
|
190
|
+
# Create the 3.x resource type loader
|
|
191
|
+
@runtime3_type_loader = Loader::Runtime3TypeLoader.new(puppet_system_loader, environment)
|
|
192
|
+
|
|
133
193
|
if env_conf.nil? || !env_conf.is_a?(Puppet::Settings::EnvironmentConf)
|
|
134
194
|
# Not a real directory environment, cannot work as a module TODO: Drop when legacy env are dropped?
|
|
135
|
-
loader = Loader::SimpleEnvironmentLoader.new(
|
|
195
|
+
loader = Loader::SimpleEnvironmentLoader.new(@runtime3_type_loader, loader_name)
|
|
136
196
|
else
|
|
137
197
|
# View the environment as a module to allow loading from it - this module is always called 'environment'
|
|
138
|
-
loader = Loader::ModuleLoaders.module_loader_from(
|
|
198
|
+
loader = Loader::ModuleLoaders.module_loader_from(@runtime3_type_loader, self, 'environment', env_conf.path_to_env)
|
|
139
199
|
end
|
|
140
200
|
|
|
141
201
|
# An environment has a module path even if it has a null loader
|
|
@@ -270,9 +330,19 @@ class Loaders
|
|
|
270
330
|
|
|
271
331
|
def create_loader_with_only_dependencies_visible(from_module_data)
|
|
272
332
|
if from_module_data.unmet_dependencies?
|
|
273
|
-
Puppet
|
|
274
|
-
|
|
275
|
-
|
|
333
|
+
if Puppet[:strict] != :off
|
|
334
|
+
msg = "ModuleLoader: module '#{from_module_data.name}' has unresolved dependencies" \
|
|
335
|
+
" - it will only see those that are resolved." \
|
|
336
|
+
" Use 'puppet module list --tree' to see information about modules"
|
|
337
|
+
case Puppet[:strict]
|
|
338
|
+
when :error
|
|
339
|
+
raise LoaderError.new(msg)
|
|
340
|
+
when :warning
|
|
341
|
+
Puppet.warn_once(:unresolved_module_dependencies,
|
|
342
|
+
"unresolved_dependencies_for_module_#{from_module_data.name}",
|
|
343
|
+
msg)
|
|
344
|
+
end
|
|
345
|
+
end
|
|
276
346
|
end
|
|
277
347
|
dependency_loaders = from_module_data.dependency_names.collect { |name| @index[name].public_loader }
|
|
278
348
|
Loader::DependencyLoader.new(from_module_data.public_loader, from_module_data.name, dependency_loaders)
|