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
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
# Manage systemd services using systemctl
|
|
2
2
|
|
|
3
3
|
Puppet::Type.type(:service).provide :systemd, :parent => :base do
|
|
4
|
-
desc "Manages `systemd` services using `systemctl`.
|
|
4
|
+
desc "Manages `systemd` services using `systemctl`.
|
|
5
|
+
|
|
6
|
+
Because `systemd` defaults to assuming the `.service` unit type, the suffix
|
|
7
|
+
may be omitted. Other unit types (such as `.path`) may be managed by
|
|
8
|
+
providing the proper suffix."
|
|
5
9
|
|
|
6
10
|
commands :systemctl => "systemctl"
|
|
7
11
|
|
|
@@ -32,10 +36,21 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
|
|
|
32
36
|
return []
|
|
33
37
|
end
|
|
34
38
|
|
|
39
|
+
# This helper ensures that the enable state cache is always reset
|
|
40
|
+
# after a systemctl enable operation. A particular service state is not guaranteed
|
|
41
|
+
# after such an operation, so the cache must be emptied to prevent inconsistencies
|
|
42
|
+
# in the provider's believed state of the service and the actual state.
|
|
43
|
+
# @param action [String,Symbol] One of 'enable', 'disable', 'mask' or 'unmask'
|
|
44
|
+
def systemctl_change_enable(action)
|
|
45
|
+
output = systemctl(action, @resource[:name])
|
|
46
|
+
rescue
|
|
47
|
+
raise Puppet::Error, "Could not #{action} #{self.name}: #{output}", $!.backtrace
|
|
48
|
+
ensure
|
|
49
|
+
@cached_enabled = nil
|
|
50
|
+
end
|
|
51
|
+
|
|
35
52
|
def disable
|
|
36
|
-
|
|
37
|
-
rescue Puppet::ExecutionFailure
|
|
38
|
-
raise Puppet::Error, "Could not disable #{self.name}: #{output}", $!.backtrace
|
|
53
|
+
systemctl_change_enable(:disable)
|
|
39
54
|
end
|
|
40
55
|
|
|
41
56
|
def get_start_link_count
|
|
@@ -49,38 +64,27 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
|
|
|
49
64
|
Dir.glob("/etc/rc*.d/S??#{link_name}").length
|
|
50
65
|
end
|
|
51
66
|
|
|
52
|
-
def
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
'--property', 'LoadState',
|
|
58
|
-
'--property', 'UnitFileState',
|
|
59
|
-
'--no-pager'
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
svc_info = Hash.new
|
|
63
|
-
systemctl_info.split.each do |svc|
|
|
64
|
-
entry_pair = svc.split('=')
|
|
65
|
-
svc_info[entry_pair.first.to_sym] = entry_pair.last
|
|
66
|
-
end
|
|
67
|
+
def cached_enabled?
|
|
68
|
+
return @cached_enabled if @cached_enabled
|
|
69
|
+
cmd = [command(:systemctl), 'is-enabled', @resource[:name]]
|
|
70
|
+
@cached_enabled = execute(cmd, :failonfail => false).strip
|
|
71
|
+
end
|
|
67
72
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
# service is disabled and therefore we simply return :false.
|
|
73
|
+
def enabled?
|
|
74
|
+
output = cached_enabled?
|
|
75
|
+
|
|
76
|
+
# The masked state is equivalent to the disabled state in terms of
|
|
77
|
+
# comparison so we only care to check if it is masked if we want to keep
|
|
78
|
+
# it masked.
|
|
79
|
+
#
|
|
80
|
+
# We only return :mask if we're trying to mask the service. This prevents
|
|
81
|
+
# flapping when simply trying to disable a masked service.
|
|
82
|
+
return :mask if (@resource[:enable] == :mask) && (output == 'masked')
|
|
83
|
+
return :true if ['static', 'enabled'].include? output
|
|
84
|
+
return :false if ['disabled', 'linked', 'indirect', 'masked'].include? output
|
|
85
|
+
if (output.empty?) && (Facter.value(:osfamily).downcase == 'debian')
|
|
86
|
+
ret = debian_enabled?
|
|
87
|
+
return ret if ret
|
|
84
88
|
end
|
|
85
89
|
|
|
86
90
|
return :false
|
|
@@ -91,60 +95,38 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
|
|
|
91
95
|
# have a Systemd unit file, we need to go through the old init script to determine
|
|
92
96
|
# whether it is enabled or not. See PUP-5016 for more details.
|
|
93
97
|
#
|
|
94
|
-
def debian_enabled?
|
|
95
|
-
|
|
96
|
-
if
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
def debian_enabled?
|
|
99
|
+
system("/usr/sbin/invoke-rc.d", "--quiet", "--query", @resource[:name], "start")
|
|
100
|
+
if [104, 106].include?($CHILD_STATUS.exitstatus)
|
|
101
|
+
return :true
|
|
102
|
+
elsif [101, 105].include?($CHILD_STATUS.exitstatus)
|
|
103
|
+
# 101 is action not allowed, which means we have to do the check manually.
|
|
104
|
+
# 105 is unknown, which generally means the iniscript does not support query
|
|
105
|
+
# The debian policy states that the initscript should support methods of query
|
|
106
|
+
# For those that do not, peform the checks manually
|
|
107
|
+
# http://www.debian.org/doc/debian-policy/ch-opersys.html
|
|
108
|
+
if get_start_link_count >= 4
|
|
99
109
|
return :true
|
|
100
|
-
elsif [101, 105].include?($CHILD_STATUS.exitstatus)
|
|
101
|
-
# 101 is action not allowed, which means we have to do the check manually.
|
|
102
|
-
# 105 is unknown, which generally means the iniscript does not support query
|
|
103
|
-
# The debian policy states that the initscript should support methods of query
|
|
104
|
-
# For those that do not, peform the checks manually
|
|
105
|
-
# http://www.debian.org/doc/debian-policy/ch-opersys.html
|
|
106
|
-
if get_start_link_count >= 4
|
|
107
|
-
return :true
|
|
108
|
-
else
|
|
109
|
-
return :false
|
|
110
|
-
end
|
|
111
110
|
else
|
|
112
111
|
return :false
|
|
113
112
|
end
|
|
113
|
+
else
|
|
114
|
+
return :false
|
|
114
115
|
end
|
|
115
116
|
end
|
|
116
117
|
|
|
117
|
-
def status
|
|
118
|
-
begin
|
|
119
|
-
systemctl("is-active", @resource[:name])
|
|
120
|
-
rescue Puppet::ExecutionFailure
|
|
121
|
-
return :stopped
|
|
122
|
-
end
|
|
123
|
-
return :running
|
|
124
|
-
end
|
|
125
|
-
|
|
126
118
|
def enable
|
|
127
119
|
self.unmask
|
|
128
|
-
|
|
129
|
-
rescue Puppet::ExecutionFailure
|
|
130
|
-
raise Puppet::Error, "Could not enable #{self.name}: #{output}", $!.backtrace
|
|
120
|
+
systemctl_change_enable(:enable)
|
|
131
121
|
end
|
|
132
122
|
|
|
133
123
|
def mask
|
|
134
124
|
self.disable
|
|
135
|
-
|
|
136
|
-
output = systemctl("mask", @resource[:name])
|
|
137
|
-
rescue Puppet::ExecutionFailure
|
|
138
|
-
raise Puppet::Error, "Could not mask #{self.name}: #{output}", $!.backtrace
|
|
139
|
-
end
|
|
125
|
+
systemctl_change_enable(:mask)
|
|
140
126
|
end
|
|
141
127
|
|
|
142
128
|
def unmask
|
|
143
|
-
|
|
144
|
-
output = systemctl("unmask", @resource[:name])
|
|
145
|
-
rescue Puppet::ExecutionFailure
|
|
146
|
-
raise Puppet::Error, "Could not unmask #{self.name}: #{output}", $!.backtrace
|
|
147
|
-
end
|
|
129
|
+
systemctl_change_enable(:unmask)
|
|
148
130
|
end
|
|
149
131
|
|
|
150
132
|
def restartcmd
|
|
@@ -159,5 +141,9 @@ Puppet::Type.type(:service).provide :systemd, :parent => :base do
|
|
|
159
141
|
def stopcmd
|
|
160
142
|
[command(:systemctl), "stop", @resource[:name]]
|
|
161
143
|
end
|
|
144
|
+
|
|
145
|
+
def statuscmd
|
|
146
|
+
[command(:systemctl), "is-active", @resource[:name]]
|
|
147
|
+
end
|
|
162
148
|
end
|
|
163
149
|
|
|
@@ -167,10 +167,12 @@ Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source =>
|
|
|
167
167
|
end
|
|
168
168
|
|
|
169
169
|
def password
|
|
170
|
-
|
|
170
|
+
return :absent unless shadow_entry
|
|
171
|
+
shadow_entry[1]
|
|
171
172
|
end
|
|
172
173
|
|
|
173
174
|
def password_min_age
|
|
175
|
+
return :absent unless shadow_entry
|
|
174
176
|
shadow_entry[3].empty? ? -1 : shadow_entry[3]
|
|
175
177
|
end
|
|
176
178
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
# This doesn't get stored in trac, since it changes every time.
|
|
2
1
|
providers = Puppet::Util::Reference.newreference :providers, :title => "Provider Suitability Report", :depth => 1, :dynamic => true, :doc => "Which providers are valid for this machine" do
|
|
3
2
|
types = []
|
|
4
3
|
Puppet::Type.loadall
|
|
5
4
|
Puppet::Type.eachtype do |klass|
|
|
6
|
-
next unless klass.providers.length > 0
|
|
5
|
+
next unless klass && klass.providers.length > 0
|
|
7
6
|
types << klass
|
|
8
7
|
end
|
|
9
8
|
types.sort! { |a,b| a.name.to_s <=> b.name.to_s }
|
|
@@ -91,7 +90,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
|
91
90
|
|
|
92
91
|
ret << markdown_header(type.name.to_s + "_", 2)
|
|
93
92
|
|
|
94
|
-
ret << "[#{type.name}](https://docs.puppetlabs.com/
|
|
93
|
+
ret << "[#{type.name}](https://docs.puppetlabs.com/puppet/latest/reference/type.html##{type.name})\n\n"
|
|
95
94
|
ret << option("Default provider", default)
|
|
96
95
|
ret << doctable(headers, table_data)
|
|
97
96
|
|
|
@@ -102,6 +102,9 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
|
102
102
|
end
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
+
# Add `resources` to the catalog after `other`. WARNING: adding
|
|
106
|
+
# multiple resources will produce the reverse ordering, e.g. calling
|
|
107
|
+
# `add_resource_after(A, [B,C])` will result in `[A,C,B]`.
|
|
105
108
|
def add_resource_after(other, *resources)
|
|
106
109
|
resources.each do |resource|
|
|
107
110
|
other_title_key = title_key_for_ref(other.ref)
|
|
@@ -111,7 +114,6 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
|
111
114
|
end
|
|
112
115
|
end
|
|
113
116
|
|
|
114
|
-
|
|
115
117
|
def add_resource(*resources)
|
|
116
118
|
resources.each do |resource|
|
|
117
119
|
add_one_resource(resource)
|
|
@@ -165,14 +167,15 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
|
165
167
|
|
|
166
168
|
# Create an alias for a resource.
|
|
167
169
|
def alias(resource, key)
|
|
168
|
-
resource.ref
|
|
170
|
+
ref = resource.ref
|
|
171
|
+
ref =~ /^(.+)\[/
|
|
169
172
|
class_name = $1 || resource.class.name
|
|
170
173
|
|
|
171
174
|
newref = [class_name, key].flatten
|
|
172
175
|
|
|
173
176
|
if key.is_a? String
|
|
174
177
|
ref_string = "#{class_name}[#{key}]"
|
|
175
|
-
return if ref_string ==
|
|
178
|
+
return if ref_string == ref
|
|
176
179
|
end
|
|
177
180
|
|
|
178
181
|
# LAK:NOTE It's important that we directly compare the references,
|
|
@@ -183,12 +186,12 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
|
183
186
|
return if existing == resource
|
|
184
187
|
resource_declaration = " at #{resource.file}:#{resource.line}" if resource.file and resource.line
|
|
185
188
|
existing_declaration = " at #{existing.file}:#{existing.line}" if existing.file and existing.line
|
|
186
|
-
msg = "Cannot alias #{
|
|
189
|
+
msg = "Cannot alias #{ref} to #{key.inspect}#{resource_declaration}; resource #{newref.inspect} already declared#{existing_declaration}"
|
|
187
190
|
raise ArgumentError, msg
|
|
188
191
|
end
|
|
189
192
|
@resource_table[newref] = resource
|
|
190
|
-
@aliases[
|
|
191
|
-
@aliases[
|
|
193
|
+
@aliases[ref] ||= []
|
|
194
|
+
@aliases[ref] << newref
|
|
192
195
|
end
|
|
193
196
|
|
|
194
197
|
# Apply our catalog to the local host.
|
|
@@ -330,11 +333,12 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
|
330
333
|
# references to the resource instances.
|
|
331
334
|
def remove_resource(*resources)
|
|
332
335
|
resources.each do |resource|
|
|
333
|
-
|
|
336
|
+
ref = resource.ref
|
|
337
|
+
title_key = title_key_for_ref(ref)
|
|
334
338
|
@resource_table.delete(title_key)
|
|
335
|
-
if aliases = @aliases[
|
|
339
|
+
if aliases = @aliases[ref]
|
|
336
340
|
aliases.each { |res_alias| @resource_table.delete(res_alias) }
|
|
337
|
-
@aliases.delete(
|
|
341
|
+
@aliases.delete(ref)
|
|
338
342
|
end
|
|
339
343
|
remove_vertex!(resource) if vertex?(resource)
|
|
340
344
|
@relationship_graph.remove_vertex!(resource) if @relationship_graph and @relationship_graph.vertex?(resource)
|
|
@@ -346,27 +350,27 @@ class Puppet::Resource::Catalog < Puppet::Graph::SimpleGraph
|
|
|
346
350
|
|
|
347
351
|
# Look a resource up by its reference (e.g., File[/etc/passwd]).
|
|
348
352
|
def resource(type, title = nil)
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
353
|
+
type, title = Puppet::Resource.type_and_title(type, title)
|
|
354
|
+
title_key = [type, title.to_s]
|
|
355
|
+
result = @resource_table[title_key]
|
|
356
|
+
if result.nil?
|
|
357
|
+
# an instance has to be created in order to construct the unique key used when
|
|
358
|
+
# searching for aliases.
|
|
359
|
+
unless @aliases.empty? && !Puppet[:app_management]
|
|
360
|
+
res = Puppet::Resource.new(type, title, { :environment => @environment_instance })
|
|
361
|
+
result = @resource_table[[type, res.uniqueness_key].flatten]
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
if result.nil? && Puppet[:app_management]
|
|
365
|
+
resource_type = res.resource_type
|
|
366
|
+
if resource_type && resource_type.is_capability?
|
|
367
|
+
# @todo lutter 2015-03-10: this assumes that it is legal to just
|
|
368
|
+
# mention a capability resource in code and have it automatically
|
|
369
|
+
# made available, even if the current component does not require it
|
|
370
|
+
result = Puppet::Resource::CapabilityFinder.find(environment, code_id, res)
|
|
371
|
+
add_resource(result) if result
|
|
372
|
+
end
|
|
373
|
+
end
|
|
370
374
|
end
|
|
371
375
|
result
|
|
372
376
|
end
|
|
@@ -55,17 +55,16 @@ class Puppet::Resource::TypeCollection
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
def add(instance)
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
instance.resource_type_collection = self
|
|
65
|
-
instance
|
|
58
|
+
# return a merged instance, or the given
|
|
59
|
+
result = catch(:merged) {
|
|
60
|
+
send("add_#{instance.type}", instance)
|
|
61
|
+
instance.resource_type_collection = self
|
|
62
|
+
instance
|
|
63
|
+
}
|
|
66
64
|
end
|
|
67
65
|
|
|
68
66
|
def add_hostclass(instance)
|
|
67
|
+
handle_hostclass_merge(instance)
|
|
69
68
|
dupe_check(instance, @hostclasses) { |dupe| "Class '#{instance.name}' is already defined#{dupe.error_context}; cannot redefine" }
|
|
70
69
|
dupe_check(instance, @definitions) { |dupe| "Definition '#{instance.name}' is already defined#{dupe.error_context}; cannot be redefined as a class" }
|
|
71
70
|
dupe_check(instance, @applications) { |dupe| "Application '#{instance.name}' is already defined#{dupe.error_context}; cannot be redefined as a class" }
|
|
@@ -74,6 +73,22 @@ class Puppet::Resource::TypeCollection
|
|
|
74
73
|
instance
|
|
75
74
|
end
|
|
76
75
|
|
|
76
|
+
def handle_hostclass_merge(instance)
|
|
77
|
+
if instance.type == :hostclass && (other = @hostclasses[instance.name]) && other.type == :hostclass
|
|
78
|
+
unless instance.name == ''
|
|
79
|
+
case Puppet[:strict]
|
|
80
|
+
when :warning
|
|
81
|
+
Puppet.warning("Class '#{instance.name}' is already defined#{other.error_context}; cannot redefine at #{instance.file}:#{instance.line}")
|
|
82
|
+
when :error
|
|
83
|
+
# returning means a merge (with throw) is not performed, that will then trigger a duplication check with error.
|
|
84
|
+
return instance
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
other.merge(instance)
|
|
88
|
+
throw :merged, other
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
|
|
77
92
|
def hostclass(name)
|
|
78
93
|
@hostclasses[munge_name(name)]
|
|
79
94
|
end
|
data/lib/puppet/resource.rb
CHANGED
|
@@ -21,7 +21,10 @@ class Puppet::Resource
|
|
|
21
21
|
extend Puppet::Indirector
|
|
22
22
|
indirects :resource, :terminus_class => :ral
|
|
23
23
|
|
|
24
|
-
ATTRIBUTES = [:file, :line, :exported]
|
|
24
|
+
ATTRIBUTES = [:file, :line, :exported].freeze
|
|
25
|
+
TYPE_CLASS = 'Class'.freeze
|
|
26
|
+
TYPE_NODE = 'Node'.freeze
|
|
27
|
+
TYPE_SITE = 'Site'.freeze
|
|
25
28
|
|
|
26
29
|
def self.from_data_hash(data)
|
|
27
30
|
raise ArgumentError, "No resource type provided in serialized data" unless type = data['type']
|
|
@@ -162,7 +165,7 @@ class Puppet::Resource
|
|
|
162
165
|
end
|
|
163
166
|
|
|
164
167
|
def class?
|
|
165
|
-
@is_class ||= @type ==
|
|
168
|
+
@is_class ||= @type == TYPE_CLASS
|
|
166
169
|
end
|
|
167
170
|
|
|
168
171
|
def stage?
|
|
@@ -222,6 +225,11 @@ class Puppet::Resource
|
|
|
222
225
|
self[p] = v
|
|
223
226
|
end
|
|
224
227
|
else
|
|
228
|
+
if type.is_a?(Hash)
|
|
229
|
+
raise ArgumentError, "Puppet::Resource.new does not take a hash as the first argument. "+
|
|
230
|
+
"Did you mean (#{(type[:type] || type["type"]).inspect}, #{(type[:title] || type["title"]).inspect }) ?"
|
|
231
|
+
end
|
|
232
|
+
|
|
225
233
|
environment = attributes[:environment]
|
|
226
234
|
if type.is_a?(Class) && type < Puppet::Type
|
|
227
235
|
# Set the resource type to avoid an expensive `known_resource_types`
|
|
@@ -238,22 +246,15 @@ class Puppet::Resource
|
|
|
238
246
|
send(attr.to_s + "=", value)
|
|
239
247
|
end
|
|
240
248
|
|
|
241
|
-
@type, @title =
|
|
242
|
-
|
|
243
|
-
@type = munge_type_name(@type)
|
|
244
|
-
|
|
245
|
-
if self.class?
|
|
246
|
-
@title = :main if @title == ""
|
|
247
|
-
@title = munge_type_name(@title)
|
|
248
|
-
end
|
|
249
|
+
@type, @title = self.class.type_and_title(type, title)
|
|
249
250
|
|
|
250
251
|
if params = attributes[:parameters]
|
|
251
252
|
extract_parameters(params)
|
|
252
253
|
end
|
|
253
254
|
|
|
254
|
-
|
|
255
|
+
if resource_type && resource_type.respond_to?(:deprecate_params)
|
|
255
256
|
resource_type.deprecate_params(title, attributes[:parameters])
|
|
256
|
-
|
|
257
|
+
end
|
|
257
258
|
|
|
258
259
|
tag(self.type)
|
|
259
260
|
tag_if_valid(self.title)
|
|
@@ -304,10 +305,17 @@ class Puppet::Resource
|
|
|
304
305
|
# @return [Puppet::Type, Puppet::Resource::Type]
|
|
305
306
|
# @api private
|
|
306
307
|
def resource_type
|
|
307
|
-
@rstype ||=
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
@rstype ||= self.class.resource_type(type, title, environment)
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# The resource's type implementation
|
|
312
|
+
# @return [Puppet::Type, Puppet::Resource::Type]
|
|
313
|
+
# @api private
|
|
314
|
+
def self.resource_type(type, title, environment)
|
|
315
|
+
case type
|
|
316
|
+
when TYPE_CLASS; environment.known_resource_types.hostclass(title == :main ? "" : title)
|
|
317
|
+
when TYPE_NODE; environment.known_resource_types.node(title)
|
|
318
|
+
when TYPE_SITE; environment.known_resource_types.site(nil)
|
|
311
319
|
else
|
|
312
320
|
result = Puppet::Type.type(type)
|
|
313
321
|
if !result
|
|
@@ -516,6 +524,35 @@ class Puppet::Resource
|
|
|
516
524
|
self
|
|
517
525
|
end
|
|
518
526
|
|
|
527
|
+
# @api private
|
|
528
|
+
def self.type_and_title(type, title)
|
|
529
|
+
type, title = extract_type_and_title(type, title)
|
|
530
|
+
type = munge_type_name(type)
|
|
531
|
+
if type == TYPE_CLASS
|
|
532
|
+
title = title == '' ? :main : munge_type_name(title)
|
|
533
|
+
end
|
|
534
|
+
[type, title]
|
|
535
|
+
end
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
def self.extract_type_and_title(argtype, argtitle)
|
|
539
|
+
if (argtype.nil? || argtype == :component || argtype == :whit) &&
|
|
540
|
+
argtitle =~ /^([^\[\]]+)\[(.+)\]$/m then [ $1, $2 ]
|
|
541
|
+
elsif argtitle.nil? && argtype =~ /^([^\[\]]+)\[(.+)\]$/m then [ $1, $2 ]
|
|
542
|
+
elsif argtitle then [ argtype, argtitle ]
|
|
543
|
+
elsif argtype.is_a?(Puppet::Type) then [ argtype.class.name, argtype.title ]
|
|
544
|
+
else raise ArgumentError, "No title provided and #{argtype.inspect} is not a valid resource reference"
|
|
545
|
+
end
|
|
546
|
+
end
|
|
547
|
+
private_class_method :extract_type_and_title
|
|
548
|
+
|
|
549
|
+
def self.munge_type_name(value)
|
|
550
|
+
return :main if value == :main
|
|
551
|
+
return TYPE_CLASS if value == '' || value.nil? || value.to_s.casecmp('component') == 0
|
|
552
|
+
Puppet::Pops::Types::TypeFormatter.singleton.capitalize_segments(value.to_s)
|
|
553
|
+
end
|
|
554
|
+
private_class_method :munge_type_name
|
|
555
|
+
|
|
519
556
|
private
|
|
520
557
|
|
|
521
558
|
# Produce a canonical method name.
|
|
@@ -530,7 +567,7 @@ class Puppet::Resource
|
|
|
530
567
|
# The namevar for our resource type. If the type doesn't exist,
|
|
531
568
|
# always use :name.
|
|
532
569
|
def namevar
|
|
533
|
-
if builtin_type?
|
|
570
|
+
if builtin_type? && !(t = resource_type).nil? && t.key_attributes.length == 1
|
|
534
571
|
t.key_attributes.first
|
|
535
572
|
else
|
|
536
573
|
:name
|
|
@@ -544,26 +581,6 @@ class Puppet::Resource
|
|
|
544
581
|
end
|
|
545
582
|
end
|
|
546
583
|
|
|
547
|
-
def extract_type_and_title(argtype, argtitle)
|
|
548
|
-
if (argtype.nil? || argtype == :component || argtype == :whit) &&
|
|
549
|
-
argtitle =~ /^([^\[\]]+)\[(.+)\]$/m then [ $1, $2 ]
|
|
550
|
-
elsif argtitle.nil? && argtype =~ /^([^\[\]]+)\[(.+)\]$/m then [ $1, $2 ]
|
|
551
|
-
elsif argtitle then [ argtype, argtitle ]
|
|
552
|
-
elsif argtype.is_a?(Puppet::Type) then [ argtype.class.name, argtype.title ]
|
|
553
|
-
elsif argtype.is_a?(Hash) then
|
|
554
|
-
raise ArgumentError, "Puppet::Resource.new does not take a hash as the first argument. "+
|
|
555
|
-
"Did you mean (#{(argtype[:type] || argtype["type"]).inspect}, #{(argtype[:title] || argtype["title"]).inspect }) ?"
|
|
556
|
-
else raise ArgumentError, "No title provided and #{argtype.inspect} is not a valid resource reference"
|
|
557
|
-
end
|
|
558
|
-
end
|
|
559
|
-
|
|
560
|
-
def munge_type_name(value)
|
|
561
|
-
return :main if value == :main
|
|
562
|
-
return "Class" if value == "" or value.nil? or value.to_s.downcase == "component"
|
|
563
|
-
|
|
564
|
-
value.to_s.split("::").collect { |s| s.capitalize }.join("::")
|
|
565
|
-
end
|
|
566
|
-
|
|
567
584
|
def parse_title
|
|
568
585
|
h = {}
|
|
569
586
|
type = resource_type
|
|
@@ -95,10 +95,16 @@ class Puppet::Settings::BaseSetting
|
|
|
95
95
|
|
|
96
96
|
def default(check_application_defaults_first = false)
|
|
97
97
|
if @default.is_a? Proc
|
|
98
|
-
|
|
98
|
+
# Give unit tests a chance to reevaluate the call by removing the instance variable
|
|
99
|
+
unless instance_variable_defined?(:@evaluated_default)
|
|
100
|
+
@evaluated_default = @default.call
|
|
101
|
+
end
|
|
102
|
+
default_value = @evaluated_default
|
|
103
|
+
else
|
|
104
|
+
default_value = @default
|
|
99
105
|
end
|
|
100
|
-
return
|
|
101
|
-
return @settings.value(name, :application_defaults, true) ||
|
|
106
|
+
return default_value unless check_application_defaults_first
|
|
107
|
+
return @settings.value(name, :application_defaults, true) || default_value
|
|
102
108
|
end
|
|
103
109
|
|
|
104
110
|
# Convert the object to a config statement.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class Puppet::Settings::SymbolicEnumSetting < Puppet::Settings::BaseSetting
|
|
2
|
+
attr_accessor :values
|
|
3
|
+
|
|
4
|
+
def type
|
|
5
|
+
:symbolic_enum
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def munge(value)
|
|
9
|
+
sym = value.to_sym
|
|
10
|
+
if values.include?(sym)
|
|
11
|
+
sym
|
|
12
|
+
else
|
|
13
|
+
raise Puppet::Settings::ValidationError,
|
|
14
|
+
"Invalid value '#{value}' for parameter #{@name}. Allowed values are '#{values.join("', '")}'"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/puppet/settings.rb
CHANGED
|
@@ -14,6 +14,7 @@ class Puppet::Settings
|
|
|
14
14
|
require 'puppet/settings/base_setting'
|
|
15
15
|
require 'puppet/settings/string_setting'
|
|
16
16
|
require 'puppet/settings/enum_setting'
|
|
17
|
+
require 'puppet/settings/symbolic_enum_setting'
|
|
17
18
|
require 'puppet/settings/array_setting'
|
|
18
19
|
require 'puppet/settings/file_setting'
|
|
19
20
|
require 'puppet/settings/directory_setting'
|
|
@@ -561,7 +562,7 @@ class Puppet::Settings
|
|
|
561
562
|
# will have associated hooks that it ends up being less work this
|
|
562
563
|
# way overall.
|
|
563
564
|
if setting.call_hook_on_initialize?
|
|
564
|
-
@hooks_to_call_on_application_initialization
|
|
565
|
+
@hooks_to_call_on_application_initialization |= [ setting ]
|
|
565
566
|
else
|
|
566
567
|
setting.handle(ChainedValues.new(
|
|
567
568
|
preferred_run_mode,
|
|
@@ -663,6 +664,7 @@ class Puppet::Settings
|
|
|
663
664
|
:ttl => TTLSetting,
|
|
664
665
|
:array => ArraySetting,
|
|
665
666
|
:enum => EnumSetting,
|
|
667
|
+
:symbolic_enum => SymbolicEnumSetting,
|
|
666
668
|
:priority => PrioritySetting,
|
|
667
669
|
:autosign => AutosignSetting,
|
|
668
670
|
}
|
|
@@ -906,7 +908,7 @@ class Puppet::Settings
|
|
|
906
908
|
if tryconfig.call_hook_on_define?
|
|
907
909
|
call << tryconfig
|
|
908
910
|
elsif tryconfig.call_hook_on_initialize?
|
|
909
|
-
@hooks_to_call_on_application_initialization
|
|
911
|
+
@hooks_to_call_on_application_initialization |= [ tryconfig ]
|
|
910
912
|
end
|
|
911
913
|
end
|
|
912
914
|
|
|
@@ -1189,7 +1191,7 @@ Generated on #{Time.now}.
|
|
|
1189
1191
|
# Read the file in.
|
|
1190
1192
|
# @api private
|
|
1191
1193
|
def read_file(file)
|
|
1192
|
-
return Puppet::FileSystem.read(file)
|
|
1194
|
+
return Puppet::FileSystem.read(file, :encoding => 'utf-8')
|
|
1193
1195
|
end
|
|
1194
1196
|
|
|
1195
1197
|
# Private method for internal test use only; allows to do a comprehensive clear of all settings between tests.
|
data/lib/puppet/ssl/oids.rb
CHANGED
|
@@ -69,7 +69,7 @@ module Puppet::SSL::Oids
|
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
# Parse
|
|
72
|
+
# Parse custom OID mapping file that enables custom OIDs to be resolved
|
|
73
73
|
# into user-friendly names.
|
|
74
74
|
#
|
|
75
75
|
# @param custom_oid_file [String] File to obtain custom OIDs mapping from
|
|
@@ -84,7 +84,7 @@ module Puppet::SSL::Oids
|
|
|
84
84
|
# '1.3.6.1.4.1.34380.1.2.1.2':
|
|
85
85
|
# shortname: 'myothershortname'
|
|
86
86
|
# longname: 'Other Long name'
|
|
87
|
-
def self.
|
|
87
|
+
def self.parse_custom_oid_file(custom_oid_file, map_key='oid_mapping')
|
|
88
88
|
if File.exists?(custom_oid_file) && File.readable?(custom_oid_file)
|
|
89
89
|
mapping = nil
|
|
90
90
|
begin
|
|
@@ -110,6 +110,28 @@ module Puppet::SSL::Oids
|
|
|
110
110
|
oid_defns << [oid, shortname, longname]
|
|
111
111
|
end
|
|
112
112
|
|
|
113
|
+
oid_defns
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Load custom OID mapping file that enables custom OIDs to be resolved
|
|
118
|
+
# into user-friendly names.
|
|
119
|
+
#
|
|
120
|
+
# @param custom_oid_file [String] File to obtain custom OIDs mapping from
|
|
121
|
+
# @param map_key [String] Hash key in which custom OIDs mapping is stored
|
|
122
|
+
#
|
|
123
|
+
# @example Custom OID mapping file
|
|
124
|
+
# ---
|
|
125
|
+
# oid_mapping:
|
|
126
|
+
# '1.3.6.1.4.1.34380.1.2.1.1':
|
|
127
|
+
# shortname : 'myshortname'
|
|
128
|
+
# longname : 'Long name'
|
|
129
|
+
# '1.3.6.1.4.1.34380.1.2.1.2':
|
|
130
|
+
# shortname: 'myothershortname'
|
|
131
|
+
# longname: 'Other Long name'
|
|
132
|
+
def self.load_custom_oid_file(custom_oid_file, map_key='oid_mapping')
|
|
133
|
+
oid_defns = parse_custom_oid_file(custom_oid_file, map_key)
|
|
134
|
+
unless oid_defns.nil?
|
|
113
135
|
begin
|
|
114
136
|
oid_defns.each do |oid_defn|
|
|
115
137
|
OpenSSL::ASN1::ObjectId.register(*oid_defn)
|