puppet 3.8.7 → 4.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CONTRIBUTING.md +26 -11
- data/Gemfile +13 -25
- data/LICENSE +1 -1
- data/Rakefile +9 -0
- data/bin/puppet +7 -6
- data/conf/auth.conf +30 -26
- data/conf/environment.conf +16 -0
- data/conf/fileserver.conf +2 -2
- data/conf/puppet.conf +6 -0
- data/ext/README.environment +1 -1
- data/ext/build_defaults.yaml +16 -7
- data/ext/debian/control +5 -5
- data/ext/debian/puppet-common.manpages +0 -5
- data/ext/debian/puppet-common.postinst +3 -3
- data/ext/debian/puppet.init +23 -12
- data/ext/debian/puppet.logrotate +1 -2
- data/ext/debian/puppetmaster-common.postinst +6 -0
- data/ext/debian/puppetmaster.init +5 -5
- data/ext/debian/rules +4 -1
- data/ext/debian/vim-puppet.dirs +2 -0
- data/ext/debian/vim-puppet.yaml +2 -0
- data/ext/emacs/puppet-mode.el +0 -1
- data/ext/gentoo/conf.d/puppet +1 -1
- data/ext/gentoo/conf.d/puppetmaster +1 -1
- data/ext/nagios/check_puppet.rb +1 -1
- data/ext/project_data.yaml +6 -7
- data/ext/puppet-nm-dispatcher +13 -0
- data/ext/puppet-test +0 -66
- data/ext/puppetlisten/puppetlisten.rb +7 -5
- data/ext/rack/config.ru +12 -5
- data/ext/redhat/client.init +3 -3
- data/ext/redhat/logrotate +1 -2
- data/ext/redhat/puppet.spec.erb +12 -8
- data/ext/redhat/server.init +1 -1
- data/ext/regexp_nodes/regexp_nodes.rb +1 -1
- data/ext/solaris/smf/svc-puppetd +1 -1
- data/ext/solaris/smf/svc-puppetmasterd +1 -1
- data/ext/suse/client.init +1 -1
- data/ext/suse/server.init +1 -1
- data/ext/systemd/puppet.service +1 -3
- data/ext/vim/syntax/puppet.vim +1 -1
- data/ext/windows/service/daemon.rb +19 -2
- data/install.rb +63 -7
- data/lib/hiera/puppet_function.rb +7 -18
- data/lib/hiera/scope.rb +4 -1
- data/lib/puppet.rb +19 -51
- data/lib/puppet/agent.rb +2 -6
- data/lib/puppet/application.rb +14 -65
- data/lib/puppet/application/agent.rb +7 -56
- data/lib/puppet/application/apply.rb +1 -6
- data/lib/puppet/application/ca.rb +5 -0
- data/lib/puppet/application/cert.rb +7 -3
- data/lib/puppet/application/certificate.rb +2 -0
- data/lib/puppet/application/device.rb +10 -36
- data/lib/puppet/application/doc.rb +16 -63
- data/lib/puppet/application/epp.rb +5 -0
- data/lib/puppet/application/face_base.rb +24 -5
- data/lib/puppet/application/master.rb +2 -5
- data/lib/puppet/application/resource.rb +17 -17
- data/lib/puppet/application_support.rb +57 -0
- data/lib/puppet/configurer.rb +3 -7
- data/lib/puppet/configurer/downloader.rb +1 -0
- data/lib/puppet/configurer/fact_handler.rb +1 -1
- data/lib/puppet/daemon.rb +6 -15
- data/lib/puppet/data_providers.rb +28 -0
- data/lib/puppet/data_providers/data_adapter.rb +86 -0
- data/lib/puppet/data_providers/data_function_support.rb +32 -0
- data/lib/puppet/data_providers/function_env_data_provider.rb +28 -0
- data/lib/puppet/data_providers/function_module_data_provider.rb +44 -0
- data/lib/puppet/defaults.rb +135 -530
- data/lib/puppet/environments.rb +10 -156
- data/lib/puppet/error.rb +4 -30
- data/lib/puppet/external/nagios/base.rb +2 -2
- data/lib/puppet/external/pson/common.rb +2 -17
- data/lib/puppet/external/pson/pure/generator.rb +1 -0
- data/lib/puppet/external/pson/pure/parser.rb +0 -11
- data/lib/puppet/face/catalog.rb +4 -4
- data/lib/puppet/face/certificate.rb +2 -3
- data/lib/puppet/face/certificate_request.rb +4 -3
- data/lib/puppet/face/certificate_revocation_list.rb +5 -9
- data/lib/puppet/face/config.rb +2 -2
- data/lib/puppet/face/epp.rb +479 -0
- data/lib/puppet/face/facts.rb +6 -49
- data/lib/puppet/face/file.rb +2 -2
- data/lib/puppet/face/file/download.rb +1 -2
- data/lib/puppet/face/help.rb +2 -3
- data/lib/puppet/face/module/build.rb +5 -5
- data/lib/puppet/face/module/changes.rb +1 -1
- data/lib/puppet/face/module/generate.rb +6 -6
- data/lib/puppet/face/module/install.rb +16 -16
- data/lib/puppet/face/module/list.rb +9 -9
- data/lib/puppet/face/module/uninstall.rb +5 -5
- data/lib/puppet/face/module/upgrade.rb +3 -3
- data/lib/puppet/face/node.rb +3 -4
- data/lib/puppet/face/node/clean.rb +5 -68
- data/lib/puppet/face/parser.rb +6 -8
- data/lib/puppet/face/report.rb +4 -4
- data/lib/puppet/face/resource.rb +1 -1
- data/lib/puppet/face/resource_type.rb +7 -4
- data/lib/puppet/face/status.rb +6 -12
- data/lib/puppet/feature/base.rb +0 -7
- data/lib/puppet/file_bucket/dipper.rb +1 -2
- data/lib/puppet/file_bucket/file.rb +12 -25
- data/lib/puppet/file_serving/base.rb +1 -11
- data/lib/puppet/file_serving/content.rb +5 -7
- data/lib/puppet/file_serving/metadata.rb +4 -61
- data/lib/puppet/file_serving/mount/pluginfacts.rb +1 -1
- data/lib/puppet/file_serving/mount/plugins.rb +1 -1
- data/lib/puppet/file_serving/terminus_helper.rb +16 -5
- data/lib/puppet/file_system.rb +6 -22
- data/lib/puppet/file_system/file_impl.rb +0 -4
- data/lib/puppet/file_system/memory_file.rb +0 -5
- data/lib/puppet/file_system/memory_impl.rb +0 -4
- data/lib/puppet/file_system/{file19.rb → posix.rb} +1 -1
- data/lib/puppet/file_system/{file19windows.rb → windows.rb} +2 -10
- data/lib/puppet/forge/repository.rb +12 -8
- data/lib/puppet/functions.rb +17 -51
- data/lib/puppet/functions/assert_type.rb +7 -7
- data/lib/puppet/functions/each.rb +1 -3
- data/lib/puppet/functions/epp.rb +3 -3
- data/lib/puppet/functions/filter.rb +3 -5
- data/lib/puppet/functions/hiera.rb +2 -23
- data/lib/puppet/functions/hiera_array.rb +3 -25
- data/lib/puppet/functions/hiera_hash.rb +2 -26
- data/lib/puppet/functions/hiera_include.rb +4 -37
- data/lib/puppet/functions/inline_epp.rb +1 -2
- data/lib/puppet/functions/lookup.rb +234 -0
- data/lib/puppet/functions/map.rb +1 -3
- data/lib/puppet/functions/match.rb +5 -5
- data/lib/puppet/functions/reduce.rb +1 -3
- data/lib/puppet/functions/regsubst.rb +79 -0
- data/lib/puppet/functions/scanf.rb +4 -3
- data/lib/puppet/functions/slice.rb +1 -3
- data/lib/puppet/functions/split.rb +47 -0
- data/lib/puppet/functions/with.rb +1 -1
- data/lib/puppet/graph/relationship_graph.rb +41 -13
- data/lib/puppet/graph/simple_graph.rb +6 -10
- data/lib/puppet/indirector/catalog/compiler.rb +0 -2
- data/lib/puppet/indirector/catalog/static_compiler.rb +4 -5
- data/lib/puppet/indirector/direct_file_server.rb +1 -3
- data/lib/puppet/indirector/face.rb +11 -2
- data/lib/puppet/indirector/facts/facter.rb +5 -1
- data/lib/puppet/indirector/facts/network_device.rb +5 -2
- data/lib/puppet/indirector/facts/store_configs.rb +3 -0
- data/lib/puppet/indirector/facts/yaml.rb +4 -0
- data/lib/puppet/indirector/file_metadata/file.rb +0 -15
- data/lib/puppet/indirector/file_server.rb +2 -16
- data/lib/puppet/indirector/hiera.rb +39 -1
- data/lib/puppet/indirector/indirection.rb +2 -9
- data/lib/puppet/indirector/node/ldap.rb +1 -1
- data/lib/puppet/indirector/request.rb +21 -81
- data/lib/puppet/indirector/resource/ral.rb +1 -2
- data/lib/puppet/indirector/resource/store_configs.rb +1 -2
- data/lib/puppet/indirector/resource_type/parser.rb +1 -1
- data/lib/puppet/indirector/rest.rb +21 -33
- data/lib/puppet/interface.rb +0 -7
- data/lib/puppet/interface/action_builder.rb +1 -1
- data/lib/puppet/interface/action_manager.rb +9 -13
- data/lib/puppet/interface/face_collection.rb +2 -2
- data/lib/puppet/interface/option_builder.rb +1 -3
- data/lib/puppet/metatype/manager.rb +1 -7
- data/lib/puppet/module.rb +42 -35
- data/lib/puppet/module_tool.rb +5 -7
- data/lib/puppet/module_tool/applications/application.rb +3 -10
- data/lib/puppet/module_tool/applications/installer.rb +13 -15
- data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +9 -11
- data/lib/puppet/module_tool/contents_description.rb +17 -13
- data/lib/puppet/module_tool/installed_modules.rb +4 -6
- data/lib/puppet/module_tool/metadata.rb +3 -14
- data/lib/puppet/module_tool/skeleton/templates/generator/Gemfile +3 -3
- data/lib/puppet/module_tool/skeleton/templates/generator/Rakefile +0 -1
- data/lib/puppet/module_tool/skeleton/templates/generator/manifests/init.pp.erb +1 -1
- data/lib/puppet/module_tool/tar/gnu.rb +1 -1
- data/lib/puppet/module_tool/tar/mini.rb +2 -2
- data/lib/puppet/network/auth_config_parser.rb +2 -2
- data/lib/puppet/network/authconfig.rb +32 -16
- data/lib/puppet/network/format_handler.rb +7 -7
- data/lib/puppet/network/format_support.rb +4 -0
- data/lib/puppet/network/formats.rb +6 -62
- data/lib/puppet/network/http.rb +12 -2
- data/lib/puppet/network/http/api.rb +42 -0
- data/lib/puppet/network/http/api/ca.rb +2 -0
- data/lib/puppet/network/http/api/ca/v1.rb +11 -0
- data/lib/puppet/network/http/api/{v1.rb → indirected_routes.rb} +57 -29
- data/lib/puppet/network/http/api/indirection_type.rb +32 -0
- data/lib/puppet/network/http/api/master.rb +2 -0
- data/lib/puppet/network/http/api/master/v3.rb +22 -0
- data/lib/puppet/network/http/api/master/v3/authorization.rb +18 -0
- data/lib/puppet/network/http/api/{v2 → master/v3}/environments.rb +2 -2
- data/lib/puppet/network/http/compression.rb +3 -5
- data/lib/puppet/network/http/connection.rb +1 -8
- data/lib/puppet/network/http/factory.rb +2 -3
- data/lib/puppet/network/http/handler.rb +3 -11
- data/lib/puppet/network/http/rack/rest.rb +4 -4
- data/lib/puppet/network/http/request.rb +4 -4
- data/lib/puppet/network/http/webrick.rb +1 -6
- data/lib/puppet/network/http/webrick/rest.rb +15 -8
- data/lib/puppet/network/resolver.rb +2 -2
- data/lib/puppet/network/rights.rb +2 -2
- data/lib/puppet/node.rb +2 -29
- data/lib/puppet/node/environment.rb +92 -184
- data/lib/puppet/node/facts.rb +22 -44
- data/lib/puppet/parameter.rb +3 -16
- data/lib/puppet/parameter/value.rb +1 -3
- data/lib/puppet/parameter/value_collection.rb +12 -11
- data/lib/puppet/parser.rb +12 -2
- data/lib/puppet/parser/ast.rb +9 -78
- data/lib/puppet/parser/ast/block_expression.rb +11 -36
- data/lib/puppet/parser/ast/branch.rb +15 -18
- data/lib/puppet/parser/ast/hostclass.rb +1 -3
- data/lib/puppet/parser/ast/leaf.rb +55 -212
- data/lib/puppet/parser/ast/node.rb +3 -11
- data/lib/puppet/parser/ast/pops_bridge.rb +2 -7
- data/lib/puppet/parser/ast/resource.rb +14 -20
- data/lib/puppet/parser/ast/resource_instance.rb +4 -7
- data/lib/puppet/parser/ast/resourceparam.rb +21 -22
- data/lib/puppet/parser/compiler.rb +41 -70
- data/lib/puppet/parser/e4_parser_adapter.rb +2 -23
- data/lib/puppet/parser/files.rb +22 -67
- data/lib/puppet/parser/functions.rb +1 -3
- data/lib/puppet/parser/functions/assert_type.rb +1 -2
- data/lib/puppet/parser/functions/contain.rb +5 -3
- data/lib/puppet/parser/functions/create_resources.rb +9 -1
- data/lib/puppet/parser/functions/defined.rb +33 -61
- data/lib/puppet/parser/functions/each.rb +1 -3
- data/lib/puppet/parser/functions/epp.rb +1 -2
- data/lib/puppet/parser/functions/file.rb +1 -3
- data/lib/puppet/parser/functions/filter.rb +1 -3
- data/lib/puppet/parser/functions/hiera.rb +4 -6
- data/lib/puppet/parser/functions/hiera_array.rb +4 -6
- data/lib/puppet/parser/functions/hiera_hash.rb +6 -8
- data/lib/puppet/parser/functions/hiera_include.rb +2 -10
- data/lib/puppet/parser/functions/include.rb +4 -2
- data/lib/puppet/parser/functions/lookup.rb +115 -105
- data/lib/puppet/parser/functions/map.rb +1 -3
- data/lib/puppet/parser/functions/match.rb +1 -2
- data/lib/puppet/parser/functions/realize.rb +1 -6
- data/lib/puppet/parser/functions/reduce.rb +1 -3
- data/lib/puppet/parser/functions/regsubst.rb +1 -57
- data/lib/puppet/parser/functions/require.rb +6 -4
- data/lib/puppet/parser/functions/scanf.rb +1 -1
- data/lib/puppet/parser/functions/slice.rb +1 -3
- data/lib/puppet/parser/functions/split.rb +1 -1
- data/lib/puppet/parser/functions/with.rb +1 -2
- data/lib/puppet/parser/parser_factory.rb +5 -21
- data/lib/puppet/parser/relationship.rb +14 -37
- data/lib/puppet/parser/resource.rb +11 -22
- data/lib/puppet/parser/scope.rb +45 -135
- data/lib/puppet/parser/templatewrapper.rb +1 -29
- data/lib/puppet/parser/type_loader.rb +12 -15
- data/lib/puppet/plugins.rb +9 -0
- data/lib/{puppetx/puppet/bindings_scheme_handler.rb → puppet/plugins/binding_schemes.rb} +14 -4
- data/lib/puppet/plugins/configuration.rb +68 -0
- data/lib/puppet/plugins/data_providers.rb +90 -0
- data/lib/{puppetx/puppet/syntax_checker.rb → puppet/plugins/syntax_checkers.rb} +14 -2
- data/lib/puppet/pops.rb +6 -7
- data/lib/puppet/pops/adaptable.rb +16 -5
- data/lib/puppet/pops/binder/binder.rb +5 -4
- data/lib/puppet/pops/binder/bindings_composer.rb +6 -4
- data/lib/puppet/pops/binder/bindings_factory.rb +4 -0
- data/lib/puppet/pops/binder/bindings_label_provider.rb +1 -1
- data/lib/puppet/pops/binder/bindings_loader.rb +3 -8
- data/lib/puppet/pops/binder/bindings_model_dumper.rb +36 -8
- data/lib/puppet/pops/binder/config/binder_config.rb +2 -2
- data/lib/puppet/pops/binder/config/binder_config_checker.rb +1 -1
- data/lib/puppet/pops/binder/config/issues.rb +4 -0
- data/lib/puppet/pops/binder/injector.rb +0 -1
- data/lib/puppet/pops/binder/scheme_handler/symbolic_scheme.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +18 -50
- data/lib/puppet/pops/evaluator/callable_mismatch_describer.rb +5 -5
- data/lib/puppet/pops/evaluator/callable_signature.rb +2 -2
- data/lib/puppet/pops/evaluator/closure.rb +16 -21
- data/lib/puppet/pops/evaluator/collector_transformer.rb +11 -1
- data/lib/puppet/pops/evaluator/compare_operator.rb +0 -43
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +1 -1
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +36 -152
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +6 -3
- data/lib/puppet/pops/evaluator/relationship_operator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +9 -57
- data/lib/puppet/pops/functions/dispatch.rb +1 -6
- data/lib/puppet/pops/issue_reporter.rb +16 -42
- data/lib/puppet/pops/issues.rb +13 -128
- data/lib/puppet/pops/loader/dependency_loader.rb +3 -3
- data/lib/puppet/pops/loader/loader.rb +21 -20
- data/lib/puppet/pops/loaders.rb +13 -8
- data/lib/puppet/pops/lookup.rb +96 -0
- data/lib/puppet/pops/merge_strategy.rb +283 -0
- data/lib/puppet/pops/model/ast_transformer.rb +4 -522
- data/lib/puppet/pops/model/factory.rb +20 -21
- data/lib/puppet/pops/model/model.rb +1 -1
- data/lib/puppet/pops/model/model_label_provider.rb +1 -1
- data/lib/puppet/pops/model/model_meta.rb +10 -7
- data/lib/puppet/pops/model/tree_dumper.rb +1 -1
- data/lib/puppet/pops/parser/egrammar.ra +1 -13
- data/lib/puppet/pops/parser/eparser.rb +1132 -1272
- data/lib/puppet/pops/parser/epp_support.rb +11 -22
- data/lib/puppet/pops/parser/evaluating_parser.rb +11 -10
- data/lib/puppet/pops/parser/heredoc_support.rb +12 -13
- data/lib/puppet/pops/parser/interpolation_support.rb +1 -7
- data/lib/puppet/pops/parser/lexer2.rb +33 -36
- data/lib/puppet/pops/parser/lexer_support.rb +20 -46
- data/lib/puppet/pops/parser/locator.rb +6 -30
- data/lib/puppet/pops/parser/parser_support.rb +14 -11
- data/lib/puppet/pops/parser/slurp_support.rb +6 -22
- data/lib/puppet/pops/patterns.rb +0 -3
- data/lib/puppet/pops/types/class_loader.rb +8 -8
- data/lib/puppet/pops/types/enumeration.rb +1 -1
- data/lib/puppet/pops/types/type_asserter.rb +45 -0
- data/lib/puppet/pops/types/type_assertion_error.rb +26 -0
- data/lib/puppet/pops/types/type_calculator.rb +110 -212
- data/lib/puppet/pops/types/type_factory.rb +15 -74
- data/lib/puppet/pops/types/type_parser.rb +15 -24
- data/lib/puppet/pops/types/types.rb +25 -35
- data/lib/puppet/pops/types/types_meta.rb +2 -13
- data/lib/puppet/pops/utils.rb +1 -1
- data/lib/puppet/pops/validation.rb +3 -26
- data/lib/puppet/pops/validation/checker4_0.rb +6 -56
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +1 -3
- data/lib/puppet/pops/visitor.rb +10 -7
- data/lib/puppet/property.rb +44 -124
- data/lib/puppet/provider.rb +0 -52
- data/lib/puppet/provider/aixobject.rb +2 -2
- data/lib/puppet/provider/augeas/augeas.rb +9 -6
- data/lib/puppet/provider/command.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +37 -0
- data/lib/puppet/provider/exec.rb +2 -16
- data/lib/puppet/provider/file/posix.rb +1 -1
- data/lib/puppet/provider/file/windows.rb +1 -1
- data/lib/puppet/provider/group/aix.rb +1 -1
- data/lib/puppet/provider/group/pw.rb +0 -1
- data/lib/puppet/provider/group/windows_adsi.rb +4 -18
- data/lib/puppet/provider/host/parsed.rb +4 -2
- data/lib/puppet/provider/macauthorization/macauthorization.rb +0 -12
- data/lib/puppet/provider/mailalias/aliases.rb +23 -12
- data/lib/puppet/provider/mount/parsed.rb +2 -145
- data/lib/puppet/provider/nameservice/directoryservice.rb +57 -131
- data/lib/puppet/provider/network_device.rb +3 -0
- data/lib/puppet/provider/package/appdmg.rb +5 -2
- data/lib/puppet/provider/package/apt.rb +1 -1
- data/lib/puppet/provider/package/fink.rb +1 -1
- data/lib/puppet/provider/package/openbsd.rb +26 -12
- data/lib/puppet/provider/package/opkg.rb +6 -1
- data/lib/puppet/provider/package/pacman.rb +159 -127
- data/lib/puppet/provider/package/pip.rb +1 -11
- data/lib/puppet/provider/package/pkg.rb +73 -29
- data/lib/puppet/provider/package/pkgdmg.rb +2 -2
- data/lib/puppet/provider/package/pkgin.rb +1 -1
- data/lib/puppet/provider/package/portage.rb +5 -1
- data/lib/puppet/provider/package/portupgrade.rb +0 -2
- data/lib/puppet/provider/package/rpm.rb +109 -0
- data/lib/puppet/provider/package/rug.rb +0 -1
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +121 -30
- data/lib/puppet/provider/package/zypper.rb +8 -17
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +7 -32
- data/lib/puppet/provider/service/base.rb +17 -3
- data/lib/puppet/provider/service/bsd.rb +1 -1
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/init.rb +0 -7
- data/lib/puppet/provider/service/launchd.rb +11 -89
- data/lib/puppet/provider/service/openbsd.rb +56 -298
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/service/systemd.rb +1 -0
- data/lib/puppet/provider/service/upstart.rb +4 -2
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +1 -1
- data/lib/puppet/provider/user/directoryservice.rb +40 -70
- data/lib/puppet/provider/user/hpux.rb +31 -2
- data/lib/puppet/provider/user/openbsd.rb +74 -0
- data/lib/puppet/provider/user/pw.rb +0 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -3
- data/lib/puppet/provider/user/windows_adsi.rb +2 -9
- data/lib/puppet/provider/yumrepo/inifile.rb +1 -3
- data/lib/puppet/provider/zfs/zfs.rb +3 -2
- data/lib/puppet/provider/zone/solaris.rb +3 -3
- data/lib/puppet/reference/configuration.rb +4 -3
- data/lib/puppet/reference/metaparameter.rb +0 -9
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +8 -10
- data/lib/puppet/relationship.rb +4 -17
- data/lib/puppet/resource.rb +132 -114
- data/lib/puppet/resource/catalog.rb +23 -30
- data/lib/puppet/resource/status.rb +74 -22
- data/lib/puppet/resource/type.rb +12 -52
- data/lib/puppet/resource/type_collection.rb +26 -73
- data/lib/puppet/settings.rb +94 -153
- data/lib/puppet/settings/base_setting.rb +6 -30
- data/lib/puppet/settings/config_file.rb +14 -11
- data/lib/puppet/settings/duration_setting.rb +1 -1
- data/lib/puppet/settings/environment_conf.rb +14 -12
- data/lib/puppet/settings/file_setting.rb +9 -10
- data/lib/puppet/settings/ttl_setting.rb +1 -3
- data/lib/puppet/ssl/certificate.rb +38 -8
- data/lib/puppet/ssl/certificate_authority/interface.rb +7 -1
- data/lib/puppet/ssl/certificate_factory.rb +3 -3
- data/lib/puppet/ssl/certificate_request.rb +36 -8
- data/lib/puppet/ssl/configuration.rb +2 -8
- data/lib/puppet/ssl/host.rb +1 -8
- data/lib/puppet/ssl/inventory.rb +0 -7
- data/lib/puppet/ssl/oids.rb +72 -3
- data/lib/puppet/ssl/validator/default_validator.rb +0 -1
- data/lib/puppet/status.rb +0 -5
- data/lib/puppet/syntax_checkers.rb +3 -0
- data/lib/{puppetx/puppetlabs → puppet}/syntax_checkers/json.rb +2 -2
- data/lib/puppet/test/test_helper.rb +11 -12
- data/lib/puppet/transaction.rb +12 -9
- data/lib/puppet/transaction/event.rb +4 -5
- data/lib/puppet/transaction/event_manager.rb +50 -5
- data/lib/puppet/transaction/report.rb +5 -10
- data/lib/puppet/transaction/resource_harness.rb +7 -2
- data/lib/puppet/type.rb +113 -29
- data/lib/puppet/type/augeas.rb +1 -0
- data/lib/puppet/type/exec.rb +2 -2
- data/lib/puppet/type/file.rb +8 -9
- data/lib/puppet/type/file/content.rb +19 -15
- data/lib/puppet/type/file/mode.rb +16 -11
- data/lib/puppet/type/file/selcontext.rb +1 -1
- data/lib/puppet/type/file/source.rb +15 -15
- data/lib/puppet/type/filebucket.rb +2 -2
- data/lib/puppet/type/group.rb +5 -17
- data/lib/puppet/type/host.rb +12 -3
- data/lib/puppet/type/k5login.rb +1 -1
- data/lib/puppet/type/mailalias.rb +20 -6
- data/lib/puppet/type/maillist.rb +1 -1
- data/lib/puppet/type/mount.rb +6 -16
- data/lib/puppet/type/notify.rb +1 -1
- data/lib/puppet/type/package.rb +91 -16
- data/lib/puppet/type/resources.rb +0 -7
- data/lib/puppet/type/router.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +0 -13
- data/lib/puppet/type/selboolean.rb +2 -2
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/type/ssh_authorized_key.rb +1 -1
- data/lib/puppet/type/sshkey.rb +1 -1
- data/lib/puppet/type/tidy.rb +4 -1
- data/lib/puppet/type/user.rb +16 -3
- data/lib/puppet/type/yumrepo.rb +26 -0
- data/lib/puppet/type/zfs.rb +1 -1
- data/lib/puppet/type/zpool.rb +1 -1
- data/lib/puppet/util.rb +2 -85
- data/lib/puppet/util/autoload.rb +3 -13
- data/lib/puppet/util/checksums.rb +59 -22
- data/lib/puppet/util/classgen.rb +1 -9
- data/lib/puppet/util/colors.rb +0 -117
- data/lib/puppet/util/command_line.rb +1 -23
- data/lib/puppet/util/errors.rb +2 -4
- data/lib/puppet/util/execution.rb +19 -22
- data/lib/puppet/util/feature.rb +2 -4
- data/lib/puppet/util/fileparsing.rb +3 -2
- data/lib/puppet/util/log.rb +13 -56
- data/lib/puppet/util/log/destinations.rb +17 -36
- data/lib/puppet/util/logging.rb +52 -37
- data/lib/puppet/util/metric.rb +0 -149
- data/lib/puppet/util/monkey_patches.rb +1 -94
- data/lib/puppet/util/network_device/base.rb +1 -5
- data/lib/puppet/util/network_device/cisco/interface.rb +2 -2
- data/lib/puppet/util/network_device/config.rb +0 -5
- data/lib/puppet/util/network_device/transport/ssh.rb +2 -2
- data/lib/puppet/util/profiler.rb +1 -1
- data/lib/puppet/util/profiler/aggregate.rb +1 -1
- data/lib/puppet/util/profiler/around_profiler.rb +1 -1
- data/lib/puppet/util/psych_support.rb +38 -0
- data/lib/puppet/util/rdoc.rb +6 -42
- data/lib/puppet/util/rdoc/code_objects.rb +5 -45
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +1 -1
- data/lib/puppet/util/rdoc/parser.rb +5 -15
- data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +8 -227
- data/lib/puppet/util/retry_action.rb +46 -0
- data/lib/puppet/util/run_mode.rb +31 -7
- data/lib/puppet/util/selinux.rb +2 -2
- data/lib/puppet/util/ssl.rb +11 -11
- data/lib/puppet/util/suidmanager.rb +4 -31
- data/lib/puppet/util/tag_set.rb +0 -11
- data/lib/puppet/util/tagging.rb +50 -19
- data/lib/puppet/util/warnings.rb +1 -0
- data/lib/puppet/util/windows/adsi.rb +13 -60
- data/lib/puppet/util/windows/api_types.rb +16 -2
- data/lib/puppet/util/windows/file.rb +2 -8
- data/lib/puppet/util/windows/process.rb +58 -0
- data/lib/puppet/util/windows/registry.rb +319 -31
- data/lib/puppet/util/windows/security.rb +1 -68
- data/lib/puppet/util/windows/taskscheduler.rb +0 -21
- data/lib/puppet/util/windows/user.rb +2 -3
- data/lib/puppet/vendor/deep_merge/CHANGELOG +45 -0
- data/lib/puppet/vendor/deep_merge/Gemfile +3 -0
- data/lib/puppet/vendor/deep_merge/LICENSE +21 -0
- data/lib/puppet/vendor/deep_merge/README.md +113 -0
- data/lib/puppet/vendor/deep_merge/Rakefile +19 -0
- data/lib/puppet/vendor/deep_merge/deep_merge.gemspec +35 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge.rb +2 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/core.rb +210 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb +28 -0
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/rails_compat.rb +27 -0
- data/lib/puppet/vendor/deep_merge/test/test_deep_merge.rb +608 -0
- data/lib/puppet/vendor/load_deep_merge.rb +1 -0
- data/lib/puppet/vendor/load_rgen.rb +1 -0
- data/lib/puppet/vendor/require_vendored.rb +1 -3
- data/lib/puppet/vendor/rgen_patch.rb +132 -0
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_x.rb +8 -0
- data/lib/semver.rb +0 -1
- data/man/man5/puppet.conf.5 +432 -287
- data/man/man8/extlookup2hiera.8 +2 -15
- data/man/man8/puppet-agent.8 +14 -14
- data/man/man8/puppet-apply.8 +29 -30
- data/man/man8/puppet-ca.8 +29 -17
- data/man/man8/puppet-catalog.8 +5 -34
- data/man/man8/puppet-cert.8 +8 -4
- data/man/man8/puppet-certificate.8 +15 -29
- data/man/man8/puppet-certificate_request.8 +9 -16
- data/man/man8/puppet-certificate_revocation_list.8 +5 -31
- data/man/man8/puppet-config.8 +52 -11
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +5 -16
- data/man/man8/puppet-doc.8 +7 -80
- data/man/man8/puppet-epp.8 +349 -0
- data/man/man8/puppet-facts.8 +5 -95
- data/man/man8/puppet-file.8 +2 -28
- data/man/man8/puppet-filebucket.8 +2 -2
- data/man/man8/puppet-help.8 +2 -2
- data/man/man8/puppet-inspect.8 +1 -1
- data/man/man8/puppet-key.8 +6 -3
- data/man/man8/puppet-man.8 +2 -2
- data/man/man8/puppet-master.8 +11 -7
- data/man/man8/puppet-module.8 +75 -49
- data/man/man8/puppet-node.8 +8 -56
- data/man/man8/puppet-parser.8 +38 -4
- data/man/man8/puppet-plugin.8 +2 -2
- data/man/man8/puppet-report.8 +8 -70
- data/man/man8/puppet-resource.8 +7 -3
- data/man/man8/puppet-resource_type.8 +2 -28
- data/man/man8/puppet-status.8 +5 -47
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/integration/provider/mailalias/aliases/test1 +3 -0
- data/spec/fixtures/integration/provider/sshkey/sample +21 -0
- data/spec/fixtures/unit/data_providers/environments/production/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/production/lib/puppet/functions/environment/data.rb +7 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb +9 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/lib/puppet/functions/abc/data.rb +8 -0
- data/spec/fixtures/unit/data_providers/environments/production/modules/abc/manifests/init.pp +9 -0
- data/spec/fixtures/unit/data_providers/environments/sample/environment.conf +2 -0
- data/spec/fixtures/unit/data_providers/environments/sample/manifests/site.pp +6 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet/bindings/dataprovider/default.rb +54 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_env_data.rb +31 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/lib/puppet_x/helindbe/sample_module_data.rb +32 -0
- data/spec/fixtures/unit/data_providers/environments/sample/modules/dataprovider/manifests/init.pp +5 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/environment.conf +2 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/lib/puppet/functions/environment/data.rb +11 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/abc/lib/puppet/bindings/abc/default.rb +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/abc/lib/puppet/functions/abc/data.rb +9 -0
- data/spec/fixtures/unit/functions/lookup/environments/production/modules/abc/manifests/init.pp +8 -0
- data/spec/fixtures/unit/parser/lexer/subclass_name_duplication.pp +0 -0
- data/spec/fixtures/unit/pops/binder/bindings_composer/ok/binder_config.yaml +1 -1
- data/spec/fixtures/unit/pops/binder/bindings_composer/ok/modules/awesome2/lib/{puppetx → puppet_x}/awesome2/echo_scheme_handler.rb +3 -3
- data/spec/fixtures/unit/pops/binder/config/binder_config/nolayer/binder_config.yaml +6 -0
- data/spec/fixtures/unit/pops/parser/lexer/subclass_name_duplication.pp +0 -0
- data/spec/fixtures/unit/provider/mount/parsed/aix.filesystems +85 -93
- data/spec/fixtures/unit/provider/mount/parsed/aix.mount +7 -11
- data/spec/fixtures/unit/provider/package/pkg/dummy_implicit_version +3 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris10 +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.certificate_warning +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.ifo.installed +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.ifo.known +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.installed +1 -1
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.known +1 -1
- data/spec/fixtures/unit/provider/package/pkg/incomplete +1 -1
- data/spec/fixtures/unit/provider/package/pkg/solaris11 +2 -2
- data/spec/fixtures/unit/provider/package/pkg/unknown_status +12 -12
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-multiline.txt +201 -0
- data/spec/fixtures/unit/provider/package/yum/yum-check-update-simple.txt +12 -0
- data/spec/fixtures/unit/provider/parsedfile/simple.txt +3 -0
- data/spec/fixtures/unit/provider/service/openbsd/rcctl_getall +6 -0
- data/spec/fixtures/unit/ssl/certificate/old-style-cert-exts.pem +33 -0
- data/spec/fixtures/unit/ssl/certificate_request/old-style-cert-request.pem +28 -0
- data/spec/integration/agent/logging_spec.rb +1 -5
- data/spec/integration/application/apply_spec.rb +1 -1
- data/spec/integration/application/doc_spec.rb +1 -43
- data/spec/integration/configurer_spec.rb +5 -5
- data/spec/integration/data_binding.rb +4 -0
- data/spec/integration/defaults_spec.rb +42 -143
- data/spec/integration/directory_environments_spec.rb +3 -3
- data/spec/integration/environments/default_manifest_spec.rb +3 -51
- data/spec/integration/environments/setting_hooks_spec.rb +1 -1
- data/spec/integration/environments/settings_interpolation_spec.rb +50 -105
- data/spec/integration/environments/settings_spec.rb +100 -0
- data/spec/integration/faces/ca_spec.rb +51 -51
- data/spec/integration/faces/documentation_spec.rb +6 -6
- data/spec/integration/file_bucket/file_spec.rb +5 -16
- data/spec/integration/file_serving/fileset_spec.rb +1 -1
- data/spec/integration/file_serving/terminus_helper_spec.rb +1 -1
- data/spec/integration/indirector/catalog/compiler_spec.rb +6 -6
- data/spec/integration/indirector/direct_file_server_spec.rb +40 -12
- data/spec/integration/indirector/facts/facter_spec.rb +1 -1
- data/spec/integration/indirector/file_content/file_server_spec.rb +23 -21
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +53 -0
- data/spec/integration/indirector/node/ldap_spec.rb +0 -0
- data/spec/integration/network/authconfig_spec.rb +26 -26
- data/spec/integration/network/formats_spec.rb +12 -12
- data/spec/integration/network/http/api/indirected_routes_spec.rb +56 -0
- data/spec/integration/node/environment_spec.rb +12 -15
- data/spec/integration/node/facts_spec.rb +3 -3
- data/spec/integration/node_spec.rb +8 -8
- data/spec/integration/parser/catalog_spec.rb +1 -32
- data/spec/integration/parser/class_spec.rb +0 -4
- data/spec/integration/parser/{collector_spec.rb → collection_spec.rb} +3 -27
- data/spec/integration/parser/compiler_spec.rb +769 -385
- data/spec/integration/parser/conditionals_spec.rb +2 -27
- data/spec/integration/parser/functions/require_spec.rb +8 -8
- data/spec/integration/parser/node_spec.rb +29 -42
- data/spec/integration/parser/resource_expressions_spec.rb +125 -210
- data/spec/integration/parser/scope_spec.rb +168 -319
- data/spec/integration/parser/undef_param_spec.rb +5 -5
- data/spec/integration/provider/cron/crontab_spec.rb +3 -3
- data/spec/integration/provider/mailalias/aliases_spec.rb +0 -0
- data/spec/integration/provider/mount_spec.rb +33 -28
- data/spec/integration/provider/package_spec.rb +3 -14
- data/spec/integration/provider/service/init_spec.rb +4 -4
- data/spec/integration/provider/service/systemd_spec.rb +3 -3
- data/spec/integration/provider/ssh_authorized_key_spec.rb +12 -12
- data/spec/integration/provider/sshkey_spec.rb +159 -0
- data/spec/integration/reference/providers_spec.rb +1 -1
- data/spec/integration/reports_spec.rb +1 -1
- data/spec/integration/resource/catalog_spec.rb +3 -3
- data/spec/integration/resource/type_collection_spec.rb +10 -25
- data/spec/integration/ssl/autosign_spec.rb +1 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +8 -8
- data/spec/integration/ssl/certificate_request_spec.rb +2 -2
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +0 -0
- data/spec/integration/ssl/host_spec.rb +7 -7
- data/spec/integration/transaction/report_spec.rb +0 -0
- data/spec/integration/transaction_spec.rb +86 -50
- data/spec/integration/type/exec_spec.rb +5 -5
- data/spec/integration/type/file_spec.rb +277 -280
- data/spec/integration/type/package_spec.rb +105 -6
- data/spec/integration/type/tidy_spec.rb +1 -1
- data/spec/integration/type/user_spec.rb +4 -4
- data/spec/integration/type_spec.rb +2 -2
- data/spec/integration/util/autoload_spec.rb +7 -12
- data/spec/integration/util/rdoc/parser_spec.rb +13 -99
- data/spec/integration/util/settings_spec.rb +1 -1
- data/spec/integration/util/windows/process_spec.rb +6 -6
- data/spec/integration/util/windows/security_spec.rb +79 -105
- data/spec/integration/util/windows/user_spec.rb +12 -12
- data/spec/integration/util_spec.rb +8 -8
- data/spec/lib/matchers/containment_matchers.rb +1 -1
- data/spec/lib/matchers/include.rb +3 -3
- data/spec/lib/matchers/include_in_order.rb +2 -2
- data/spec/lib/matchers/json.rb +5 -35
- data/spec/lib/matchers/match_tokens2.rb +1 -1
- data/spec/lib/matchers/relationship_graph_matchers.rb +1 -1
- data/spec/lib/matchers/resource.rb +8 -23
- data/spec/lib/puppet/face/1.0.0/huzzah.rb +2 -2
- data/spec/lib/puppet/face/basetest.rb +0 -0
- data/spec/lib/puppet/face/huzzah.rb +2 -2
- data/spec/lib/puppet/face/version_matching.rb +1 -1
- data/spec/lib/puppet/indirector_proxy.rb +34 -0
- data/spec/lib/puppet/indirector_testing.rb +1 -11
- data/spec/lib/puppet_spec/files.rb +1 -1
- data/spec/lib/puppet_spec/fixtures.rb +0 -0
- data/spec/lib/puppet_spec/handler.rb +53 -0
- data/spec/lib/puppet_spec/matchers.rb +12 -5
- data/spec/lib/puppet_spec/module_tool/shared_functions.rb +3 -3
- data/spec/lib/puppet_spec/modules.rb +11 -0
- data/spec/lib/puppet_spec/network.rb +101 -0
- data/spec/lib/puppet_spec/pops.rb +2 -2
- data/spec/lib/puppet_spec/settings.rb +17 -0
- data/spec/lib/puppet_spec/verbose.rb +0 -0
- data/spec/shared_behaviours/all_parsedfile_providers.rb +1 -1
- data/spec/shared_behaviours/an_indirector_face.rb +2 -2
- data/spec/shared_behaviours/documentation_on_faces.rb +46 -46
- data/spec/shared_behaviours/file_server_terminus.rb +1 -1
- data/spec/shared_behaviours/file_serving.rb +0 -0
- data/spec/shared_behaviours/hiera_indirections.rb +10 -10
- data/spec/shared_behaviours/iterative_functions.rb +1 -1
- data/spec/shared_behaviours/memory_terminus.rb +5 -5
- data/spec/shared_behaviours/path_parameters.rb +8 -8
- data/spec/shared_behaviours/store_configs_terminus.rb +3 -3
- data/spec/shared_behaviours/things_that_declare_options.rb +25 -25
- data/spec/shared_contexts/checksum.rb +62 -0
- data/spec/shared_contexts/{checksums.rb → digests.rb} +2 -2
- data/spec/spec_helper.rb +14 -5
- data/spec/unit/agent/disabler_spec.rb +3 -3
- data/spec/unit/agent/locker_spec.rb +9 -9
- data/spec/unit/agent_spec.rb +18 -18
- data/spec/unit/application/agent_spec.rb +25 -92
- data/spec/unit/application/apply_spec.rb +16 -16
- data/spec/unit/application/cert_spec.rb +15 -15
- data/spec/unit/application/certificate_spec.rb +2 -2
- data/spec/unit/application/config_spec.rb +1 -1
- data/spec/unit/application/describe_spec.rb +6 -6
- data/spec/unit/application/device_spec.rb +25 -63
- data/spec/unit/application/doc_spec.rb +22 -31
- data/spec/unit/application/face_base_spec.rb +88 -59
- data/spec/unit/application/facts_spec.rb +2 -11
- data/spec/unit/application/filebucket_spec.rb +7 -7
- data/spec/unit/application/indirection_base_spec.rb +0 -4
- data/spec/unit/application/inspect_spec.rb +21 -21
- data/spec/unit/application/master_spec.rb +8 -9
- data/spec/unit/application/resource_spec.rb +27 -79
- data/spec/unit/application_spec.rb +54 -58
- data/spec/unit/configurer/downloader_factory_spec.rb +0 -0
- data/spec/unit/configurer/downloader_spec.rb +26 -20
- data/spec/unit/configurer/fact_handler_spec.rb +19 -12
- data/spec/unit/configurer/plugin_handler_spec.rb +0 -0
- data/spec/unit/configurer_spec.rb +44 -44
- data/spec/unit/confine/exists_spec.rb +10 -10
- data/spec/unit/confine/false_spec.rb +7 -7
- data/spec/unit/confine/feature_spec.rb +7 -7
- data/spec/unit/confine/true_spec.rb +7 -7
- data/spec/unit/confine/variable_spec.rb +13 -13
- data/spec/unit/confine_collection_spec.rb +12 -12
- data/spec/unit/confine_spec.rb +10 -10
- data/spec/unit/confiner_spec.rb +8 -8
- data/spec/unit/context/trusted_information_spec.rb +9 -2
- data/spec/unit/daemon_spec.rb +10 -21
- data/spec/unit/data_binding_spec.rb +1 -1
- data/spec/unit/data_providers/function_data_provider_spec.rb +96 -0
- data/spec/unit/data_providers/sample_data_provider_spec.rb +52 -0
- data/spec/unit/defaults_spec.rb +6 -6
- data/spec/unit/environments_spec.rb +4 -6
- data/spec/unit/{util → external}/pson_spec.rb +15 -25
- data/spec/unit/face/catalog_spec.rb +0 -0
- data/spec/unit/face/certificate_spec.rb +19 -19
- data/spec/unit/face/config_spec.rb +2 -7
- data/spec/unit/face/epp_face_spec.rb +303 -0
- data/spec/unit/face/facts_spec.rb +1 -15
- data/spec/unit/face/file_spec.rb +3 -5
- data/spec/unit/face/help_spec.rb +17 -16
- data/spec/unit/face/module/build_spec.rb +2 -2
- data/spec/unit/face/module/list_spec.rb +11 -11
- data/spec/unit/face/module/search_spec.rb +17 -17
- data/spec/unit/face/node_spec.rb +4 -122
- data/spec/unit/face/parser_spec.rb +1 -1
- data/spec/unit/face/plugin_spec.rb +2 -2
- data/spec/unit/face_spec.rb +0 -0
- data/spec/unit/file_bucket/dipper_spec.rb +23 -23
- data/spec/unit/file_bucket/file_spec.rb +12 -28
- data/spec/unit/file_serving/base_spec.rb +26 -26
- data/spec/unit/file_serving/configuration/parser_spec.rb +10 -10
- data/spec/unit/file_serving/configuration_spec.rb +17 -17
- data/spec/unit/file_serving/content_spec.rb +19 -31
- data/spec/unit/file_serving/fileset_spec.rb +32 -33
- data/spec/unit/file_serving/metadata_spec.rb +115 -71
- data/spec/unit/file_serving/mount/file_spec.rb +15 -15
- data/spec/unit/file_serving/mount/modules_spec.rb +2 -2
- data/spec/unit/file_serving/mount/pluginfacts_spec.rb +5 -5
- data/spec/unit/file_serving/mount/plugins_spec.rb +5 -5
- data/spec/unit/file_serving/mount_spec.rb +5 -5
- data/spec/unit/file_serving/terminus_helper_spec.rb +19 -0
- data/spec/unit/file_serving/terminus_selector_spec.rb +6 -6
- data/spec/unit/file_system/uniquefile_spec.rb +2 -2
- data/spec/unit/file_system_spec.rb +79 -117
- data/spec/unit/forge/errors_spec.rb +8 -8
- data/spec/unit/forge/module_release_spec.rb +2 -4
- data/spec/unit/forge/repository_spec.rb +38 -44
- data/spec/unit/forge_spec.rb +1 -1
- data/spec/unit/functions/assert_type_spec.rb +1 -1
- data/spec/unit/functions/each_spec.rb +19 -23
- data/spec/unit/functions/epp_spec.rb +9 -17
- data/spec/unit/functions/filter_spec.rb +0 -22
- data/spec/unit/functions/hiera_spec.rb +18 -24
- data/spec/unit/functions/inline_epp_spec.rb +8 -16
- data/spec/unit/functions/lookup_spec.rb +324 -0
- data/spec/unit/functions/map_spec.rb +1 -7
- data/spec/unit/functions/reduce_spec.rb +0 -11
- data/spec/unit/functions/regsubst_spec.rb +94 -0
- data/spec/unit/functions/scanf_spec.rb +0 -4
- data/spec/unit/functions/slice_spec.rb +0 -12
- data/spec/unit/functions/split_spec.rb +46 -0
- data/spec/unit/functions/with_spec.rb +4 -13
- data/spec/unit/functions4_spec.rb +57 -162
- data/spec/unit/graph/rb_tree_map_spec.rb +78 -78
- data/spec/unit/graph/relationship_graph_spec.rb +17 -17
- data/spec/unit/graph/{simple_graph.rb → simple_graph_spec.rb} +122 -126
- data/spec/unit/hiera/scope_spec.rb +13 -12
- data/spec/unit/hiera_puppet_spec.rb +12 -12
- data/spec/unit/indirector/catalog/compiler_spec.rb +10 -15
- data/spec/unit/indirector/catalog/json_spec.rb +2 -2
- data/spec/unit/indirector/catalog/msgpack_spec.rb +2 -2
- data/spec/unit/indirector/catalog/rest_spec.rb +1 -1
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +14 -14
- data/spec/unit/indirector/catalog/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/catalog/yaml_spec.rb +4 -4
- data/spec/unit/indirector/certificate/ca_spec.rb +3 -3
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate/file_spec.rb +3 -3
- data/spec/unit/indirector/certificate/rest_spec.rb +6 -6
- data/spec/unit/indirector/certificate_request/ca_spec.rb +8 -8
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_request/file_spec.rb +2 -2
- data/spec/unit/indirector/certificate_request/rest_spec.rb +4 -4
- data/spec/unit/indirector/certificate_revocation_list/ca_spec.rb +2 -2
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/certificate_revocation_list/file_spec.rb +2 -2
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +4 -4
- data/spec/unit/indirector/certificate_status/file_spec.rb +18 -18
- data/spec/unit/indirector/certificate_status/rest_spec.rb +2 -2
- data/spec/unit/indirector/code_spec.rb +3 -3
- data/spec/unit/indirector/data_binding/hiera_spec.rb +3 -3
- data/spec/unit/indirector/data_binding/none_spec.rb +5 -5
- data/spec/unit/indirector/direct_file_server_spec.rb +14 -4
- data/spec/unit/indirector/envelope_spec.rb +4 -4
- data/spec/unit/indirector/exec_spec.rb +4 -4
- data/spec/unit/indirector/face_spec.rb +13 -8
- data/spec/unit/indirector/facts/facter_spec.rb +10 -20
- data/spec/unit/indirector/facts/network_device_spec.rb +10 -20
- data/spec/unit/indirector/facts/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/facts/yaml_spec.rb +6 -6
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +34 -34
- data/spec/unit/indirector/file_bucket_file/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_content/file_server_spec.rb +2 -2
- data/spec/unit/indirector/file_content/file_spec.rb +2 -2
- data/spec/unit/indirector/file_content/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_metadata/file_server_spec.rb +2 -2
- data/spec/unit/indirector/file_metadata/file_spec.rb +13 -5
- data/spec/unit/indirector/file_metadata/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_server_spec.rb +35 -17
- data/spec/unit/indirector/indirection_spec.rb +56 -56
- data/spec/unit/indirector/json_spec.rb +15 -16
- data/spec/unit/indirector/key/ca_spec.rb +3 -3
- data/spec/unit/indirector/key/disabled_ca_spec.rb +0 -0
- data/spec/unit/indirector/key/file_spec.rb +5 -5
- data/spec/unit/indirector/ldap_spec.rb +13 -13
- data/spec/unit/indirector/memory_spec.rb +0 -0
- data/spec/unit/indirector/msgpack_spec.rb +15 -15
- data/spec/unit/indirector/node/exec_spec.rb +20 -9
- data/spec/unit/indirector/node/ldap_spec.rb +48 -48
- data/spec/unit/indirector/node/memory_spec.rb +0 -0
- data/spec/unit/indirector/node/msgpack_spec.rb +4 -4
- data/spec/unit/indirector/node/plain_spec.rb +2 -2
- 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 +4 -4
- data/spec/unit/indirector/none_spec.rb +2 -2
- data/spec/unit/indirector/plain_spec.rb +1 -1
- data/spec/unit/indirector/report/msgpack_spec.rb +5 -5
- data/spec/unit/indirector/report/processor_spec.rb +4 -4
- data/spec/unit/indirector/report/rest_spec.rb +8 -8
- data/spec/unit/indirector/report/yaml_spec.rb +5 -5
- data/spec/unit/indirector/request_spec.rb +103 -206
- data/spec/unit/indirector/resource/ral_spec.rb +8 -10
- data/spec/unit/indirector/resource/store_configs_spec.rb +2 -4
- data/spec/unit/indirector/resource_type/parser_spec.rb +37 -37
- data/spec/unit/indirector/resource_type/rest_spec.rb +2 -2
- data/spec/unit/indirector/rest_spec.rb +70 -55
- data/spec/unit/indirector/ssl_file_spec.rb +13 -13
- data/spec/unit/indirector/status/rest_spec.rb +1 -1
- data/spec/unit/indirector/store_configs_spec.rb +0 -0
- data/spec/unit/indirector/terminus_spec.rb +17 -17
- data/spec/unit/indirector/yaml_spec.rb +12 -12
- data/spec/unit/indirector_spec.rb +7 -7
- data/spec/unit/interface/action_builder_spec.rb +15 -15
- data/spec/unit/interface/action_manager_spec.rb +31 -56
- data/spec/unit/interface/action_spec.rb +62 -65
- data/spec/unit/interface/documentation_spec.rb +2 -2
- data/spec/unit/interface/face_collection_spec.rb +33 -33
- data/spec/unit/interface/option_builder_spec.rb +8 -8
- data/spec/unit/interface/option_spec.rb +23 -23
- data/spec/unit/interface_spec.rb +19 -24
- data/spec/unit/man_spec.rb +0 -0
- data/spec/unit/module_spec.rb +163 -115
- data/spec/unit/module_tool/applications/builder_spec.rb +0 -19
- data/spec/unit/module_tool/applications/installer_spec.rb +29 -29
- data/spec/unit/module_tool/applications/searcher_spec.rb +4 -4
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +15 -15
- data/spec/unit/module_tool/applications/unpacker_spec.rb +3 -3
- data/spec/unit/module_tool/applications/upgrader_spec.rb +28 -28
- data/spec/unit/module_tool/install_directory_spec.rb +3 -3
- data/spec/unit/module_tool/metadata_spec.rb +26 -26
- data/spec/unit/module_tool/tar/gnu_spec.rb +1 -1
- data/spec/unit/module_tool/tar/mini_spec.rb +2 -2
- data/spec/unit/module_tool/tar_spec.rb +2 -2
- data/spec/unit/module_tool_spec.rb +13 -34
- data/spec/unit/network/auth_config_parser_spec.rb +7 -7
- data/spec/unit/network/authconfig_spec.rb +9 -9
- data/spec/unit/network/authstore_spec.rb +38 -39
- data/spec/unit/network/format_handler_spec.rb +14 -14
- data/spec/unit/network/format_spec.rb +34 -34
- data/spec/unit/network/format_support_spec.rb +10 -10
- data/spec/unit/network/formats_spec.rb +50 -136
- data/spec/unit/network/http/api/ca/v1_spec.rb +26 -0
- data/spec/unit/network/http/api/{v1_spec.rb → indirected_routes_spec.rb} +128 -184
- data/spec/unit/network/http/api/{v2 → master/v3}/authorization_spec.rb +23 -21
- data/spec/unit/network/http/api/{v2 → master/v3}/environments_spec.rb +5 -5
- data/spec/unit/network/http/api/master/v3_spec.rb +39 -0
- data/spec/unit/network/http/api_spec.rb +127 -0
- data/spec/unit/network/http/compression_spec.rb +20 -26
- data/spec/unit/network/http/connection_spec.rb +2 -5
- data/spec/unit/network/http/factory_spec.rb +6 -8
- data/spec/unit/network/http/handler_spec.rb +31 -84
- 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 +38 -39
- data/spec/unit/network/http/rack_spec.rb +1 -1
- data/spec/unit/network/http/route_spec.rb +3 -3
- data/spec/unit/network/http/session_spec.rb +4 -4
- data/spec/unit/network/http/site_spec.rb +1 -1
- data/spec/unit/network/http/webrick/rest_spec.rb +36 -55
- data/spec/unit/network/http/webrick_spec.rb +16 -27
- data/spec/unit/network/http_pool_spec.rb +11 -11
- data/spec/unit/network/http_spec.rb +0 -0
- data/spec/unit/network/resolver_spec.rb +10 -10
- data/spec/unit/network/rights_spec.rb +67 -67
- data/spec/unit/network/server_spec.rb +3 -3
- data/spec/unit/node/environment_spec.rb +177 -273
- data/spec/unit/node/facts_spec.rb +71 -33
- data/spec/unit/node_spec.rb +150 -158
- data/spec/unit/other/selinux_spec.rb +6 -6
- data/spec/unit/parameter/boolean_spec.rb +4 -3
- data/spec/unit/parameter/package_options_spec.rb +5 -5
- data/spec/unit/parameter/path_spec.rb +1 -1
- data/spec/unit/parameter/value_collection_spec.rb +23 -28
- data/spec/unit/parameter/value_spec.rb +20 -24
- data/spec/unit/parameter_spec.rb +26 -26
- data/spec/unit/parser/ast/block_expression_spec.rb +3 -2
- data/spec/unit/parser/ast/leaf_spec.rb +5 -378
- data/spec/unit/parser/compiler_spec.rb +84 -74
- data/spec/unit/parser/files_spec.rb +55 -121
- data/spec/unit/parser/functions/contain_spec.rb +8 -11
- data/spec/unit/parser/functions/create_resources_spec.rb +29 -29
- data/spec/unit/parser/functions/defined_spec.rb +52 -51
- data/spec/unit/parser/functions/digest_spec.rb +2 -2
- data/spec/unit/parser/functions/fail_spec.rb +1 -1
- data/spec/unit/parser/functions/file_spec.rb +7 -13
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +5 -5
- data/spec/unit/parser/functions/generate_spec.rb +20 -20
- data/spec/unit/parser/functions/hiera_array_spec.rb +2 -16
- data/spec/unit/parser/functions/hiera_hash_spec.rb +2 -12
- data/spec/unit/parser/functions/hiera_include_spec.rb +2 -29
- data/spec/unit/parser/functions/hiera_spec.rb +2 -12
- data/spec/unit/parser/functions/include_spec.rb +9 -19
- data/spec/unit/parser/functions/inline_template_spec.rb +3 -3
- data/spec/unit/parser/functions/lookup_spec.rb +3 -140
- data/spec/unit/parser/functions/realize_spec.rb +0 -0
- data/spec/unit/parser/functions/regsubst_spec.rb +7 -179
- data/spec/unit/parser/functions/require_spec.rb +14 -21
- data/spec/unit/parser/functions/scanf_spec.rb +0 -0
- data/spec/unit/parser/functions/shellquote_spec.rb +20 -20
- data/spec/unit/parser/functions/split_spec.rb +2 -37
- data/spec/unit/parser/functions/sprintf_spec.rb +7 -11
- data/spec/unit/parser/functions/tag_spec.rb +3 -3
- data/spec/unit/parser/functions/template_spec.rb +10 -10
- data/spec/unit/parser/functions/versioncmp_spec.rb +3 -3
- data/spec/unit/parser/functions_spec.rb +8 -8
- data/spec/unit/parser/relationship_spec.rb +14 -32
- data/spec/unit/parser/resource/param_spec.rb +0 -0
- data/spec/unit/parser/resource_spec.rb +57 -57
- data/spec/unit/parser/scope_spec.rb +89 -101
- data/spec/unit/parser/templatewrapper_spec.rb +15 -32
- data/spec/unit/parser/type_loader_spec.rb +53 -73
- data/spec/unit/pops/adaptable_spec.rb +22 -22
- data/spec/unit/pops/binder/bindings_checker_spec.rb +14 -14
- data/spec/unit/pops/binder/bindings_composer_spec.rb +4 -6
- data/spec/unit/pops/binder/bindings_validator_factory_spec.rb +3 -3
- data/spec/unit/pops/binder/config/binder_config_spec.rb +8 -1
- data/spec/unit/pops/binder/injector_spec.rb +92 -92
- data/spec/unit/pops/containment_spec.rb +4 -4
- data/spec/unit/pops/evaluator/access_ops_spec.rb +5 -24
- data/spec/unit/pops/evaluator/arithmetic_ops_spec.rb +23 -23
- data/spec/unit/pops/evaluator/basic_expressions_spec.rb +22 -22
- data/spec/unit/pops/evaluator/collections_ops_spec.rb +1 -3
- data/spec/unit/pops/evaluator/comparison_ops_spec.rb +104 -107
- data/spec/unit/pops/evaluator/conditionals_spec.rb +39 -39
- data/spec/unit/pops/evaluator/evaluating_parser_spec.rb +75 -143
- data/spec/unit/pops/evaluator/evaluator_rspec_helper.rb +1 -5
- data/spec/unit/pops/evaluator/logical_ops_spec.rb +15 -15
- data/spec/unit/pops/evaluator/string_interpolation_spec.rb +5 -5
- data/spec/unit/pops/evaluator/variables_spec.rb +18 -18
- data/spec/unit/pops/factory_rspec_helper.rb +0 -8
- data/spec/unit/pops/factory_spec.rb +104 -104
- data/spec/unit/pops/issues_spec.rb +21 -21
- data/spec/unit/pops/label_provider_spec.rb +6 -6
- data/spec/unit/pops/loaders/loaders_spec.rb +3 -3
- data/spec/unit/pops/model/model_spec.rb +10 -10
- data/spec/unit/pops/parser/epp_parser_spec.rb +20 -20
- data/spec/unit/pops/parser/evaluating_parser_spec.rb +2 -2
- data/spec/unit/pops/parser/lexer2_spec.rb +65 -276
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +91 -91
- data/spec/unit/pops/parser/parse_calls_spec.rb +19 -19
- data/spec/unit/pops/parser/parse_conditionals_spec.rb +38 -22
- data/spec/unit/pops/parser/parse_containers_spec.rb +47 -47
- data/spec/unit/pops/parser/parse_heredoc_spec.rb +15 -62
- data/spec/unit/pops/parser/parse_resource_spec.rb +75 -70
- data/spec/unit/pops/parser/parser_rspec_helper.rb +0 -5
- data/spec/unit/pops/parser/parser_spec.rb +7 -7
- data/spec/unit/pops/parser/parsing_typed_parameters_spec.rb +0 -7
- data/spec/unit/pops/parser/rgen_sanitycheck_spec.rb +2 -2
- data/spec/unit/pops/types/class_loader_spec.rb +10 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +456 -651
- data/spec/unit/pops/types/type_factory_spec.rb +59 -59
- data/spec/unit/pops/types/type_parser_spec.rb +2 -10
- data/spec/unit/pops/validator/validator_spec.rb +3 -57
- data/spec/unit/pops/visitor_spec.rb +4 -4
- data/spec/unit/property/boolean_spec.rb +2 -2
- data/spec/unit/property/ensure_spec.rb +1 -1
- data/spec/unit/property/keyvalue_spec.rb +16 -16
- data/spec/unit/property/list_spec.rb +18 -18
- data/spec/unit/property/ordered_list_spec.rb +7 -7
- data/spec/unit/property_spec.rb +72 -96
- data/spec/unit/provider/aixobject_spec.rb +12 -12
- data/spec/unit/provider/augeas/augeas_spec.rb +171 -149
- data/spec/unit/provider/cisco_spec.rb +2 -2
- data/spec/unit/provider/command_spec.rb +1 -1
- data/spec/unit/provider/cron/crontab_spec.rb +9 -9
- data/spec/unit/provider/cron/parsed_spec.rb +59 -38
- data/spec/unit/provider/exec/posix_spec.rb +9 -19
- data/spec/unit/provider/exec/shell_spec.rb +13 -13
- data/spec/unit/provider/exec/windows_spec.rb +10 -10
- data/spec/unit/provider/exec_spec.rb +2 -2
- data/spec/unit/provider/file/posix_spec.rb +27 -27
- data/spec/unit/provider/file/windows_spec.rb +15 -15
- data/spec/unit/provider/group/groupadd_spec.rb +1 -1
- data/spec/unit/provider/group/ldap_spec.rb +11 -11
- data/spec/unit/provider/group/pw_spec.rb +3 -3
- data/spec/unit/provider/group/windows_adsi_spec.rb +48 -62
- data/spec/unit/provider/host/parsed_spec.rb +58 -22
- data/spec/unit/provider/interface/cisco_spec.rb +3 -3
- data/spec/unit/provider/ldap_spec.rb +23 -23
- data/spec/unit/provider/macauthorization_spec.rb +6 -6
- data/spec/unit/provider/mcx/mcxcontent_spec.rb +6 -6
- data/spec/unit/provider/mount/parsed_spec.rb +101 -119
- data/spec/unit/provider/mount_spec.rb +0 -0
- data/spec/unit/provider/naginator_spec.rb +8 -8
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +5 -27
- data/spec/unit/provider/nameservice_spec.rb +26 -26
- data/spec/unit/provider/network_device_spec.rb +11 -11
- data/spec/unit/provider/package/aix_spec.rb +3 -3
- data/spec/unit/provider/package/appdmg_spec.rb +1 -1
- data/spec/unit/provider/package/apt_spec.rb +4 -4
- data/spec/unit/provider/package/aptitude_spec.rb +1 -1
- data/spec/unit/provider/package/aptrpm_spec.rb +3 -3
- data/spec/unit/provider/package/dpkg_spec.rb +0 -0
- data/spec/unit/provider/package/freebsd_spec.rb +1 -1
- data/spec/unit/provider/package/gem_spec.rb +12 -12
- data/spec/unit/provider/package/hpux_spec.rb +3 -3
- data/spec/unit/provider/package/macports_spec.rb +15 -15
- data/spec/unit/provider/package/nim_spec.rb +11 -11
- data/spec/unit/provider/package/openbsd_spec.rb +72 -37
- data/spec/unit/provider/package/opkg_spec.rb +14 -11
- data/spec/unit/provider/package/pacman_spec.rb +185 -86
- data/spec/unit/provider/package/pip_spec.rb +25 -54
- data/spec/unit/provider/package/pkg_spec.rb +145 -71
- data/spec/unit/provider/package/pkgdmg_spec.rb +9 -9
- data/spec/unit/provider/package/pkgin_spec.rb +18 -18
- data/spec/unit/provider/package/pkgutil_spec.rb +19 -19
- data/spec/unit/provider/package/portage_spec.rb +8 -4
- data/spec/unit/provider/package/rpm_spec.rb +103 -9
- data/spec/unit/provider/package/sun_spec.rb +14 -14
- data/spec/unit/provider/package/up2date_spec.rb +1 -1
- data/spec/unit/provider/package/{urpmi.rb → urpmi_spec.rb} +3 -3
- data/spec/unit/provider/package/windows/exe_package_spec.rb +15 -13
- data/spec/unit/provider/package/windows/msi_package_spec.rb +16 -16
- data/spec/unit/provider/package/windows/package_spec.rb +14 -14
- data/spec/unit/provider/package/windows_spec.rb +26 -26
- data/spec/unit/provider/package/yum_spec.rb +292 -98
- data/spec/unit/provider/package/zypper_spec.rb +20 -31
- data/spec/unit/provider/parsedfile_spec.rb +9 -9
- data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +192 -434
- data/spec/unit/provider/selboolean_spec.rb +2 -2
- data/spec/unit/provider/selmodule_spec.rb +8 -8
- data/spec/unit/provider/service/base_spec.rb +27 -38
- data/spec/unit/provider/service/daemontools_spec.rb +11 -11
- data/spec/unit/provider/service/debian_spec.rb +8 -8
- data/spec/unit/provider/service/freebsd_spec.rb +7 -8
- data/spec/unit/provider/service/gentoo_spec.rb +12 -13
- data/spec/unit/provider/service/init_spec.rb +25 -38
- data/spec/unit/provider/service/launchd_spec.rb +19 -125
- data/spec/unit/provider/service/openbsd_spec.rb +90 -144
- data/spec/unit/provider/service/openrc_spec.rb +14 -14
- data/spec/unit/provider/service/openwrt_spec.rb +9 -9
- data/spec/unit/provider/service/redhat_spec.rb +14 -15
- data/spec/unit/provider/service/runit_spec.rb +11 -11
- data/spec/unit/provider/service/smf_spec.rb +19 -19
- data/spec/unit/provider/service/src_spec.rb +9 -9
- data/spec/unit/provider/service/systemd_spec.rb +33 -15
- data/spec/unit/provider/service/upstart_spec.rb +59 -59
- data/spec/unit/provider/service/windows_spec.rb +6 -6
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +18 -18
- data/spec/unit/provider/sshkey/parsed_spec.rb +11 -11
- data/spec/unit/provider/user/aix_spec.rb +19 -19
- data/spec/unit/provider/user/directoryservice_spec.rb +51 -95
- data/spec/unit/provider/user/hpux_spec.rb +24 -3
- data/spec/unit/provider/user/ldap_spec.rb +12 -12
- data/spec/unit/provider/user/openbsd_spec.rb +77 -0
- data/spec/unit/provider/user/pw_spec.rb +5 -5
- data/spec/unit/provider/user/user_role_add_spec.rb +20 -20
- data/spec/unit/provider/user/useradd_spec.rb +48 -32
- data/spec/unit/provider/user/windows_adsi_spec.rb +9 -31
- data/spec/unit/provider/vlan/cisco_spec.rb +3 -3
- data/spec/unit/provider/yumrepo/inifile_spec.rb +3 -3
- data/spec/unit/provider/zfs/zfs_spec.rb +11 -11
- data/spec/unit/provider/zone/solaris_spec.rb +22 -55
- data/spec/unit/provider/zpool/zpool_spec.rb +22 -22
- data/spec/unit/provider_spec.rb +110 -102
- data/spec/unit/puppet_spec.rb +15 -8
- data/spec/unit/relationship_spec.rb +37 -41
- data/spec/unit/reports/http_spec.rb +0 -0
- data/spec/unit/reports/store_spec.rb +3 -3
- data/spec/unit/reports_spec.rb +5 -5
- data/spec/unit/resource/catalog_spec.rb +93 -111
- data/spec/unit/resource/status_spec.rb +49 -75
- data/spec/unit/resource/type_collection_helper_spec.rb +1 -1
- data/spec/unit/resource/type_collection_spec.rb +59 -164
- data/spec/unit/resource/type_spec.rb +115 -120
- data/spec/unit/resource_spec.rb +176 -159
- data/spec/unit/scheduler/job_spec.rb +12 -12
- data/spec/unit/scheduler/scheduler_spec.rb +8 -8
- data/spec/unit/scheduler/splay_job_spec.rb +4 -4
- data/spec/unit/semver_spec.rb +66 -64
- data/spec/unit/settings/autosign_setting_spec.rb +1 -0
- data/spec/unit/settings/config_file_spec.rb +13 -40
- data/spec/unit/settings/directory_setting_spec.rb +1 -1
- data/spec/unit/settings/duration_setting_spec.rb +9 -5
- data/spec/unit/settings/environment_conf_spec.rb +0 -11
- data/spec/unit/settings/file_setting_spec.rb +38 -69
- data/spec/unit/settings/ini_file_spec.rb +2 -2
- data/spec/unit/settings/path_setting_spec.rb +5 -5
- data/spec/unit/settings/priority_setting_spec.rb +7 -7
- data/spec/unit/settings/string_setting_spec.rb +7 -7
- data/spec/unit/settings/terminus_setting_spec.rb +4 -4
- data/spec/unit/settings/value_translator_spec.rb +22 -22
- data/spec/unit/settings_spec.rb +189 -338
- data/spec/unit/ssl/base_spec.rb +5 -5
- data/spec/unit/ssl/certificate_authority/autosign_command_spec.rb +2 -2
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +40 -13
- data/spec/unit/ssl/certificate_authority_spec.rb +23 -23
- data/spec/unit/ssl/certificate_factory_spec.rb +39 -26
- data/spec/unit/ssl/certificate_request_attributes_spec.rb +2 -2
- data/spec/unit/ssl/certificate_request_spec.rb +52 -40
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +10 -10
- data/spec/unit/ssl/certificate_spec.rb +35 -38
- data/spec/unit/ssl/configuration_spec.rb +12 -14
- data/spec/unit/ssl/digest_spec.rb +5 -5
- data/spec/unit/ssl/host_spec.rb +91 -91
- data/spec/unit/ssl/inventory_spec.rb +11 -34
- data/spec/unit/ssl/key_spec.rb +23 -23
- data/spec/unit/ssl/oids_spec.rb +28 -15
- data/spec/unit/ssl/validator_spec.rb +16 -17
- data/spec/unit/status_spec.rb +6 -12
- data/spec/unit/transaction/additional_resource_generator_spec.rb +2 -2
- data/spec/unit/transaction/event_manager_spec.rb +38 -8
- data/spec/unit/transaction/event_spec.rb +29 -29
- data/spec/unit/transaction/report_spec.rb +76 -90
- data/spec/unit/transaction/resource_harness_spec.rb +42 -42
- data/spec/unit/transaction_spec.rb +66 -59
- data/spec/unit/type/augeas_spec.rb +20 -20
- data/spec/unit/type/component_spec.rb +10 -10
- data/spec/unit/type/computer_spec.rb +10 -10
- data/spec/unit/type/cron_spec.rb +21 -21
- data/spec/unit/type/exec_spec.rb +65 -73
- data/spec/unit/type/file/checksum_spec.rb +8 -8
- data/spec/unit/type/file/content_spec.rb +144 -85
- data/spec/unit/type/file/ctime_spec.rb +4 -4
- data/spec/unit/type/file/ensure_spec.rb +11 -11
- data/spec/unit/type/file/group_spec.rb +5 -5
- data/spec/unit/type/file/mode_spec.rb +30 -28
- data/spec/unit/type/file/mtime_spec.rb +4 -4
- data/spec/unit/type/file/owner_spec.rb +5 -5
- data/spec/unit/type/file/selinux_spec.rb +8 -8
- data/spec/unit/type/file/source_spec.rb +118 -135
- data/spec/unit/type/file/type_spec.rb +2 -2
- data/spec/unit/type/file_spec.rb +161 -160
- data/spec/unit/type/filebucket_spec.rb +8 -8
- data/spec/unit/type/group_spec.rb +12 -12
- data/spec/unit/type/host_spec.rb +41 -25
- data/spec/unit/type/interface_spec.rb +6 -6
- data/spec/unit/type/k5login_spec.rb +18 -18
- data/spec/unit/type/macauthorization_spec.rb +17 -17
- data/spec/unit/type/mailalias_spec.rb +34 -6
- data/spec/unit/type/maillist_spec.rb +2 -2
- data/spec/unit/type/mcx_spec.rb +13 -13
- data/spec/unit/type/mount_spec.rb +40 -40
- data/spec/unit/type/nagios_spec.rb +23 -23
- data/spec/unit/type/noop_metaparam_spec.rb +5 -5
- data/spec/unit/type/package/package_settings_spec.rb +9 -9
- data/spec/unit/type/package_spec.rb +87 -18
- data/spec/unit/type/resources_spec.rb +46 -46
- data/spec/unit/type/schedule_spec.rb +83 -83
- data/spec/unit/type/scheduled_task_spec.rb +15 -15
- data/spec/unit/type/selboolean_spec.rb +2 -2
- data/spec/unit/type/selmodule_spec.rb +2 -2
- data/spec/unit/type/service_spec.rb +24 -24
- data/spec/unit/type/ssh_authorized_key_spec.rb +2 -2
- data/spec/unit/type/sshkey_spec.rb +0 -0
- data/spec/unit/type/stage_spec.rb +1 -1
- data/spec/unit/type/tidy_spec.rb +58 -39
- data/spec/unit/type/user_spec.rb +56 -56
- data/spec/unit/type/vlan_spec.rb +6 -6
- data/spec/unit/type/whit_spec.rb +1 -1
- data/spec/unit/type/yumrepo_spec.rb +15 -0
- data/spec/unit/type/zfs_spec.rb +3 -3
- data/spec/unit/type/zone_spec.rb +19 -19
- data/spec/unit/type/zpool_spec.rb +15 -15
- data/spec/unit/type_spec.rb +236 -163
- data/spec/unit/util/autoload_spec.rb +31 -25
- data/spec/unit/util/backups_spec.rb +4 -4
- data/spec/unit/util/checksums_spec.rb +55 -27
- data/spec/unit/util/colors_spec.rb +6 -50
- data/spec/unit/util/command_line_spec.rb +13 -41
- data/spec/unit/util/command_line_utils/puppet_option_parser_spec.rb +2 -2
- data/spec/unit/util/constant_inflector_spec.rb +12 -12
- data/spec/unit/util/diff_spec.rb +4 -4
- data/spec/unit/util/errors_spec.rb +5 -5
- data/spec/unit/util/execution_spec.rb +74 -29
- data/spec/unit/util/execution_stub_spec.rb +10 -10
- data/spec/unit/util/feature_spec.rb +15 -19
- data/spec/unit/util/filetype_spec.rb +9 -9
- data/spec/unit/util/http_proxy_spec.rb +18 -18
- data/spec/unit/util/inifile_spec.rb +2 -2
- data/spec/unit/util/json_lockfile_spec.rb +1 -1
- data/spec/unit/util/ldap/connection_spec.rb +6 -6
- data/spec/unit/util/ldap/generator_spec.rb +8 -8
- data/spec/unit/util/ldap/manager_spec.rb +40 -40
- data/spec/unit/util/lockfile_spec.rb +13 -13
- data/spec/unit/util/log/destinations_spec.rb +52 -49
- data/spec/unit/util/log_spec.rb +48 -173
- data/spec/unit/util/logging_spec.rb +120 -3
- data/spec/unit/util/metric_spec.rb +18 -33
- data/spec/unit/util/monkey_patches_spec.rb +18 -139
- data/spec/unit/util/nagios_maker_spec.rb +2 -2
- data/spec/unit/util/network_device/cisco/device_spec.rb +23 -23
- data/spec/unit/util/network_device/cisco/facts_spec.rb +3 -3
- data/spec/unit/util/network_device/cisco/interface_spec.rb +0 -0
- data/spec/unit/util/network_device/config_spec.rb +10 -16
- data/spec/unit/util/network_device/ipcalc_spec.rb +10 -10
- data/spec/unit/util/network_device/transport/base_spec.rb +2 -2
- data/spec/unit/util/network_device/transport/ssh_spec.rb +10 -10
- data/spec/unit/util/network_device/transport/telnet_spec.rb +3 -3
- data/spec/unit/util/network_device_spec.rb +2 -2
- data/spec/unit/util/package_spec.rb +2 -2
- data/spec/unit/util/pidlock_spec.rb +38 -38
- data/spec/unit/util/posix_spec.rb +25 -25
- data/spec/unit/util/profiler/aggregate_spec.rb +14 -18
- data/spec/unit/util/profiler/around_profiler_spec.rb +6 -6
- data/spec/unit/util/profiler/logging_spec.rb +8 -8
- data/spec/unit/util/profiler/object_counts_spec.rb +3 -5
- data/spec/unit/util/profiler/wall_clock_spec.rb +1 -1
- data/spec/unit/util/profiler_spec.rb +6 -14
- data/spec/unit/util/rdoc_spec.rb +0 -85
- data/spec/unit/util/reference_spec.rb +1 -1
- data/spec/unit/util/resource_template_spec.rb +2 -2
- data/spec/unit/util/{retryaction_spec.rb → retry_action_spec.rb} +25 -2
- data/spec/unit/util/rubygems_spec.rb +8 -8
- data/spec/unit/util/run_mode_spec.rb +159 -17
- data/spec/unit/util/selinux_spec.rb +61 -39
- data/spec/unit/util/ssl_spec.rb +13 -13
- data/spec/unit/util/storage_spec.rb +27 -27
- data/spec/unit/util/suidmanager_spec.rb +56 -67
- data/spec/unit/util/symbolic_file_mode_spec.rb +15 -16
- data/spec/unit/util/tag_set_spec.rb +5 -5
- data/spec/unit/util/tagging_spec.rb +0 -0
- data/spec/unit/util/terminal_spec.rb +5 -5
- data/spec/unit/util/user_attr_spec.rb +6 -6
- data/spec/unit/util/warnings_spec.rb +9 -1
- data/spec/unit/util/watcher_spec.rb +1 -1
- data/spec/unit/util/windows/access_control_entry_spec.rb +9 -9
- data/spec/unit/util/windows/access_control_list_spec.rb +21 -21
- data/spec/unit/util/windows/adsi_spec.rb +71 -209
- data/spec/unit/util/windows/api_types_spec.rb +3 -3
- data/spec/unit/util/windows/registry_spec.rb +71 -46
- data/spec/unit/util/windows/root_certs_spec.rb +1 -1
- data/spec/unit/util/windows/security_descriptor_spec.rb +18 -18
- data/spec/unit/util/windows/sid_spec.rb +40 -20
- data/spec/unit/util/windows/string_spec.rb +4 -4
- data/spec/unit/util/yaml_spec.rb +1 -1
- data/spec/unit/util_spec.rb +73 -124
- data/spec/unit/version_spec.rb +4 -4
- data/spec/watchr.rb +1 -5
- data/tasks/benchmark.rake +1 -6
- data/tasks/ci.rake +1 -1
- data/tasks/manpages.rake +0 -9
- data/tasks/parallel.rake +4 -7
- data/tasks/parser.rake +0 -5
- metadata +175 -461
- data/conf/tagmail.conf +0 -16
- data/ext/debian/puppet.conf +0 -14
- data/ext/debian/puppetmaster-common.puppetqd.default +0 -27
- data/ext/debian/puppetmaster-common.puppetqd.init +0 -84
- data/ext/gentoo/puppet/puppet.conf +0 -25
- data/ext/ips/puppet.conf +0 -29
- data/ext/nagios/naggen +0 -309
- data/ext/puppet-load.rb +0 -393
- data/ext/redhat/puppet.conf +0 -25
- data/ext/redhat/queue.init +0 -105
- data/lib/hiera/backend/puppet_backend.rb +0 -103
- data/lib/puppet/application/instrumentation_data.rb +0 -7
- data/lib/puppet/application/instrumentation_listener.rb +0 -7
- data/lib/puppet/application/instrumentation_probe.rb +0 -7
- data/lib/puppet/application/kick.rb +0 -351
- data/lib/puppet/application/queue.rb +0 -161
- data/lib/puppet/application/secret_agent.rb +0 -9
- data/lib/puppet/dsl.rb +0 -7
- data/lib/puppet/dsl/resource_api.rb +0 -120
- data/lib/puppet/dsl/resource_type_api.rb +0 -34
- data/lib/puppet/face/instrumentation_data.rb +0 -30
- data/lib/puppet/face/instrumentation_listener.rb +0 -98
- data/lib/puppet/face/instrumentation_probe.rb +0 -79
- data/lib/puppet/face/secret_agent.rb +0 -54
- data/lib/puppet/feature/pson.rb +0 -4
- data/lib/puppet/feature/rails.rb +0 -47
- data/lib/puppet/feature/rdoc1.rb +0 -16
- data/lib/puppet/feature/rubygems.rb +0 -7
- data/lib/puppet/feature/stomp.rb +0 -5
- data/lib/puppet/file_collection.rb +0 -19
- data/lib/puppet/file_collection/lookup.rb +0 -10
- data/lib/puppet/file_system/file18.rb +0 -5
- data/lib/puppet/functions/defined.rb +0 -130
- data/lib/puppet/indirector/active_record.rb +0 -29
- data/lib/puppet/indirector/catalog/active_record.rb +0 -39
- data/lib/puppet/indirector/catalog/queue.rb +0 -9
- data/lib/puppet/indirector/couch.rb +0 -78
- data/lib/puppet/indirector/facts/active_record.rb +0 -44
- data/lib/puppet/indirector/facts/couch.rb +0 -36
- data/lib/puppet/indirector/facts/inventory_active_record.rb +0 -110
- data/lib/puppet/indirector/facts/inventory_service.rb +0 -20
- data/lib/puppet/indirector/facts/rest.rb +0 -8
- data/lib/puppet/indirector/instrumentation_data.rb +0 -3
- data/lib/puppet/indirector/instrumentation_data/local.rb +0 -22
- data/lib/puppet/indirector/instrumentation_data/rest.rb +0 -8
- data/lib/puppet/indirector/instrumentation_listener.rb +0 -3
- data/lib/puppet/indirector/instrumentation_listener/local.rb +0 -26
- data/lib/puppet/indirector/instrumentation_listener/rest.rb +0 -8
- data/lib/puppet/indirector/instrumentation_probe.rb +0 -3
- data/lib/puppet/indirector/instrumentation_probe/local.rb +0 -27
- data/lib/puppet/indirector/instrumentation_probe/rest.rb +0 -8
- data/lib/puppet/indirector/node/active_record.rb +0 -22
- data/lib/puppet/indirector/queue.rb +0 -80
- data/lib/puppet/indirector/resource/active_record.rb +0 -104
- data/lib/puppet/indirector/resource/rest.rb +0 -17
- data/lib/puppet/indirector/run/local.rb +0 -15
- data/lib/puppet/indirector/run/rest.rb +0 -12
- data/lib/puppet/module_tool/modulefile.rb +0 -78
- data/lib/puppet/network/authentication.rb +0 -35
- data/lib/puppet/network/http/api/v2.rb +0 -32
- data/lib/puppet/network/http/api/v2/authorization.rb +0 -15
- data/lib/puppet/parser/ast/arithmetic_operator.rb +0 -91
- data/lib/puppet/parser/ast/astarray.rb +0 -50
- data/lib/puppet/parser/ast/asthash.rb +0 -37
- data/lib/puppet/parser/ast/boolean_operator.rb +0 -46
- data/lib/puppet/parser/ast/caseopt.rb +0 -52
- data/lib/puppet/parser/ast/casestatement.rb +0 -41
- data/lib/puppet/parser/ast/collection.rb +0 -53
- data/lib/puppet/parser/ast/collexpr.rb +0 -109
- data/lib/puppet/parser/ast/comparison_operator.rb +0 -38
- data/lib/puppet/parser/ast/definition.rb +0 -17
- data/lib/puppet/parser/ast/else.rb +0 -22
- data/lib/puppet/parser/ast/function.rb +0 -59
- data/lib/puppet/parser/ast/ifstatement.rb +0 -34
- data/lib/puppet/parser/ast/in_operator.rb +0 -24
- data/lib/puppet/parser/ast/lambda.rb +0 -135
- data/lib/puppet/parser/ast/match_operator.rb +0 -28
- data/lib/puppet/parser/ast/method_call.rb +0 -77
- data/lib/puppet/parser/ast/minus.rb +0 -23
- data/lib/puppet/parser/ast/nop.rb +0 -11
- data/lib/puppet/parser/ast/not.rb +0 -19
- data/lib/puppet/parser/ast/relationship.rb +0 -47
- data/lib/puppet/parser/ast/resource_defaults.rb +0 -24
- data/lib/puppet/parser/ast/resource_override.rb +0 -62
- data/lib/puppet/parser/ast/resource_reference.rb +0 -28
- data/lib/puppet/parser/ast/selector.rb +0 -50
- data/lib/puppet/parser/ast/vardef.rb +0 -38
- data/lib/puppet/parser/code_merger.rb +0 -13
- data/lib/puppet/parser/collector.rb +0 -177
- data/lib/puppet/parser/functions/extlookup.rb +0 -153
- data/lib/puppet/parser/functions/search.rb +0 -12
- data/lib/puppet/parser/grammar.ra +0 -806
- data/lib/puppet/parser/lexer.rb +0 -608
- data/lib/puppet/parser/makefile +0 -8
- data/lib/puppet/parser/methods.rb +0 -69
- data/lib/puppet/parser/parser.rb +0 -2559
- data/lib/puppet/parser/parser_support.rb +0 -195
- data/lib/puppet/pops/binder/lookup.rb +0 -216
- data/lib/puppet/pops/migration/migration_checker.rb +0 -45
- data/lib/puppet/pops/model/ast_tree_dumper.rb +0 -386
- data/lib/puppet/provider/package/msi.rb +0 -125
- data/lib/puppet/provider/package/yumhelper.py +0 -159
- data/lib/puppet/rails.rb +0 -139
- data/lib/puppet/rails/benchmark.rb +0 -63
- data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +0 -13
- data/lib/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb +0 -13
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +0 -9
- data/lib/puppet/rails/database/004_add_inventory_service_tables.rb +0 -36
- data/lib/puppet/rails/database/schema.rb +0 -136
- data/lib/puppet/rails/fact_name.rb +0 -7
- data/lib/puppet/rails/fact_value.rb +0 -10
- data/lib/puppet/rails/host.rb +0 -258
- data/lib/puppet/rails/inventory_fact.rb +0 -5
- data/lib/puppet/rails/inventory_node.rb +0 -43
- data/lib/puppet/rails/param_name.rb +0 -25
- data/lib/puppet/rails/param_value.rb +0 -74
- data/lib/puppet/rails/puppet_tag.rb +0 -10
- data/lib/puppet/rails/resource.rb +0 -235
- data/lib/puppet/rails/resource_tag.rb +0 -26
- data/lib/puppet/rails/source_file.rb +0 -8
- data/lib/puppet/reports/rrdgraph.rb +0 -128
- data/lib/puppet/reports/tagmail.rb +0 -179
- data/lib/puppet/run.rb +0 -109
- data/lib/puppet/util/cacher.rb +0 -74
- data/lib/puppet/util/inline_docs.rb +0 -26
- data/lib/puppet/util/instrumentation.rb +0 -152
- data/lib/puppet/util/instrumentation/data.rb +0 -46
- data/lib/puppet/util/instrumentation/indirection_probe.rb +0 -41
- data/lib/puppet/util/instrumentation/instrumentable.rb +0 -136
- data/lib/puppet/util/instrumentation/listener.rb +0 -72
- data/lib/puppet/util/instrumentation/listeners/log.rb +0 -23
- data/lib/puppet/util/instrumentation/listeners/performance.rb +0 -24
- data/lib/puppet/util/log/rate_limited_logger.rb +0 -40
- data/lib/puppet/util/monkey_patches/lines.rb +0 -13
- data/lib/puppet/util/plugins.rb +0 -82
- data/lib/puppet/util/pson.rb +0 -13
- data/lib/puppet/util/queue.rb +0 -96
- data/lib/puppet/util/queue/stomp.rb +0 -60
- data/lib/puppet/util/rails/cache_accumulator.rb +0 -65
- data/lib/puppet/util/rails/collection_merger.rb +0 -17
- data/lib/puppet/util/rails/reference_serializer.rb +0 -32
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc1.rb +0 -19
- data/lib/puppet/util/retryaction.rb +0 -47
- data/lib/puppet/util/zaml.rb +0 -419
- data/lib/puppet/vendor/load_safe_yaml.rb +0 -1
- data/lib/puppet/vendor/safe_yaml/CHANGES.md +0 -104
- data/lib/puppet/vendor/safe_yaml/Gemfile +0 -11
- data/lib/puppet/vendor/safe_yaml/LICENSE.txt +0 -22
- data/lib/puppet/vendor/safe_yaml/PUPPET_README.md +0 -6
- data/lib/puppet/vendor/safe_yaml/README.md +0 -179
- data/lib/puppet/vendor/safe_yaml/Rakefile +0 -6
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml.rb +0 -253
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/deep.rb +0 -34
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/date.rb +0 -27
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/hexadecimal.rb +0 -12
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/parse/sexagesimal.rb +0 -26
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/psych_handler.rb +0 -92
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/psych_resolver.rb +0 -52
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/resolver.rb +0 -94
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -17
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_hack.rb +0 -36
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_node_monkeypatch.rb +0 -43
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/syck_resolver.rb +0 -38
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform.rb +0 -41
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_boolean.rb +0 -21
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_date.rb +0 -11
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_float.rb +0 -33
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_integer.rb +0 -25
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_nil.rb +0 -18
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/to_symbol.rb +0 -13
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/transform/transformation_map.rb +0 -47
- data/lib/puppet/vendor/safe_yaml/lib/safe_yaml/version.rb +0 -3
- data/lib/puppet/vendor/safe_yaml/run_specs_all_ruby_versions.sh +0 -21
- data/lib/puppet/vendor/safe_yaml/safe_yaml.gemspec +0 -18
- data/lib/puppet/vendor/safe_yaml/spec/exploit.1.9.2.yaml +0 -2
- data/lib/puppet/vendor/safe_yaml/spec/exploit.1.9.3.yaml +0 -2
- data/lib/puppet/vendor/safe_yaml/spec/psych_resolver_spec.rb +0 -10
- data/lib/puppet/vendor/safe_yaml/spec/resolver_specs.rb +0 -250
- data/lib/puppet/vendor/safe_yaml/spec/safe_yaml_spec.rb +0 -702
- data/lib/puppet/vendor/safe_yaml/spec/spec_helper.rb +0 -18
- data/lib/puppet/vendor/safe_yaml/spec/support/exploitable_back_door.rb +0 -29
- data/lib/puppet/vendor/safe_yaml/spec/syck_resolver_spec.rb +0 -10
- data/lib/puppet/vendor/safe_yaml/spec/transform/base64_spec.rb +0 -11
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_date_spec.rb +0 -34
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_float_spec.rb +0 -42
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_integer_spec.rb +0 -59
- data/lib/puppet/vendor/safe_yaml/spec/transform/to_symbol_spec.rb +0 -49
- data/lib/puppet/vendor/safe_yaml_patches.rb +0 -9
- data/lib/puppetx.rb +0 -89
- data/man/man8/puppet-instrumentation_data.8 +0 -141
- data/man/man8/puppet-instrumentation_listener.8 +0 -218
- data/man/man8/puppet-instrumentation_probe.8 +0 -203
- data/man/man8/puppet-kick.8 +0 -131
- data/man/man8/puppet-queue.8 +0 -55
- data/man/man8/puppet-secret_agent.8 +0 -70
- data/spec/fixtures/module.tar.gz +0 -0
- data/spec/fixtures/unit/provider/package/pkg/publisher +0 -2
- data/spec/fixtures/unit/provider/package/pkg/simple +0 -2
- data/spec/fixtures/yaml/report0.25.x.yaml +0 -64
- data/spec/integration/indirector/catalog/queue_spec.rb +0 -55
- data/spec/integration/module_tool/tar/mini_spec.rb +0 -28
- data/spec/integration/parser/dynamic_scoping_spec.rb +0 -131
- data/spec/integration/parser/future_compiler_spec.rb +0 -822
- data/spec/integration/parser/parser_spec.rb +0 -207
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -119
- data/spec/integration/type/sshkey_spec.rb +0 -22
- data/spec/integration/util/feature_spec.rb +0 -53
- data/spec/lib/puppet_spec/database.rb +0 -29
- data/spec/monkey_patches/alias_should_to_must.rb +0 -21
- data/spec/shared_contexts/platform.rb +0 -52
- data/spec/unit/application/kick_spec.rb +0 -296
- data/spec/unit/application/queue_spec.rb +0 -168
- data/spec/unit/application/secret_agent_spec.rb +0 -34
- data/spec/unit/dsl/resource_api_spec.rb +0 -180
- data/spec/unit/dsl/resource_type_api_spec.rb +0 -53
- data/spec/unit/face/instrumentation_data_spec.rb +0 -7
- data/spec/unit/face/instrumentation_listener_spec.rb +0 -38
- data/spec/unit/face/instrumentation_probe_spec.rb +0 -21
- data/spec/unit/face/secret_agent_spec.rb +0 -27
- data/spec/unit/functions/defined_spec.rb +0 -291
- data/spec/unit/hiera/backend/puppet_backend_spec.rb +0 -148
- data/spec/unit/indirector/active_record_spec.rb +0 -75
- data/spec/unit/indirector/catalog/active_record_spec.rb +0 -107
- data/spec/unit/indirector/catalog/queue_spec.rb +0 -19
- data/spec/unit/indirector/facts/active_record_spec.rb +0 -113
- data/spec/unit/indirector/facts/couch_spec.rb +0 -102
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +0 -175
- data/spec/unit/indirector/facts/inventory_service_spec.rb +0 -21
- data/spec/unit/indirector/facts/rest_spec.rb +0 -10
- data/spec/unit/indirector/instrumentation_data/local_spec.rb +0 -52
- data/spec/unit/indirector/instrumentation_data/rest_spec.rb +0 -11
- data/spec/unit/indirector/instrumentation_listener/local_spec.rb +0 -65
- data/spec/unit/indirector/instrumentation_listener/rest_spec.rb +0 -11
- data/spec/unit/indirector/instrumentation_probe/local_spec.rb +0 -65
- data/spec/unit/indirector/instrumentation_probe/rest_spec.rb +0 -11
- data/spec/unit/indirector/node/active_record_spec.rb +0 -48
- data/spec/unit/indirector/queue_spec.rb +0 -115
- data/spec/unit/indirector/resource/active_record_spec.rb +0 -166
- data/spec/unit/indirector/resource/rest_spec.rb +0 -10
- data/spec/unit/indirector/run/local_spec.rb +0 -21
- data/spec/unit/indirector/run/rest_spec.rb +0 -10
- data/spec/unit/network/authentication_spec.rb +0 -104
- data/spec/unit/network/http/api/v2_spec.rb +0 -14
- data/spec/unit/parser/ast/arithmetic_operator_spec.rb +0 -160
- data/spec/unit/parser/ast/astarray_spec.rb +0 -56
- data/spec/unit/parser/ast/asthash_spec.rb +0 -98
- data/spec/unit/parser/ast/boolean_operator_spec.rb +0 -54
- data/spec/unit/parser/ast/casestatement_spec.rb +0 -168
- data/spec/unit/parser/ast/collection_spec.rb +0 -70
- data/spec/unit/parser/ast/collexpr_spec.rb +0 -120
- data/spec/unit/parser/ast/comparison_operator_spec.rb +0 -118
- data/spec/unit/parser/ast/definition_spec.rb +0 -21
- data/spec/unit/parser/ast/function_spec.rb +0 -92
- data/spec/unit/parser/ast/hostclass_spec.rb +0 -72
- data/spec/unit/parser/ast/ifstatement_spec.rb +0 -77
- data/spec/unit/parser/ast/in_operator_spec.rb +0 -61
- data/spec/unit/parser/ast/match_operator_spec.rb +0 -51
- data/spec/unit/parser/ast/minus_spec.rb +0 -37
- data/spec/unit/parser/ast/node_spec.rb +0 -30
- data/spec/unit/parser/ast/nop_spec.rb +0 -19
- data/spec/unit/parser/ast/not_spec.rb +0 -31
- data/spec/unit/parser/ast/relationship_spec.rb +0 -87
- data/spec/unit/parser/ast/resource_defaults_spec.rb +0 -21
- data/spec/unit/parser/ast/resource_override_spec.rb +0 -50
- data/spec/unit/parser/ast/resource_reference_spec.rb +0 -56
- data/spec/unit/parser/ast/resource_spec.rb +0 -183
- data/spec/unit/parser/ast/resourceparam_spec.rb +0 -51
- data/spec/unit/parser/ast/selector_spec.rb +0 -88
- data/spec/unit/parser/ast/vardef_spec.rb +0 -68
- data/spec/unit/parser/ast_spec.rb +0 -76
- data/spec/unit/parser/collector_spec.rb +0 -438
- data/spec/unit/parser/functions/extlookup_spec.rb +0 -102
- data/spec/unit/parser/functions/search_spec.rb +0 -28
- data/spec/unit/parser/lexer_spec.rb +0 -877
- data/spec/unit/parser/parser_spec.rb +0 -535
- data/spec/unit/pops/evaluator/runtime3_converter_spec.rb +0 -19
- data/spec/unit/pops/migration_spec.rb +0 -180
- data/spec/unit/pops/model/ast_transformer_spec.rb +0 -76
- data/spec/unit/pops/transformer/transform_basic_expressions_spec.rb +0 -243
- data/spec/unit/pops/transformer/transform_calls_spec.rb +0 -115
- data/spec/unit/pops/transformer/transform_conditionals_spec.rb +0 -123
- data/spec/unit/pops/transformer/transform_containers_spec.rb +0 -190
- data/spec/unit/pops/transformer/transformer_rspec_helper.rb +0 -27
- data/spec/unit/pops/validation_spec.rb +0 -66
- data/spec/unit/provider/package/msi_spec.rb +0 -229
- data/spec/unit/rails/host_spec.rb +0 -162
- data/spec/unit/rails/param_value_spec.rb +0 -46
- data/spec/unit/rails/resource_spec.rb +0 -115
- data/spec/unit/rails_spec.rb +0 -244
- data/spec/unit/reports/rrdgraph_spec.rb +0 -29
- data/spec/unit/reports/tagmail_spec.rb +0 -218
- data/spec/unit/run_spec.rb +0 -175
- data/spec/unit/util/cache_accumulator_spec.rb +0 -74
- data/spec/unit/util/cacher_spec.rb +0 -107
- data/spec/unit/util/inline_docs_spec.rb +0 -31
- data/spec/unit/util/instrumentation/data_spec.rb +0 -46
- data/spec/unit/util/instrumentation/indirection_probe_spec.rb +0 -21
- data/spec/unit/util/instrumentation/instrumentable_spec.rb +0 -186
- data/spec/unit/util/instrumentation/listener_spec.rb +0 -101
- data/spec/unit/util/instrumentation/listeners/log_spec.rb +0 -34
- data/spec/unit/util/instrumentation/listeners/performance_spec.rb +0 -36
- data/spec/unit/util/instrumentation_spec.rb +0 -181
- data/spec/unit/util/log/rate_limited_logger_spec.rb +0 -51
- data/spec/unit/util/monkey_patches/lines_spec.rb +0 -83
- data/spec/unit/util/queue/stomp_spec.rb +0 -137
- data/spec/unit/util/queue_spec.rb +0 -94
- data/spec/unit/util/rdoc/parser_spec.rb +0 -608
- data/spec/unit/util/reference_serializer_spec.rb +0 -51
- data/spec/unit/util/zaml_spec.rb +0 -308
@@ -30,11 +30,11 @@ describe Puppet::Settings::StringSetting do
|
|
30
30
|
describe "#default" do
|
31
31
|
describe "with no arguments" do
|
32
32
|
it "should return the setting default" do
|
33
|
-
@test_setting.default.
|
33
|
+
expect(@test_setting.default).to eq(@test_setting_default)
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should be uninterpolated" do
|
37
|
-
@test_setting.default.
|
37
|
+
expect(@test_setting.default).not_to match(/interpolate/)
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -45,22 +45,22 @@ describe Puppet::Settings::StringSetting do
|
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should return the application-set default" do
|
48
|
-
@test_setting.default(true).
|
48
|
+
expect(@test_setting.default(true)).to eq(@application_setting)
|
49
49
|
end
|
50
50
|
|
51
51
|
it "should be uninterpolated" do
|
52
|
-
@test_setting.default(true).
|
52
|
+
expect(@test_setting.default(true)).not_to match(/interpolate/)
|
53
53
|
end
|
54
54
|
|
55
55
|
end
|
56
56
|
|
57
57
|
describe "if application defaults not set" do
|
58
58
|
it "should return the regular default" do
|
59
|
-
@test_setting.default(true).
|
59
|
+
expect(@test_setting.default(true)).to eq(@test_setting_default)
|
60
60
|
end
|
61
61
|
|
62
62
|
it "should be uninterpolated" do
|
63
|
-
@test_setting.default(true).
|
63
|
+
expect(@test_setting.default(true)).not_to match(/interpolate/)
|
64
64
|
end
|
65
65
|
end
|
66
66
|
end
|
@@ -68,7 +68,7 @@ describe Puppet::Settings::StringSetting do
|
|
68
68
|
|
69
69
|
describe "#value" do
|
70
70
|
it "should be interpolated" do
|
71
|
-
@test_setting.value.
|
71
|
+
expect(@test_setting.value).to match(/interpolate/)
|
72
72
|
end
|
73
73
|
end
|
74
74
|
end
|
@@ -6,19 +6,19 @@ describe Puppet::Settings::TerminusSetting do
|
|
6
6
|
|
7
7
|
describe "#munge" do
|
8
8
|
it "converts strings to symbols" do
|
9
|
-
setting.munge("string").
|
9
|
+
expect(setting.munge("string")).to eq(:string)
|
10
10
|
end
|
11
11
|
|
12
12
|
it "converts '' to nil" do
|
13
|
-
setting.munge('').
|
13
|
+
expect(setting.munge('')).to be_nil
|
14
14
|
end
|
15
15
|
|
16
16
|
it "preserves symbols" do
|
17
|
-
setting.munge(:symbol).
|
17
|
+
expect(setting.munge(:symbol)).to eq(:symbol)
|
18
18
|
end
|
19
19
|
|
20
20
|
it "preserves nil" do
|
21
|
-
setting.munge(nil).
|
21
|
+
expect(setting.munge(nil)).to be_nil
|
22
22
|
end
|
23
23
|
|
24
24
|
it "does not allow unknown types through" do
|
@@ -7,71 +7,71 @@ describe Puppet::Settings::ValueTranslator do
|
|
7
7
|
|
8
8
|
context "booleans" do
|
9
9
|
it "translates strings representing booleans to booleans" do
|
10
|
-
translator['true'].
|
11
|
-
translator['false'].
|
10
|
+
expect(translator['true']).to eq(true)
|
11
|
+
expect(translator['false']).to eq(false)
|
12
12
|
end
|
13
13
|
|
14
14
|
it "translates boolean values into themselves" do
|
15
|
-
translator[true].
|
16
|
-
translator[false].
|
15
|
+
expect(translator[true]).to eq(true)
|
16
|
+
expect(translator[false]).to eq(false)
|
17
17
|
end
|
18
18
|
|
19
19
|
it "leaves a boolean string with whitespace as a string" do
|
20
|
-
translator[' true'].
|
21
|
-
translator['true '].
|
20
|
+
expect(translator[' true']).to eq(" true")
|
21
|
+
expect(translator['true ']).to eq("true")
|
22
22
|
|
23
|
-
translator[' false'].
|
24
|
-
translator['false '].
|
23
|
+
expect(translator[' false']).to eq(" false")
|
24
|
+
expect(translator['false ']).to eq("false")
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
context "numbers" do
|
29
29
|
it "translates integer strings to integers" do
|
30
|
-
translator["1"].
|
31
|
-
translator["2"].
|
30
|
+
expect(translator["1"]).to eq(1)
|
31
|
+
expect(translator["2"]).to eq(2)
|
32
32
|
end
|
33
33
|
|
34
34
|
it "translates numbers starting with a 0 as octal" do
|
35
|
-
translator["011"].
|
35
|
+
expect(translator["011"]).to eq(9)
|
36
36
|
end
|
37
37
|
|
38
38
|
it "leaves hex numbers as strings" do
|
39
|
-
translator["0x11"].
|
39
|
+
expect(translator["0x11"]).to eq("0x11")
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
43
|
context "arbitrary strings" do
|
44
44
|
it "translates an empty string as the empty string" do
|
45
|
-
translator[""].
|
45
|
+
expect(translator[""]).to eq("")
|
46
46
|
end
|
47
47
|
|
48
48
|
|
49
49
|
it "strips double quotes" do
|
50
|
-
translator['"a string"'].
|
50
|
+
expect(translator['"a string"']).to eq('a string')
|
51
51
|
end
|
52
52
|
|
53
53
|
it "strips single quotes" do
|
54
|
-
translator["'a string'"].
|
54
|
+
expect(translator["'a string'"]).to eq("a string")
|
55
55
|
end
|
56
56
|
|
57
|
-
it "does not strip
|
58
|
-
translator[" \ta string"].
|
57
|
+
it "does not strip preceding whitespace" do
|
58
|
+
expect(translator[" \ta string"]).to eq(" \ta string")
|
59
59
|
end
|
60
60
|
|
61
61
|
it "strips trailing whitespace" do
|
62
|
-
translator["a string\t "].
|
62
|
+
expect(translator["a string\t "]).to eq("a string")
|
63
63
|
end
|
64
64
|
|
65
|
-
it "leaves leading quote that is
|
66
|
-
translator[" 'a string'"].
|
65
|
+
it "leaves leading quote that is preceded by whitespace" do
|
66
|
+
expect(translator[" 'a string'"]).to eq(" 'a string")
|
67
67
|
end
|
68
68
|
|
69
69
|
it "leaves trailing quote that is succeeded by whitespace" do
|
70
|
-
translator["'a string' "].
|
70
|
+
expect(translator["'a string' "]).to eq("a string'")
|
71
71
|
end
|
72
72
|
|
73
73
|
it "leaves quotes that are not at the beginning or end of the string" do
|
74
|
-
translator["a st'\"ring"].
|
74
|
+
expect(translator["a st'\"ring"]).to eq("a st'\"ring")
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
data/spec/unit/settings_spec.rb
CHANGED
@@ -17,13 +17,28 @@ describe Puppet::Settings do
|
|
17
17
|
File.join(Puppet::Util::RunMode[:user].conf_dir, "puppet.conf")
|
18
18
|
end
|
19
19
|
|
20
|
+
# Return a given object's file metadata.
|
21
|
+
def metadata(setting)
|
22
|
+
if setting.is_a?(Puppet::Settings::FileSetting)
|
23
|
+
{
|
24
|
+
:owner => setting.owner,
|
25
|
+
:group => setting.group,
|
26
|
+
:mode => setting.mode
|
27
|
+
}.delete_if { |key, value| value.nil? }
|
28
|
+
else
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
20
33
|
describe "when specifying defaults" do
|
21
34
|
before do
|
22
35
|
@settings = Puppet::Settings.new
|
23
36
|
end
|
24
37
|
|
25
|
-
it "should start with no defined parameters" do
|
26
|
-
|
38
|
+
it "should start with no defined sections or parameters" do
|
39
|
+
# Note this relies on undocumented side effect that eachsection returns the Settings internal
|
40
|
+
# configuration on which keys returns all parameters.
|
41
|
+
expect(@settings.eachsection.keys.length).to eq(0)
|
27
42
|
end
|
28
43
|
|
29
44
|
it "should not allow specification of default values associated with a section as an array" do
|
@@ -34,7 +49,7 @@ describe Puppet::Settings do
|
|
34
49
|
|
35
50
|
it "should not allow duplicate parameter specifications" do
|
36
51
|
@settings.define_settings(:section, :myvalue => { :default => "a", :desc => "b" })
|
37
|
-
|
52
|
+
expect { @settings.define_settings(:section, :myvalue => { :default => "c", :desc => "d" }) }.to raise_error(ArgumentError)
|
38
53
|
end
|
39
54
|
|
40
55
|
it "should allow specification of default values associated with a section as a hash" do
|
@@ -43,11 +58,11 @@ describe Puppet::Settings do
|
|
43
58
|
|
44
59
|
it "should consider defined parameters to be valid" do
|
45
60
|
@settings.define_settings(:section, :myvalue => { :default => "defaultval", :desc => "my description" })
|
46
|
-
@settings.valid?(:myvalue).
|
61
|
+
expect(@settings.valid?(:myvalue)).to be_truthy
|
47
62
|
end
|
48
63
|
|
49
64
|
it "should require a description when defaults are specified with a hash" do
|
50
|
-
|
65
|
+
expect { @settings.define_settings(:section, :myvalue => {:default => "a value"}) }.to raise_error(ArgumentError)
|
51
66
|
end
|
52
67
|
|
53
68
|
it "should support specifying owner, group, and mode when specifying files" do
|
@@ -60,16 +75,16 @@ describe Puppet::Settings do
|
|
60
75
|
|
61
76
|
it "should support specifying the setting type" do
|
62
77
|
@settings.define_settings(:section, :myvalue => {:default => "/w", :desc => "b", :type => :string})
|
63
|
-
@settings.setting(:myvalue).
|
78
|
+
expect(@settings.setting(:myvalue)).to be_instance_of(Puppet::Settings::StringSetting)
|
64
79
|
end
|
65
80
|
|
66
81
|
it "should fail if an invalid setting type is specified" do
|
67
|
-
|
82
|
+
expect { @settings.define_settings(:section, :myvalue => {:default => "w", :desc => "b", :type => :foo}) }.to raise_error(ArgumentError)
|
68
83
|
end
|
69
84
|
|
70
85
|
it "should fail when short names conflict" do
|
71
86
|
@settings.define_settings(:section, :myvalue => {:default => "w", :desc => "b", :short => "m"})
|
72
|
-
|
87
|
+
expect { @settings.define_settings(:section, :myvalue => {:default => "w", :desc => "b", :short => "m"}) }.to raise_error(ArgumentError)
|
73
88
|
end
|
74
89
|
end
|
75
90
|
|
@@ -101,7 +116,7 @@ describe Puppet::Settings do
|
|
101
116
|
it "sets the preferred run mode when initializing the app defaults" do
|
102
117
|
@settings.initialize_app_defaults(default_values.merge(:run_mode => :master))
|
103
118
|
|
104
|
-
@settings.preferred_run_mode.
|
119
|
+
expect(@settings.preferred_run_mode).to eq(:master)
|
105
120
|
end
|
106
121
|
end
|
107
122
|
|
@@ -199,84 +214,66 @@ describe Puppet::Settings do
|
|
199
214
|
|
200
215
|
it "should provide a method for setting values from other objects" do
|
201
216
|
@settings[:myval] = "something else"
|
202
|
-
@settings[:myval].
|
217
|
+
expect(@settings[:myval]).to eq("something else")
|
203
218
|
end
|
204
219
|
|
205
220
|
it "should support a getopt-specific mechanism for setting values" do
|
206
221
|
@settings.handlearg("--myval", "newval")
|
207
|
-
@settings[:myval].
|
222
|
+
expect(@settings[:myval]).to eq("newval")
|
208
223
|
end
|
209
224
|
|
210
225
|
it "should support a getopt-specific mechanism for turning booleans off" do
|
211
226
|
@settings.override_default(:bool, true)
|
212
227
|
@settings.handlearg("--no-bool", "")
|
213
|
-
@settings[:bool].
|
228
|
+
expect(@settings[:bool]).to eq(false)
|
214
229
|
end
|
215
230
|
|
216
231
|
it "should support a getopt-specific mechanism for turning booleans on" do
|
217
232
|
# Turn it off first
|
218
233
|
@settings.override_default(:bool, false)
|
219
234
|
@settings.handlearg("--bool", "")
|
220
|
-
@settings[:bool].
|
235
|
+
expect(@settings[:bool]).to eq(true)
|
221
236
|
end
|
222
237
|
|
223
238
|
it "should consider a cli setting with no argument to be a boolean" do
|
224
239
|
# Turn it off first
|
225
240
|
@settings.override_default(:bool, false)
|
226
241
|
@settings.handlearg("--bool")
|
227
|
-
@settings[:bool].
|
242
|
+
expect(@settings[:bool]).to eq(true)
|
228
243
|
end
|
229
244
|
|
230
245
|
it "should consider a cli setting with an empty string as an argument to be an empty argument, if the setting itself is not a boolean" do
|
231
246
|
@settings.override_default(:myval, "bob")
|
232
247
|
@settings.handlearg("--myval", "")
|
233
|
-
@settings[:myval].
|
248
|
+
expect(@settings[:myval]).to eq("")
|
234
249
|
end
|
235
250
|
|
236
251
|
it "should consider a cli setting with a boolean as an argument to be a boolean" do
|
237
252
|
# Turn it off first
|
238
253
|
@settings.override_default(:bool, false)
|
239
254
|
@settings.handlearg("--bool", "true")
|
240
|
-
@settings[:bool].
|
255
|
+
expect(@settings[:bool]).to eq(true)
|
241
256
|
end
|
242
257
|
|
243
258
|
it "should not consider a cli setting of a non boolean with a boolean as an argument to be a boolean" do
|
244
259
|
@settings.override_default(:myval, "bob")
|
245
260
|
@settings.handlearg("--no-myval", "")
|
246
|
-
@settings[:myval].
|
261
|
+
expect(@settings[:myval]).to eq("")
|
247
262
|
end
|
248
263
|
|
249
264
|
it "should flag string settings from the CLI" do
|
250
265
|
@settings.handlearg("--myval", "12")
|
251
|
-
@settings.set_by_cli?(:myval).
|
266
|
+
expect(@settings.set_by_cli?(:myval)).to be_truthy
|
252
267
|
end
|
253
268
|
|
254
269
|
it "should flag bool settings from the CLI" do
|
255
270
|
@settings.handlearg("--bool")
|
256
|
-
@settings.set_by_cli?(:bool).
|
271
|
+
expect(@settings.set_by_cli?(:bool)).to be_truthy
|
257
272
|
end
|
258
273
|
|
259
274
|
it "should not flag settings memory as from CLI" do
|
260
275
|
@settings[:myval] = "12"
|
261
|
-
@settings.set_by_cli?(:myval).
|
262
|
-
end
|
263
|
-
|
264
|
-
describe "setbycli" do
|
265
|
-
it "should generate a deprecation warning" do
|
266
|
-
Puppet.expects(:deprecation_warning).at_least(1)
|
267
|
-
@settings.setting(:myval).setbycli = true
|
268
|
-
end
|
269
|
-
it "should set the value" do
|
270
|
-
@settings[:myval] = "blah"
|
271
|
-
@settings.setting(:myval).setbycli = true
|
272
|
-
@settings.set_by_cli?(:myval).should be_true
|
273
|
-
end
|
274
|
-
it "should raise error if trying to unset value" do
|
275
|
-
@settings.handlearg("--myval", "blah")
|
276
|
-
expect do
|
277
|
-
@settings.setting(:myval).setbycli = nil
|
278
|
-
end.to raise_error(ArgumentError, /unset/)
|
279
|
-
end
|
276
|
+
expect(@settings.set_by_cli?(:myval)).to be_falsey
|
280
277
|
end
|
281
278
|
|
282
279
|
it "should clear the cache when setting getopt-specific values" do
|
@@ -284,9 +281,9 @@ describe Puppet::Settings do
|
|
284
281
|
:one => { :default => "whah", :desc => "yay" },
|
285
282
|
:two => { :default => "$one yay", :desc => "bah" }
|
286
283
|
@settings.expects(:unsafe_flush_cache)
|
287
|
-
@settings[:two].
|
284
|
+
expect(@settings[:two]).to eq("whah yay")
|
288
285
|
@settings.handlearg("--one", "else")
|
289
|
-
@settings[:two].
|
286
|
+
expect(@settings[:two]).to eq("else yay")
|
290
287
|
end
|
291
288
|
|
292
289
|
it "should clear the cache when the preferred_run_mode is changed" do
|
@@ -297,7 +294,7 @@ describe Puppet::Settings do
|
|
297
294
|
it "should not clear other values when setting getopt-specific values" do
|
298
295
|
@settings[:myval] = "yay"
|
299
296
|
@settings.handlearg("--no-bool", "")
|
300
|
-
@settings[:myval].
|
297
|
+
expect(@settings[:myval]).to eq("yay")
|
301
298
|
end
|
302
299
|
|
303
300
|
it "should clear the list of used sections" do
|
@@ -336,7 +333,7 @@ describe Puppet::Settings do
|
|
336
333
|
|
337
334
|
it "should have a default value of :on_write_only" do
|
338
335
|
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :hook => lambda { |v| hook_values << v }})
|
339
|
-
@settings.setting(:hooker).call_hook.
|
336
|
+
expect(@settings.setting(:hooker).call_hook).to eq(:on_write_only)
|
340
337
|
end
|
341
338
|
|
342
339
|
describe "when nil" do
|
@@ -346,7 +343,7 @@ describe Puppet::Settings do
|
|
346
343
|
end
|
347
344
|
it "should use default" do
|
348
345
|
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :call_hook => nil, :hook => lambda { |v| hook_values << v }})
|
349
|
-
@settings.setting(:hooker).call_hook.
|
346
|
+
expect(@settings.setting(:hooker).call_hook).to eq(:on_write_only)
|
350
347
|
end
|
351
348
|
end
|
352
349
|
|
@@ -362,8 +359,8 @@ describe Puppet::Settings do
|
|
362
359
|
it "should call the hook at definition" do
|
363
360
|
hook_values = []
|
364
361
|
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :call_hook => :on_define_and_write, :hook => lambda { |v| hook_values << v }})
|
365
|
-
@settings.setting(:hooker).call_hook.
|
366
|
-
hook_values.
|
362
|
+
expect(@settings.setting(:hooker).call_hook).to eq(:on_define_and_write)
|
363
|
+
expect(hook_values).to eq(%w{yay})
|
367
364
|
end
|
368
365
|
end
|
369
366
|
|
@@ -374,8 +371,8 @@ describe Puppet::Settings do
|
|
374
371
|
end
|
375
372
|
|
376
373
|
it "should not call the hook at definition" do
|
377
|
-
@hook_values.
|
378
|
-
@hook_values.
|
374
|
+
expect(@hook_values).to eq([])
|
375
|
+
expect(@hook_values).not_to eq(%w{yay})
|
379
376
|
end
|
380
377
|
|
381
378
|
it "should call the hook at initialization" do
|
@@ -393,85 +390,59 @@ describe Puppet::Settings do
|
|
393
390
|
end
|
394
391
|
end
|
395
392
|
|
396
|
-
describe "call_on_define" do
|
397
|
-
[true, false].each do |val|
|
398
|
-
describe "to #{val}" do
|
399
|
-
it "should generate a deprecation warning" do
|
400
|
-
Puppet.expects(:deprecation_warning)
|
401
|
-
values = []
|
402
|
-
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :call_on_define => val, :hook => lambda { |v| values << v }})
|
403
|
-
end
|
404
|
-
|
405
|
-
it "should should set call_hook" do
|
406
|
-
values = []
|
407
|
-
name = "hooker_#{val}".to_sym
|
408
|
-
@settings.define_settings(:section, name => {:default => "yay", :desc => "boo", :call_on_define => val, :hook => lambda { |v| values << v }})
|
409
|
-
|
410
|
-
@settings.setting(name).call_hook.should == :on_define_and_write if val
|
411
|
-
@settings.setting(name).call_hook.should == :on_write_only unless val
|
412
|
-
end
|
413
|
-
end
|
414
|
-
end
|
415
|
-
end
|
416
|
-
|
417
393
|
it "should call passed blocks when values are set" do
|
418
394
|
values = []
|
419
395
|
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :hook => lambda { |v| values << v }})
|
420
|
-
values.
|
396
|
+
expect(values).to eq([])
|
421
397
|
|
422
398
|
@settings[:hooker] = "something"
|
423
|
-
values.
|
399
|
+
expect(values).to eq(%w{something})
|
424
400
|
end
|
425
401
|
|
426
402
|
it "should call passed blocks when values are set via the command line" do
|
427
403
|
values = []
|
428
404
|
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :hook => lambda { |v| values << v }})
|
429
|
-
values.
|
405
|
+
expect(values).to eq([])
|
430
406
|
|
431
407
|
@settings.handlearg("--hooker", "yay")
|
432
408
|
|
433
|
-
values.
|
409
|
+
expect(values).to eq(%w{yay})
|
434
410
|
end
|
435
411
|
|
436
412
|
it "should provide an option to call passed blocks during definition" do
|
437
413
|
values = []
|
438
414
|
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :call_hook => :on_define_and_write, :hook => lambda { |v| values << v }})
|
439
|
-
values.
|
415
|
+
expect(values).to eq(%w{yay})
|
440
416
|
end
|
441
417
|
|
442
418
|
it "should pass the fully interpolated value to the hook when called on definition" do
|
443
419
|
values = []
|
444
420
|
@settings.define_settings(:section, :one => { :default => "test", :desc => "a" })
|
445
421
|
@settings.define_settings(:section, :hooker => {:default => "$one/yay", :desc => "boo", :call_hook => :on_define_and_write, :hook => lambda { |v| values << v }})
|
446
|
-
values.
|
422
|
+
expect(values).to eq(%w{test/yay})
|
447
423
|
end
|
448
424
|
|
449
425
|
it "should munge values using the setting-specific methods" do
|
450
426
|
@settings[:bool] = "false"
|
451
|
-
@settings[:bool].
|
427
|
+
expect(@settings[:bool]).to eq(false)
|
452
428
|
end
|
453
429
|
|
454
430
|
it "should prefer values set in ruby to values set on the cli" do
|
455
431
|
@settings[:myval] = "memarg"
|
456
432
|
@settings.handlearg("--myval", "cliarg")
|
457
433
|
|
458
|
-
@settings[:myval].
|
459
|
-
end
|
460
|
-
|
461
|
-
it "should clear the list of environments" do
|
462
|
-
Puppet::Node::Environment.expects(:clear).at_least(1)
|
463
|
-
@settings[:myval] = "memarg"
|
434
|
+
expect(@settings[:myval]).to eq("memarg")
|
464
435
|
end
|
465
436
|
|
466
437
|
it "should raise an error if we try to set a setting that hasn't been defined'" do
|
467
|
-
|
438
|
+
expect{
|
468
439
|
@settings[:why_so_serious] = "foo"
|
469
|
-
}.
|
440
|
+
}.to raise_error(ArgumentError, /unknown setting/)
|
470
441
|
end
|
471
442
|
|
472
443
|
it "allows overriding cli args based on the cli-set value" do
|
473
444
|
@settings.handlearg("--myval", "cliarg")
|
474
|
-
@settings.
|
445
|
+
@settings.patch_value(:myval, "modified #{@settings[:myval]}", :cli)
|
475
446
|
expect(@settings[:myval]).to eq("modified cliarg")
|
476
447
|
end
|
477
448
|
end
|
@@ -489,30 +460,14 @@ describe Puppet::Settings do
|
|
489
460
|
Puppet::FileSystem.stubs(:exist?).returns true
|
490
461
|
end
|
491
462
|
|
492
|
-
describe "call_on_define" do
|
493
|
-
it "should generate a deprecation warning" do
|
494
|
-
Puppet.expects(:deprecation_warning)
|
495
|
-
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :hook => lambda { |v| hook_values << v }})
|
496
|
-
@settings.setting(:hooker).call_on_define
|
497
|
-
end
|
498
|
-
|
499
|
-
Puppet::Settings::StringSetting.available_call_hook_values.each do |val|
|
500
|
-
it "should match value for call_hook => :#{val}" do
|
501
|
-
hook_values = []
|
502
|
-
@settings.define_settings(:section, :hooker => {:default => "yay", :desc => "boo", :call_hook => val, :hook => lambda { |v| hook_values << v }})
|
503
|
-
@settings.setting(:hooker).call_on_define.should == @settings.setting(:hooker).call_hook_on_define?
|
504
|
-
end
|
505
|
-
end
|
506
|
-
end
|
507
|
-
|
508
463
|
it "should provide a mechanism for returning set values" do
|
509
464
|
@settings[:one] = "other"
|
510
|
-
@settings[:one].
|
465
|
+
expect(@settings[:one]).to eq("other")
|
511
466
|
end
|
512
467
|
|
513
468
|
it "setting a value to nil causes it to return to its default" do
|
514
469
|
default_values = { :one => "skipped value" }
|
515
|
-
[:logdir, :confdir, :vardir].each do |key|
|
470
|
+
[:logdir, :confdir, :codedir, :vardir].each do |key|
|
516
471
|
default_values[key] = 'default value'
|
517
472
|
end
|
518
473
|
@settings.define_settings :main, PuppetSpec::Settings::TEST_APP_DEFAULT_DEFINITIONS
|
@@ -521,23 +476,23 @@ describe Puppet::Settings do
|
|
521
476
|
|
522
477
|
@settings[:one] = nil
|
523
478
|
|
524
|
-
@settings[:one].
|
479
|
+
expect(@settings[:one]).to eq("ONE")
|
525
480
|
end
|
526
481
|
|
527
482
|
it "should interpolate default values for other parameters into returned parameter values" do
|
528
|
-
@settings[:one].
|
529
|
-
@settings[:two].
|
530
|
-
@settings[:three].
|
483
|
+
expect(@settings[:one]).to eq("ONE")
|
484
|
+
expect(@settings[:two]).to eq("ONE TWO")
|
485
|
+
expect(@settings[:three]).to eq("ONE ONE TWO THREE")
|
531
486
|
end
|
532
487
|
|
533
488
|
it "should interpolate default values that themselves need to be interpolated" do
|
534
|
-
@settings[:four].
|
489
|
+
expect(@settings[:four]).to eq("ONE TWO ONE ONE TWO THREE FOUR")
|
535
490
|
end
|
536
491
|
|
537
492
|
it "should provide a method for returning uninterpolated values" do
|
538
493
|
@settings[:two] = "$one tw0"
|
539
|
-
@settings.
|
540
|
-
@settings.
|
494
|
+
expect(@settings.value(:two, nil, true)).to eq("$one tw0")
|
495
|
+
expect(@settings.value(:four, nil, true)).to eq("$two $three FOUR")
|
541
496
|
end
|
542
497
|
|
543
498
|
it "should interpolate set values for other parameters into returned parameter values" do
|
@@ -545,48 +500,27 @@ describe Puppet::Settings do
|
|
545
500
|
@settings[:two] = "$one tw0"
|
546
501
|
@settings[:three] = "$one $two thr33"
|
547
502
|
@settings[:four] = "$one $two $three f0ur"
|
548
|
-
@settings[:one].
|
549
|
-
@settings[:two].
|
550
|
-
@settings[:three].
|
551
|
-
@settings[:four].
|
503
|
+
expect(@settings[:one]).to eq("on3")
|
504
|
+
expect(@settings[:two]).to eq("on3 tw0")
|
505
|
+
expect(@settings[:three]).to eq("on3 on3 tw0 thr33")
|
506
|
+
expect(@settings[:four]).to eq("on3 on3 tw0 on3 on3 tw0 thr33 f0ur")
|
552
507
|
end
|
553
508
|
|
554
509
|
it "should not cache interpolated values such that stale information is returned" do
|
555
|
-
@settings[:two].
|
510
|
+
expect(@settings[:two]).to eq("ONE TWO")
|
556
511
|
@settings[:one] = "one"
|
557
|
-
@settings[:two].
|
558
|
-
end
|
559
|
-
|
560
|
-
it "should not cache values such that information from one environment is returned for another environment" do
|
561
|
-
text = "[env1]\none = oneval\n[env2]\none = twoval\n"
|
562
|
-
@settings.stubs(:read_file).returns(text)
|
563
|
-
@settings.send(:parse_config_files)
|
564
|
-
|
565
|
-
@settings.value(:one, "env1").should == "oneval"
|
566
|
-
@settings.value(:one, "env2").should == "twoval"
|
512
|
+
expect(@settings[:two]).to eq("one TWO")
|
567
513
|
end
|
568
514
|
|
569
515
|
it "should have a run_mode that defaults to user" do
|
570
|
-
@settings.preferred_run_mode.
|
516
|
+
expect(@settings.preferred_run_mode).to eq(:user)
|
571
517
|
end
|
572
518
|
|
573
519
|
it "interpolates a boolean false without raising an error" do
|
574
520
|
@settings.define_settings(:section,
|
575
521
|
:trip_wire => { :type => :boolean, :default => false, :desc => "a trip wire" },
|
576
522
|
:tripping => { :default => '$trip_wire', :desc => "once tripped if interpolated was false" })
|
577
|
-
@settings[:tripping].
|
578
|
-
end
|
579
|
-
|
580
|
-
describe "setbycli" do
|
581
|
-
it "should generate a deprecation warning" do
|
582
|
-
@settings.handlearg("--one", "blah")
|
583
|
-
Puppet.expects(:deprecation_warning)
|
584
|
-
@settings.setting(:one).setbycli
|
585
|
-
end
|
586
|
-
it "should be true" do
|
587
|
-
@settings.handlearg("--one", "blah")
|
588
|
-
@settings.setting(:one).setbycli.should be_true
|
589
|
-
end
|
523
|
+
expect(@settings[:tripping]).to eq("false")
|
590
524
|
end
|
591
525
|
end
|
592
526
|
|
@@ -602,7 +536,7 @@ describe Puppet::Settings do
|
|
602
536
|
end
|
603
537
|
|
604
538
|
it "should return default values if no values have been set" do
|
605
|
-
@settings[:one].
|
539
|
+
expect(@settings[:one]).to eq("ONE")
|
606
540
|
end
|
607
541
|
|
608
542
|
it "should return values set on the cli before values set in the configuration file" do
|
@@ -611,7 +545,7 @@ describe Puppet::Settings do
|
|
611
545
|
@settings.handlearg("--one", "clival")
|
612
546
|
@settings.send(:parse_config_files)
|
613
547
|
|
614
|
-
@settings[:one].
|
548
|
+
expect(@settings[:one]).to eq("clival")
|
615
549
|
end
|
616
550
|
|
617
551
|
it "should return values set in the mode-specific section before values set in the main section" do
|
@@ -619,7 +553,7 @@ describe Puppet::Settings do
|
|
619
553
|
@settings.stubs(:read_file).returns(text)
|
620
554
|
@settings.send(:parse_config_files)
|
621
555
|
|
622
|
-
@settings[:one].
|
556
|
+
expect(@settings[:one]).to eq("modeval")
|
623
557
|
end
|
624
558
|
|
625
559
|
it "should not return values outside of its search path" do
|
@@ -627,71 +561,16 @@ describe Puppet::Settings do
|
|
627
561
|
file = "/some/file"
|
628
562
|
@settings.stubs(:read_file).returns(text)
|
629
563
|
@settings.send(:parse_config_files)
|
630
|
-
@settings[:one].
|
631
|
-
end
|
632
|
-
|
633
|
-
it "should return values in a specified environment" do
|
634
|
-
text = "[env]\none = envval\n"
|
635
|
-
@settings.stubs(:read_file).returns(text)
|
636
|
-
@settings.send(:parse_config_files)
|
637
|
-
@settings.value(:one, "env").should == "envval"
|
564
|
+
expect(@settings[:one]).to eq("ONE")
|
638
565
|
end
|
639
566
|
|
640
567
|
it 'should use the current environment for $environment' do
|
641
|
-
@settings.define_settings :main, :
|
642
|
-
|
643
|
-
@settings.value(:myval, "myenv").should == "myenv/foo"
|
644
|
-
end
|
645
|
-
|
646
|
-
it "should interpolate found values using the current environment" do
|
647
|
-
text = "[main]\none = mainval\n[myname]\none = nameval\ntwo = $one/two\n"
|
648
|
-
@settings.stubs(:read_file).returns(text)
|
649
|
-
@settings.send(:parse_config_files)
|
650
|
-
|
651
|
-
@settings.value(:two, "myname").should == "nameval/two"
|
652
|
-
end
|
653
|
-
|
654
|
-
it "should return values in a specified environment before values in the main or name sections" do
|
655
|
-
text = "[env]\none = envval\n[main]\none = mainval\n[myname]\none = nameval\n"
|
656
|
-
@settings.stubs(:read_file).returns(text)
|
657
|
-
@settings.send(:parse_config_files)
|
658
|
-
@settings.value(:one, "env").should == "envval"
|
659
|
-
end
|
660
|
-
|
661
|
-
context "when interpolating a dynamic environments setting" do
|
662
|
-
let(:dynamic_manifestdir) { "manifestdir=/somewhere/$environment/manifests" }
|
663
|
-
let(:environment) { "environment=anenv" }
|
568
|
+
@settings.define_settings :main, :config_version => { :default => "$environment/foo", :desc => "mydocs" }
|
664
569
|
|
665
|
-
|
666
|
-
@settings.define_settings :main,
|
667
|
-
:manifestdir => { :default => "/manifests", :desc => "manifestdir setting" },
|
668
|
-
:environment => { :default => "production", :desc => "environment setting" }
|
669
|
-
end
|
670
|
-
|
671
|
-
it "interpolates default environment when no environment specified" do
|
672
|
-
text = <<-EOF
|
673
|
-
[main]
|
674
|
-
#{dynamic_manifestdir}
|
675
|
-
EOF
|
676
|
-
@settings.stubs(:read_file).returns(text)
|
677
|
-
@settings.send(:parse_config_files)
|
678
|
-
expect(@settings.value(:manifestdir)).to eq("/somewhere/production/manifests")
|
679
|
-
end
|
680
|
-
|
681
|
-
it "interpolates the set environment when no environment specified" do
|
682
|
-
text = <<-EOF
|
683
|
-
[main]
|
684
|
-
#{dynamic_manifestdir}
|
685
|
-
#{environment}
|
686
|
-
EOF
|
687
|
-
@settings.stubs(:read_file).returns(text)
|
688
|
-
@settings.send(:parse_config_files)
|
689
|
-
expect(@settings.value(:manifestdir)).to eq("/somewhere/anenv/manifests")
|
690
|
-
end
|
570
|
+
expect(@settings.value(:config_version, "myenv")).to eq("myenv/foo")
|
691
571
|
end
|
692
572
|
end
|
693
573
|
|
694
|
-
|
695
574
|
describe "when locating config files" do
|
696
575
|
before do
|
697
576
|
@settings = Puppet::Settings.new
|
@@ -749,7 +628,7 @@ describe Puppet::Settings do
|
|
749
628
|
Puppet::FileSystem.expects(:exist?).with(myfile).returns(true)
|
750
629
|
@settings.expects(:read_file).returns(text)
|
751
630
|
@settings.send(:parse_config_files)
|
752
|
-
@settings[:report].
|
631
|
+
expect(@settings[:report]).to be_truthy
|
753
632
|
end
|
754
633
|
|
755
634
|
it "should use its current ':config' value for the file to parse" do
|
@@ -777,14 +656,14 @@ describe Puppet::Settings do
|
|
777
656
|
"
|
778
657
|
@settings.expects(:read_file).returns(text)
|
779
658
|
@settings.send(:parse_config_files)
|
780
|
-
@settings[:one].
|
659
|
+
expect(@settings[:one]).to eq("fileval")
|
781
660
|
end
|
782
661
|
|
783
662
|
#484 - this should probably be in the regression area
|
784
663
|
it "should not throw an exception on unknown parameters" do
|
785
664
|
text = "[main]\nnosuchparam = mval\n"
|
786
665
|
@settings.expects(:read_file).returns(text)
|
787
|
-
|
666
|
+
expect { @settings.send(:parse_config_files) }.not_to raise_error
|
788
667
|
end
|
789
668
|
|
790
669
|
it "should convert booleans in the configuration file into Ruby booleans" do
|
@@ -794,8 +673,8 @@ describe Puppet::Settings do
|
|
794
673
|
"
|
795
674
|
@settings.expects(:read_file).returns(text)
|
796
675
|
@settings.send(:parse_config_files)
|
797
|
-
@settings[:one].
|
798
|
-
@settings[:two].
|
676
|
+
expect(@settings[:one]).to eq(true)
|
677
|
+
expect(@settings[:two]).to eq(false)
|
799
678
|
end
|
800
679
|
|
801
680
|
it "should convert integers in the configuration file into Ruby Integers" do
|
@@ -804,7 +683,7 @@ describe Puppet::Settings do
|
|
804
683
|
"
|
805
684
|
@settings.expects(:read_file).returns(text)
|
806
685
|
@settings.send(:parse_config_files)
|
807
|
-
@settings[:one].
|
686
|
+
expect(@settings[:one]).to eq(65)
|
808
687
|
end
|
809
688
|
|
810
689
|
it "should support specifying all metadata (owner, group, mode) in the configuration file" do
|
@@ -816,8 +695,8 @@ describe Puppet::Settings do
|
|
816
695
|
myfile = #{otherfile} {owner = service, group = service, mode = 644}
|
817
696
|
CONF
|
818
697
|
|
819
|
-
@settings[:myfile].
|
820
|
-
@settings.
|
698
|
+
expect(@settings[:myfile]).to eq(otherfile)
|
699
|
+
expect(metadata(@settings.setting(:myfile))).to eq({:owner => "suser", :group => "sgroup", :mode => "644"})
|
821
700
|
end
|
822
701
|
|
823
702
|
it "should support specifying a single piece of metadata (owner, group, or mode) in the configuration file" do
|
@@ -829,8 +708,8 @@ describe Puppet::Settings do
|
|
829
708
|
myfile = #{otherfile} {owner = service}
|
830
709
|
CONF
|
831
710
|
|
832
|
-
@settings[:myfile].
|
833
|
-
@settings.
|
711
|
+
expect(@settings[:myfile]).to eq(otherfile)
|
712
|
+
expect(metadata(@settings.setting(:myfile))).to eq({:owner => "suser"})
|
834
713
|
end
|
835
714
|
|
836
715
|
it "should support loading metadata (owner, group, or mode) from a run_mode section in the configuration file" do
|
@@ -848,16 +727,16 @@ describe Puppet::Settings do
|
|
848
727
|
@settings.expects(:read_file).returns(text)
|
849
728
|
|
850
729
|
# will start initialization as user
|
851
|
-
@settings.preferred_run_mode.
|
730
|
+
expect(@settings.preferred_run_mode).to eq(:user)
|
852
731
|
@settings.send(:parse_config_files)
|
853
732
|
|
854
733
|
# change app run_mode to master
|
855
734
|
@settings.initialize_app_defaults(default_values.merge(:run_mode => :master))
|
856
|
-
@settings.preferred_run_mode.
|
735
|
+
expect(@settings.preferred_run_mode).to eq(:master)
|
857
736
|
|
858
737
|
# initializing the app should have reloaded the metadata based on run_mode
|
859
|
-
@settings[:myfile].
|
860
|
-
@settings.
|
738
|
+
expect(@settings[:myfile]).to eq(otherfile)
|
739
|
+
expect(metadata(@settings.setting(:myfile))).to eq({:mode => "664"})
|
861
740
|
end
|
862
741
|
|
863
742
|
it "does not use the metadata from the same setting in a different section" do
|
@@ -879,16 +758,16 @@ describe Puppet::Settings do
|
|
879
758
|
@settings.expects(:read_file).returns(text)
|
880
759
|
|
881
760
|
# will start initialization as user
|
882
|
-
@settings.preferred_run_mode.
|
761
|
+
expect(@settings.preferred_run_mode).to eq(:user)
|
883
762
|
@settings.send(:parse_config_files)
|
884
763
|
|
885
764
|
# change app run_mode to master
|
886
765
|
@settings.initialize_app_defaults(default_values.merge(:run_mode => :master))
|
887
|
-
@settings.preferred_run_mode.
|
766
|
+
expect(@settings.preferred_run_mode).to eq(:master)
|
888
767
|
|
889
768
|
# initializing the app should have reloaded the metadata based on run_mode
|
890
|
-
@settings[:myfile].
|
891
|
-
@settings.
|
769
|
+
expect(@settings[:myfile]).to eq("#{file}/foo")
|
770
|
+
expect(metadata(@settings.setting(:myfile))).to eq({ :mode => default_mode })
|
892
771
|
end
|
893
772
|
|
894
773
|
it "should call hooks associated with values set in the configuration file" do
|
@@ -900,7 +779,7 @@ describe Puppet::Settings do
|
|
900
779
|
"
|
901
780
|
@settings.expects(:read_file).returns(text)
|
902
781
|
@settings.send(:parse_config_files)
|
903
|
-
values.
|
782
|
+
expect(values).to eq(["setval"])
|
904
783
|
end
|
905
784
|
|
906
785
|
it "should not call the same hook for values set multiple times in the configuration file" do
|
@@ -914,23 +793,7 @@ describe Puppet::Settings do
|
|
914
793
|
"
|
915
794
|
@settings.expects(:read_file).returns(text)
|
916
795
|
@settings.send(:parse_config_files)
|
917
|
-
values.
|
918
|
-
end
|
919
|
-
|
920
|
-
it "should pass the environment-specific value to the hook when one is available" do
|
921
|
-
values = []
|
922
|
-
@settings.define_settings :section, :mysetting => {:default => "defval", :desc => "a", :hook => proc { |v| values << v }}
|
923
|
-
@settings.define_settings :section, :environment => { :default => "yay", :desc => "a" }
|
924
|
-
@settings.define_settings :section, :environments => { :default => "yay,foo", :desc => "a" }
|
925
|
-
|
926
|
-
text = "[main]
|
927
|
-
mysetting = setval
|
928
|
-
[yay]
|
929
|
-
mysetting = other
|
930
|
-
"
|
931
|
-
@settings.expects(:read_file).returns(text)
|
932
|
-
@settings.send(:parse_config_files)
|
933
|
-
values.should == ["other"]
|
796
|
+
expect(values).to eq(["setval"])
|
934
797
|
end
|
935
798
|
|
936
799
|
it "should pass the interpolated value to the hook when one is available" do
|
@@ -943,7 +806,7 @@ describe Puppet::Settings do
|
|
943
806
|
"
|
944
807
|
@settings.expects(:read_file).returns(text)
|
945
808
|
@settings.send(:parse_config_files)
|
946
|
-
values.
|
809
|
+
expect(values).to eq(["yay/setval"])
|
947
810
|
end
|
948
811
|
|
949
812
|
it "should allow hooks invoked at parse time to be deferred" do
|
@@ -955,6 +818,7 @@ describe Puppet::Settings do
|
|
955
818
|
@settings.define_settings(:main,
|
956
819
|
:logdir => { :type => :directory, :default => nil, :desc => "logdir" },
|
957
820
|
:confdir => { :type => :directory, :default => nil, :desc => "confdir" },
|
821
|
+
:codedir => { :type => :directory, :default => nil, :desc => "codedir" },
|
958
822
|
:vardir => { :type => :directory, :default => nil, :desc => "vardir" })
|
959
823
|
|
960
824
|
text = <<-EOD
|
@@ -965,12 +829,12 @@ describe Puppet::Settings do
|
|
965
829
|
@settings.stubs(:read_file).returns(text)
|
966
830
|
@settings.initialize_global_settings
|
967
831
|
|
968
|
-
hook_invoked.
|
832
|
+
expect(hook_invoked).to be_falsey
|
969
833
|
|
970
|
-
@settings.initialize_app_defaults(:logdir => '/path/to/logdir', :confdir => '/path/to/confdir', :vardir => '/path/to/vardir')
|
834
|
+
@settings.initialize_app_defaults(:logdir => '/path/to/logdir', :confdir => '/path/to/confdir', :vardir => '/path/to/vardir', :codedir => '/path/to/codedir')
|
971
835
|
|
972
|
-
hook_invoked.
|
973
|
-
@settings[:deferred].
|
836
|
+
expect(hook_invoked).to be_truthy
|
837
|
+
expect(@settings[:deferred]).to eq(File.expand_path('/path/to/confdir/goose'))
|
974
838
|
end
|
975
839
|
|
976
840
|
it "does not require the value for a setting without a hook to resolve during global setup" do
|
@@ -980,6 +844,7 @@ describe Puppet::Settings do
|
|
980
844
|
@settings.define_settings(:main,
|
981
845
|
:logdir => { :type => :directory, :default => nil, :desc => "logdir" },
|
982
846
|
:confdir => { :type => :directory, :default => nil, :desc => "confdir" },
|
847
|
+
:codedir => { :type => :directory, :default => nil, :desc => "codedir" },
|
983
848
|
:vardir => { :type => :directory, :default => nil, :desc => "vardir" })
|
984
849
|
|
985
850
|
text = <<-EOD
|
@@ -989,9 +854,9 @@ describe Puppet::Settings do
|
|
989
854
|
|
990
855
|
@settings.stubs(:read_file).returns(text)
|
991
856
|
@settings.initialize_global_settings
|
992
|
-
@settings.initialize_app_defaults(:logdir => '/path/to/logdir', :confdir => '/path/to/confdir', :vardir => '/path/to/vardir')
|
857
|
+
@settings.initialize_app_defaults(:logdir => '/path/to/logdir', :confdir => '/path/to/confdir', :vardir => '/path/to/vardir', :codedir => '/path/to/codedir')
|
993
858
|
|
994
|
-
@settings[:can_cause_problems].
|
859
|
+
expect(@settings[:can_cause_problems]).to eq(File.expand_path('/path/to/confdir/goose'))
|
995
860
|
end
|
996
861
|
|
997
862
|
it "should allow empty values" do
|
@@ -1002,7 +867,7 @@ describe Puppet::Settings do
|
|
1002
867
|
"
|
1003
868
|
@settings.stubs(:read_file).returns(text)
|
1004
869
|
@settings.send(:parse_config_files)
|
1005
|
-
@settings[:myarg].
|
870
|
+
expect(@settings[:myarg]).to eq("")
|
1006
871
|
end
|
1007
872
|
|
1008
873
|
describe "deprecations" do
|
@@ -1011,13 +876,14 @@ describe Puppet::Settings do
|
|
1011
876
|
{
|
1012
877
|
:logdir => "/dev/null",
|
1013
878
|
:confdir => "/dev/null",
|
879
|
+
:codedir => "/dev/null",
|
1014
880
|
:vardir => "/dev/null",
|
1015
881
|
}
|
1016
882
|
}
|
1017
883
|
|
1018
884
|
def assert_accessing_setting_is_deprecated(settings, setting)
|
1019
|
-
Puppet.expects(:deprecation_warning).with("Accessing '#{setting}' as a setting is deprecated.
|
1020
|
-
Puppet.expects(:deprecation_warning).with("Modifying '#{setting}' as a setting is deprecated.
|
885
|
+
Puppet.expects(:deprecation_warning).with("Accessing '#{setting}' as a setting is deprecated.")
|
886
|
+
Puppet.expects(:deprecation_warning).with("Modifying '#{setting}' as a setting is deprecated.")
|
1021
887
|
settings[setting.intern] = apath = File.expand_path('foo')
|
1022
888
|
expect(settings[setting.intern]).to eq(apath)
|
1023
889
|
end
|
@@ -1027,13 +893,14 @@ describe Puppet::Settings do
|
|
1027
893
|
:logdir => { :default => 'a', :desc => 'a' },
|
1028
894
|
:confdir => { :default => 'b', :desc => 'b' },
|
1029
895
|
:vardir => { :default => 'c', :desc => 'c' },
|
896
|
+
:codedir => { :default => 'd', :desc => 'd' },
|
1030
897
|
})
|
1031
898
|
end
|
1032
899
|
|
1033
900
|
context "complete" do
|
1034
901
|
let(:completely_deprecated_settings) do
|
1035
902
|
settings.define_settings(:main, {
|
1036
|
-
:
|
903
|
+
:completely_deprecated_setting => {
|
1037
904
|
:default => 'foo',
|
1038
905
|
:desc => 'a deprecated setting',
|
1039
906
|
:deprecated => :completely,
|
@@ -1043,31 +910,31 @@ describe Puppet::Settings do
|
|
1043
910
|
end
|
1044
911
|
|
1045
912
|
it "warns when set in puppet.conf" do
|
1046
|
-
Puppet.expects(:deprecation_warning).with(regexp_matches(/
|
913
|
+
Puppet.expects(:deprecation_warning).with(regexp_matches(/completely_deprecated_setting is deprecated\./), 'setting-completely_deprecated_setting')
|
1047
914
|
|
1048
915
|
completely_deprecated_settings.parse_config(<<-CONF)
|
1049
|
-
|
916
|
+
completely_deprecated_setting='should warn'
|
1050
917
|
CONF
|
1051
918
|
completely_deprecated_settings.initialize_app_defaults(app_defaults)
|
1052
919
|
end
|
1053
920
|
|
1054
921
|
it "warns when set on the commandline" do
|
1055
|
-
Puppet.expects(:deprecation_warning).with(regexp_matches(/
|
922
|
+
Puppet.expects(:deprecation_warning).with(regexp_matches(/completely_deprecated_setting is deprecated\./), 'setting-completely_deprecated_setting')
|
1056
923
|
|
1057
|
-
args = ["--
|
924
|
+
args = ["--completely_deprecated_setting", "/some/value"]
|
1058
925
|
completely_deprecated_settings.send(:parse_global_options, args)
|
1059
926
|
completely_deprecated_settings.initialize_app_defaults(app_defaults)
|
1060
927
|
end
|
1061
928
|
|
1062
929
|
it "warns when set in code" do
|
1063
|
-
assert_accessing_setting_is_deprecated(completely_deprecated_settings, '
|
930
|
+
assert_accessing_setting_is_deprecated(completely_deprecated_settings, 'completely_deprecated_setting')
|
1064
931
|
end
|
1065
932
|
end
|
1066
933
|
|
1067
934
|
context "partial" do
|
1068
935
|
let(:partially_deprecated_settings) do
|
1069
936
|
settings.define_settings(:main, {
|
1070
|
-
:
|
937
|
+
:partially_deprecated_setting => {
|
1071
938
|
:default => 'foo',
|
1072
939
|
:desc => 'a partially deprecated setting',
|
1073
940
|
:deprecated => :allowed_on_commandline,
|
@@ -1077,9 +944,9 @@ describe Puppet::Settings do
|
|
1077
944
|
end
|
1078
945
|
|
1079
946
|
it "warns for a deprecated setting allowed on the command line set in puppet.conf" do
|
1080
|
-
Puppet.expects(:deprecation_warning).with(regexp_matches(/
|
947
|
+
Puppet.expects(:deprecation_warning).with(regexp_matches(/partially_deprecated_setting is deprecated in puppet\.conf/), 'puppet-conf-setting-partially_deprecated_setting')
|
1081
948
|
partially_deprecated_settings.parse_config(<<-CONF)
|
1082
|
-
|
949
|
+
partially_deprecated_setting='should warn'
|
1083
950
|
CONF
|
1084
951
|
partially_deprecated_settings.initialize_app_defaults(app_defaults)
|
1085
952
|
end
|
@@ -1087,13 +954,13 @@ describe Puppet::Settings do
|
|
1087
954
|
it "does not warn when manifest is set on command line" do
|
1088
955
|
Puppet.expects(:deprecation_warning).never
|
1089
956
|
|
1090
|
-
args = ["--
|
957
|
+
args = ["--partially_deprecated_setting", "/some/value"]
|
1091
958
|
partially_deprecated_settings.send(:parse_global_options, args)
|
1092
959
|
partially_deprecated_settings.initialize_app_defaults(app_defaults)
|
1093
960
|
end
|
1094
961
|
|
1095
962
|
it "warns when set in code" do
|
1096
|
-
assert_accessing_setting_is_deprecated(partially_deprecated_settings, '
|
963
|
+
assert_accessing_setting_is_deprecated(partially_deprecated_settings, 'partially_deprecated_setting')
|
1097
964
|
end
|
1098
965
|
end
|
1099
966
|
end
|
@@ -1126,12 +993,12 @@ describe Puppet::Settings do
|
|
1126
993
|
|
1127
994
|
it "should return values from the user config file" do
|
1128
995
|
@settings.send(:parse_config_files)
|
1129
|
-
@settings[:one].
|
996
|
+
expect(@settings[:one]).to eq("user")
|
1130
997
|
end
|
1131
998
|
|
1132
999
|
it "should not return values from the main config file" do
|
1133
1000
|
@settings.send(:parse_config_files)
|
1134
|
-
@settings[:two].
|
1001
|
+
expect(@settings[:two]).to eq("TWO")
|
1135
1002
|
end
|
1136
1003
|
end
|
1137
1004
|
|
@@ -1148,12 +1015,12 @@ describe Puppet::Settings do
|
|
1148
1015
|
|
1149
1016
|
it "should return values from the main config file" do
|
1150
1017
|
@settings.send(:parse_config_files)
|
1151
|
-
@settings[:one].
|
1018
|
+
expect(@settings[:one]).to eq("main")
|
1152
1019
|
end
|
1153
1020
|
|
1154
1021
|
it "should not return values from the user config file" do
|
1155
1022
|
@settings.send(:parse_config_files)
|
1156
|
-
@settings[:two].
|
1023
|
+
expect(@settings[:two]).to eq("main2")
|
1157
1024
|
end
|
1158
1025
|
end
|
1159
1026
|
|
@@ -1171,12 +1038,12 @@ describe Puppet::Settings do
|
|
1171
1038
|
|
1172
1039
|
it "should return values from the main config file" do
|
1173
1040
|
@settings.send(:parse_config_files)
|
1174
|
-
@settings[:one].
|
1041
|
+
expect(@settings[:one]).to eq("main")
|
1175
1042
|
end
|
1176
1043
|
|
1177
1044
|
it "should not return values from the user config file" do
|
1178
1045
|
@settings.send(:parse_config_files)
|
1179
|
-
@settings[:two].
|
1046
|
+
expect(@settings[:two]).to eq("main2")
|
1180
1047
|
end
|
1181
1048
|
end
|
1182
1049
|
end
|
@@ -1241,7 +1108,7 @@ describe Puppet::Settings do
|
|
1241
1108
|
text = "[main]\none = disk-replace\n"
|
1242
1109
|
@settings.stubs(:read_file).returns(text)
|
1243
1110
|
@settings.reparse_config_files
|
1244
|
-
@settings[:one].
|
1111
|
+
expect(@settings[:one]).to eq("disk-replace")
|
1245
1112
|
end
|
1246
1113
|
end
|
1247
1114
|
|
@@ -1252,7 +1119,7 @@ describe Puppet::Settings do
|
|
1252
1119
|
@settings.stubs(:read_file).returns(text)
|
1253
1120
|
@settings.send(:parse_config_files)
|
1254
1121
|
|
1255
|
-
@settings[:one].
|
1122
|
+
expect(@settings[:one]).to eq("clival")
|
1256
1123
|
end
|
1257
1124
|
|
1258
1125
|
it "should remove in-memory values that are no longer set in the file" do
|
@@ -1260,7 +1127,7 @@ describe Puppet::Settings do
|
|
1260
1127
|
text = "[main]\none = disk-init\n"
|
1261
1128
|
@settings.expects(:read_file).returns(text)
|
1262
1129
|
@settings.send(:parse_config_files)
|
1263
|
-
@settings[:one].
|
1130
|
+
expect(@settings[:one]).to eq("disk-init")
|
1264
1131
|
|
1265
1132
|
# Now replace the value
|
1266
1133
|
text = "[main]\ntwo = disk-replace\n"
|
@@ -1268,10 +1135,10 @@ describe Puppet::Settings do
|
|
1268
1135
|
@settings.send(:parse_config_files)
|
1269
1136
|
|
1270
1137
|
# The originally-overridden value should be replaced with the default
|
1271
|
-
@settings[:one].
|
1138
|
+
expect(@settings[:one]).to eq("ONE")
|
1272
1139
|
|
1273
1140
|
# and we should now have the new value in memory
|
1274
|
-
@settings[:two].
|
1141
|
+
expect(@settings[:two]).to eq("disk-replace")
|
1275
1142
|
end
|
1276
1143
|
|
1277
1144
|
it "should retain in-memory values if the file has a syntax error" do
|
@@ -1279,7 +1146,7 @@ describe Puppet::Settings do
|
|
1279
1146
|
text = "[main]\none = initial-value\n"
|
1280
1147
|
@settings.expects(:read_file).with(@file).returns(text)
|
1281
1148
|
@settings.send(:parse_config_files)
|
1282
|
-
@settings[:one].
|
1149
|
+
expect(@settings[:one]).to eq("initial-value")
|
1283
1150
|
|
1284
1151
|
# Now replace the value with something bogus
|
1285
1152
|
text = "[main]\nkenny = killed-by-what-follows\n1 is 2, blah blah florp\n"
|
@@ -1287,15 +1154,15 @@ describe Puppet::Settings do
|
|
1287
1154
|
@settings.send(:parse_config_files)
|
1288
1155
|
|
1289
1156
|
# The originally-overridden value should not be replaced with the default
|
1290
|
-
@settings[:one].
|
1157
|
+
expect(@settings[:one]).to eq("initial-value")
|
1291
1158
|
|
1292
1159
|
# and we should not have the new value in memory
|
1293
|
-
@settings[:kenny].
|
1160
|
+
expect(@settings[:kenny]).to be_nil
|
1294
1161
|
end
|
1295
1162
|
end
|
1296
1163
|
|
1297
1164
|
it "should provide a method for creating a catalog of resources from its configuration" do
|
1298
|
-
Puppet::Settings.new.
|
1165
|
+
expect(Puppet::Settings.new).to respond_to(:to_catalog)
|
1299
1166
|
end
|
1300
1167
|
|
1301
1168
|
describe "when creating a catalog" do
|
@@ -1315,7 +1182,7 @@ describe Puppet::Settings do
|
|
1315
1182
|
catalog = @settings.to_catalog
|
1316
1183
|
|
1317
1184
|
[@prefix+"/maindir", @prefix+"/seconddir", @prefix+"/otherdir"].each do |path|
|
1318
|
-
catalog.resource(:file, path).
|
1185
|
+
expect(catalog.resource(:file, path)).to be_instance_of(Puppet::Resource)
|
1319
1186
|
end
|
1320
1187
|
end
|
1321
1188
|
|
@@ -1323,14 +1190,14 @@ describe Puppet::Settings do
|
|
1323
1190
|
@settings.define_settings :main, :maindir => { :type => :directory, :default => @prefix+"/maindir", :desc => "a" }
|
1324
1191
|
@settings.define_settings :other, :otherdir => { :type => :directory, :default => @prefix+"/otherdir", :desc => "a" }
|
1325
1192
|
catalog = @settings.to_catalog(:main)
|
1326
|
-
catalog.resource(:file, @prefix+"/otherdir").
|
1327
|
-
catalog.resource(:file, @prefix+"/maindir").
|
1193
|
+
expect(catalog.resource(:file, @prefix+"/otherdir")).to be_nil
|
1194
|
+
expect(catalog.resource(:file, @prefix+"/maindir")).to be_instance_of(Puppet::Resource)
|
1328
1195
|
end
|
1329
1196
|
|
1330
1197
|
it "should not try to add the same file twice" do
|
1331
1198
|
@settings.define_settings :main, :maindir => { :type => :directory, :default => @prefix+"/maindir", :desc => "a" }
|
1332
1199
|
@settings.define_settings :other, :otherdir => { :type => :directory, :default => @prefix+"/maindir", :desc => "a" }
|
1333
|
-
|
1200
|
+
expect { @settings.to_catalog }.not_to raise_error
|
1334
1201
|
end
|
1335
1202
|
|
1336
1203
|
it "should ignore files whose :to_resource method returns nil" do
|
@@ -1341,16 +1208,6 @@ describe Puppet::Settings do
|
|
1341
1208
|
@settings.to_catalog
|
1342
1209
|
end
|
1343
1210
|
|
1344
|
-
it "should ignore manifestdir if environmentpath is set" do
|
1345
|
-
@settings.define_settings :main,
|
1346
|
-
:manifestdir => { :type => :directory, :default => @prefix+"/manifestdir", :desc => "a" },
|
1347
|
-
:environmentpath => { :type => :path, :default => @prefix+"/envs", :desc => "a" }
|
1348
|
-
|
1349
|
-
catalog = @settings.to_catalog(:main)
|
1350
|
-
|
1351
|
-
expect(catalog).to_not have_resource("File[#{@prefix}/manifestdir]")
|
1352
|
-
end
|
1353
|
-
|
1354
1211
|
describe "on Microsoft Windows" do
|
1355
1212
|
before :each do
|
1356
1213
|
Puppet.features.stubs(:root?).returns true
|
@@ -1367,8 +1224,8 @@ describe Puppet::Settings do
|
|
1367
1224
|
end
|
1368
1225
|
|
1369
1226
|
it "it should not add users and groups to the catalog" do
|
1370
|
-
@catalog.resource(:user, "suser").
|
1371
|
-
@catalog.resource(:group, "sgroup").
|
1227
|
+
expect(@catalog.resource(:user, "suser")).to be_nil
|
1228
|
+
expect(@catalog.resource(:group, "sgroup")).to be_nil
|
1372
1229
|
end
|
1373
1230
|
end
|
1374
1231
|
|
@@ -1432,23 +1289,23 @@ describe Puppet::Settings do
|
|
1432
1289
|
end
|
1433
1290
|
|
1434
1291
|
it "should add each specified user and group to the catalog if :mkusers is a valid setting, is enabled, and we're running as root" do
|
1435
|
-
@catalog.resource(:user, "suser").
|
1436
|
-
@catalog.resource(:group, "sgroup").
|
1292
|
+
expect(@catalog.resource(:user, "suser")).to be_instance_of(Puppet::Resource)
|
1293
|
+
expect(@catalog.resource(:group, "sgroup")).to be_instance_of(Puppet::Resource)
|
1437
1294
|
end
|
1438
1295
|
|
1439
1296
|
it "should only add users and groups to the catalog from specified sections" do
|
1440
1297
|
@settings.define_settings :yay, :yaydir => { :type => :directory, :default => "/yaydir", :desc => "a", :owner => "service", :group => "service"}
|
1441
1298
|
catalog = @settings.to_catalog(:other)
|
1442
|
-
catalog.resource(:user, "jane").
|
1443
|
-
catalog.resource(:group, "billy").
|
1299
|
+
expect(catalog.resource(:user, "jane")).to be_nil
|
1300
|
+
expect(catalog.resource(:group, "billy")).to be_nil
|
1444
1301
|
end
|
1445
1302
|
|
1446
1303
|
it "should not add users or groups to the catalog if :mkusers not running as root" do
|
1447
1304
|
Puppet.features.stubs(:root?).returns false
|
1448
1305
|
|
1449
1306
|
catalog = @settings.to_catalog
|
1450
|
-
catalog.resource(:user, "suser").
|
1451
|
-
catalog.resource(:group, "sgroup").
|
1307
|
+
expect(catalog.resource(:user, "suser")).to be_nil
|
1308
|
+
expect(catalog.resource(:group, "sgroup")).to be_nil
|
1452
1309
|
end
|
1453
1310
|
|
1454
1311
|
it "should not add users or groups to the catalog if :mkusers is not a valid setting" do
|
@@ -1457,45 +1314,45 @@ describe Puppet::Settings do
|
|
1457
1314
|
settings.define_settings :other, :otherdir => {:type => :directory, :default => "/otherdir", :desc => "a", :owner => "service", :group => "service"}
|
1458
1315
|
|
1459
1316
|
catalog = settings.to_catalog
|
1460
|
-
catalog.resource(:user, "suser").
|
1461
|
-
catalog.resource(:group, "sgroup").
|
1317
|
+
expect(catalog.resource(:user, "suser")).to be_nil
|
1318
|
+
expect(catalog.resource(:group, "sgroup")).to be_nil
|
1462
1319
|
end
|
1463
1320
|
|
1464
1321
|
it "should not add users or groups to the catalog if :mkusers is a valid setting but is disabled" do
|
1465
1322
|
@settings[:mkusers] = false
|
1466
1323
|
|
1467
1324
|
catalog = @settings.to_catalog
|
1468
|
-
catalog.resource(:user, "suser").
|
1469
|
-
catalog.resource(:group, "sgroup").
|
1325
|
+
expect(catalog.resource(:user, "suser")).to be_nil
|
1326
|
+
expect(catalog.resource(:group, "sgroup")).to be_nil
|
1470
1327
|
end
|
1471
1328
|
|
1472
1329
|
it "should not try to add users or groups to the catalog twice" do
|
1473
1330
|
@settings.define_settings :yay, :yaydir => {:type => :directory, :default => "/yaydir", :desc => "a", :owner => "service", :group => "service"}
|
1474
1331
|
|
1475
1332
|
# This would fail if users/groups were added twice
|
1476
|
-
|
1333
|
+
expect { @settings.to_catalog }.not_to raise_error
|
1477
1334
|
end
|
1478
1335
|
|
1479
1336
|
it "should set :ensure to :present on each created user and group" do
|
1480
|
-
@catalog.resource(:user, "suser")[:ensure].
|
1481
|
-
@catalog.resource(:group, "sgroup")[:ensure].
|
1337
|
+
expect(@catalog.resource(:user, "suser")[:ensure]).to eq(:present)
|
1338
|
+
expect(@catalog.resource(:group, "sgroup")[:ensure]).to eq(:present)
|
1482
1339
|
end
|
1483
1340
|
|
1484
1341
|
it "should set each created user's :gid to the service group" do
|
1485
|
-
@settings.to_catalog.resource(:user, "suser")[:gid].
|
1342
|
+
expect(@settings.to_catalog.resource(:user, "suser")[:gid]).to eq("sgroup")
|
1486
1343
|
end
|
1487
1344
|
|
1488
1345
|
it "should not attempt to manage the root user" do
|
1489
1346
|
Puppet.features.stubs(:root?).returns true
|
1490
1347
|
@settings.define_settings :foo, :foodir => {:type => :directory, :default => "/foodir", :desc => "a", :owner => "root", :group => "service"}
|
1491
1348
|
|
1492
|
-
@settings.to_catalog.resource(:user, "root").
|
1349
|
+
expect(@settings.to_catalog.resource(:user, "root")).to be_nil
|
1493
1350
|
end
|
1494
1351
|
end
|
1495
1352
|
end
|
1496
1353
|
|
1497
1354
|
it "should be able to be converted to a manifest" do
|
1498
|
-
Puppet::Settings.new.
|
1355
|
+
expect(Puppet::Settings.new).to respond_to(:to_manifest)
|
1499
1356
|
end
|
1500
1357
|
|
1501
1358
|
describe "when being converted to a manifest" do
|
@@ -1512,7 +1369,7 @@ describe Puppet::Settings do
|
|
1512
1369
|
@settings.setting(:maindir).expects(:to_resource).returns main
|
1513
1370
|
@settings.setting(:seconddir).expects(:to_resource).returns second
|
1514
1371
|
|
1515
|
-
@settings.to_manifest.split("\n\n").sort.
|
1372
|
+
expect(@settings.to_manifest.split("\n\n").sort).to eq(%w{maindir seconddir})
|
1516
1373
|
end
|
1517
1374
|
end
|
1518
1375
|
|
@@ -1531,12 +1388,6 @@ describe Puppet::Settings do
|
|
1531
1388
|
@settings.define_settings :files, :myfile => {:type => :file, :default => make_absolute("/myfile"), :desc => "a", :mode => '0755'}
|
1532
1389
|
end
|
1533
1390
|
|
1534
|
-
it "should provide a method that creates directories with the correct modes" do
|
1535
|
-
Puppet::Util::SUIDManager.expects(:asuser).with("suser", "sgroup").yields
|
1536
|
-
Dir.expects(:mkdir).with(make_absolute("/otherdir"), '0755')
|
1537
|
-
@settings.mkdir(:otherdir)
|
1538
|
-
end
|
1539
|
-
|
1540
1391
|
it "should create a catalog with the specified sections" do
|
1541
1392
|
@settings.expects(:to_catalog).with(:main, :other).returns Puppet::Resource::Catalog.new("foo")
|
1542
1393
|
@settings.use(:main, :other)
|
@@ -1621,22 +1472,22 @@ describe Puppet::Settings do
|
|
1621
1472
|
|
1622
1473
|
describe "when checking print_config?" do
|
1623
1474
|
it "should return false when the :configprint, :genconfig and :genmanifest are not set" do
|
1624
|
-
@settings.print_configs
|
1475
|
+
expect(@settings.print_configs?).to be_falsey
|
1625
1476
|
end
|
1626
1477
|
|
1627
1478
|
it "should return true when :configprint has a value" do
|
1628
1479
|
@settings.stubs(:value).with(:configprint).returns("something")
|
1629
|
-
@settings.print_configs
|
1480
|
+
expect(@settings.print_configs?).to be_truthy
|
1630
1481
|
end
|
1631
1482
|
|
1632
1483
|
it "should return true when :genconfig has a value" do
|
1633
1484
|
@settings.stubs(:value).with(:genconfig).returns(true)
|
1634
|
-
@settings.print_configs
|
1485
|
+
expect(@settings.print_configs?).to be_truthy
|
1635
1486
|
end
|
1636
1487
|
|
1637
1488
|
it "should return true when :genmanifest has a value" do
|
1638
1489
|
@settings.stubs(:value).with(:genmanifest).returns(true)
|
1639
|
-
@settings.print_configs
|
1490
|
+
expect(@settings.print_configs?).to be_truthy
|
1640
1491
|
end
|
1641
1492
|
end
|
1642
1493
|
|
@@ -1681,14 +1532,14 @@ describe Puppet::Settings do
|
|
1681
1532
|
@settings.stubs(:include?).with("something").returns(true)
|
1682
1533
|
@settings.stubs(:value).with("something", nil).returns("foo")
|
1683
1534
|
@settings.stubs(:puts).with("foo")
|
1684
|
-
@settings.print_configs.
|
1535
|
+
expect(@settings.print_configs).to be_truthy
|
1685
1536
|
end
|
1686
1537
|
|
1687
1538
|
it "should return false if a config param is not found" do
|
1688
1539
|
@settings.stubs :puts
|
1689
1540
|
@settings.stubs(:value).with(:configprint).returns("something")
|
1690
1541
|
@settings.stubs(:include?).with("something").returns(false)
|
1691
|
-
@settings.print_configs.
|
1542
|
+
expect(@settings.print_configs).to be_falsey
|
1692
1543
|
end
|
1693
1544
|
end
|
1694
1545
|
|
@@ -1706,7 +1557,7 @@ describe Puppet::Settings do
|
|
1706
1557
|
it "should return true from print_configs" do
|
1707
1558
|
@settings.stubs(:value).with(:genconfig).returns(true)
|
1708
1559
|
@settings.stubs(:to_config)
|
1709
|
-
@settings.print_configs.
|
1560
|
+
expect(@settings.print_configs).to be_truthy
|
1710
1561
|
end
|
1711
1562
|
end
|
1712
1563
|
|
@@ -1724,7 +1575,7 @@ describe Puppet::Settings do
|
|
1724
1575
|
it "should return true from print_configs" do
|
1725
1576
|
@settings.stubs(:value).with(:genmanifest).returns(true)
|
1726
1577
|
@settings.stubs(:to_manifest)
|
1727
|
-
@settings.print_configs.
|
1578
|
+
expect(@settings.print_configs).to be_truthy
|
1728
1579
|
end
|
1729
1580
|
end
|
1730
1581
|
end
|
@@ -1744,7 +1595,7 @@ describe Puppet::Settings do
|
|
1744
1595
|
end
|
1745
1596
|
|
1746
1597
|
it "should return false if there is no user setting" do
|
1747
|
-
settings.
|
1598
|
+
expect(settings).not_to be_service_user_available
|
1748
1599
|
end
|
1749
1600
|
|
1750
1601
|
it "should return false if the user provider says the user is missing" do
|
@@ -1752,7 +1603,7 @@ describe Puppet::Settings do
|
|
1752
1603
|
|
1753
1604
|
a_user_type_for("foo").expects(:exists?).returns false
|
1754
1605
|
|
1755
|
-
settings.
|
1606
|
+
expect(settings).not_to be_service_user_available
|
1756
1607
|
end
|
1757
1608
|
|
1758
1609
|
it "should return true if the user provider says the user is present" do
|
@@ -1760,16 +1611,16 @@ describe Puppet::Settings do
|
|
1760
1611
|
|
1761
1612
|
a_user_type_for("foo").expects(:exists?).returns true
|
1762
1613
|
|
1763
|
-
settings.
|
1614
|
+
expect(settings).to be_service_user_available
|
1764
1615
|
end
|
1765
1616
|
|
1766
1617
|
it "caches the result of determining if the user is present" do
|
1767
1618
|
settings[:user] = "foo"
|
1768
1619
|
|
1769
1620
|
a_user_type_for("foo").expects(:exists?).returns true
|
1770
|
-
settings.
|
1621
|
+
expect(settings).to be_service_user_available
|
1771
1622
|
|
1772
|
-
settings.
|
1623
|
+
expect(settings).to be_service_user_available
|
1773
1624
|
end
|
1774
1625
|
end
|
1775
1626
|
|
@@ -1787,7 +1638,7 @@ describe Puppet::Settings do
|
|
1787
1638
|
end
|
1788
1639
|
|
1789
1640
|
it "should return false if there is no group setting" do
|
1790
|
-
settings.
|
1641
|
+
expect(settings).not_to be_service_group_available
|
1791
1642
|
end
|
1792
1643
|
|
1793
1644
|
it "should return false if the group provider says the group is missing" do
|
@@ -1795,7 +1646,7 @@ describe Puppet::Settings do
|
|
1795
1646
|
|
1796
1647
|
a_group_type_for("foo").expects(:exists?).returns false
|
1797
1648
|
|
1798
|
-
settings.
|
1649
|
+
expect(settings).not_to be_service_group_available
|
1799
1650
|
end
|
1800
1651
|
|
1801
1652
|
it "should return true if the group provider says the group is present" do
|
@@ -1803,16 +1654,16 @@ describe Puppet::Settings do
|
|
1803
1654
|
|
1804
1655
|
a_group_type_for("foo").expects(:exists?).returns true
|
1805
1656
|
|
1806
|
-
settings.
|
1657
|
+
expect(settings).to be_service_group_available
|
1807
1658
|
end
|
1808
1659
|
|
1809
1660
|
it "caches the result of determining if the group is present" do
|
1810
1661
|
settings[:group] = "foo"
|
1811
1662
|
|
1812
1663
|
a_group_type_for("foo").expects(:exists?).returns true
|
1813
|
-
settings.
|
1664
|
+
expect(settings).to be_service_group_available
|
1814
1665
|
|
1815
|
-
settings.
|
1666
|
+
expect(settings).to be_service_group_available
|
1816
1667
|
end
|
1817
1668
|
end
|
1818
1669
|
|
@@ -1847,27 +1698,27 @@ describe Puppet::Settings do
|
|
1847
1698
|
end
|
1848
1699
|
|
1849
1700
|
it "should transform boolean option to normal form" do
|
1850
|
-
Puppet::Settings.clean_opt("--[no-]option", true).
|
1701
|
+
expect(Puppet::Settings.clean_opt("--[no-]option", true)).to eq(["--option", true])
|
1851
1702
|
end
|
1852
1703
|
|
1853
1704
|
it "should transform boolean option to no- form" do
|
1854
|
-
Puppet::Settings.clean_opt("--[no-]option", false).
|
1705
|
+
expect(Puppet::Settings.clean_opt("--[no-]option", false)).to eq(["--no-option", false])
|
1855
1706
|
end
|
1856
1707
|
|
1857
1708
|
it "should set preferred run mode from --run_mode <foo> string without error" do
|
1858
1709
|
args = ["--run_mode", "master"]
|
1859
1710
|
settings.expects(:handlearg).with("--run_mode", "master").never
|
1860
1711
|
expect { settings.send(:parse_global_options, args) } .to_not raise_error
|
1861
|
-
Puppet.settings.preferred_run_mode.
|
1862
|
-
args.empty
|
1712
|
+
expect(Puppet.settings.preferred_run_mode).to eq(:master)
|
1713
|
+
expect(args.empty?).to eq(true)
|
1863
1714
|
end
|
1864
1715
|
|
1865
1716
|
it "should set preferred run mode from --run_mode=<foo> string without error" do
|
1866
1717
|
args = ["--run_mode=master"]
|
1867
1718
|
settings.expects(:handlearg).with("--run_mode", "master").never
|
1868
1719
|
expect { settings.send(:parse_global_options, args) } .to_not raise_error
|
1869
|
-
Puppet.settings.preferred_run_mode.
|
1870
|
-
args.empty
|
1720
|
+
expect(Puppet.settings.preferred_run_mode).to eq(:master)
|
1721
|
+
expect(args.empty?).to eq(true)
|
1871
1722
|
end
|
1872
1723
|
end
|
1873
1724
|
|
@@ -1879,10 +1730,10 @@ describe Puppet::Settings do
|
|
1879
1730
|
end
|
1880
1731
|
|
1881
1732
|
it "should use both to generate fqdn" do
|
1882
|
-
Puppet::Settings.default_certname.
|
1733
|
+
expect(Puppet::Settings.default_certname).to match(/testhostname\.domain\.test/)
|
1883
1734
|
end
|
1884
1735
|
it "should remove trailing dots from fqdn" do
|
1885
|
-
Puppet::Settings.default_certname.
|
1736
|
+
expect(Puppet::Settings.default_certname).to eq('testhostname.domain.test')
|
1886
1737
|
end
|
1887
1738
|
end
|
1888
1739
|
|
@@ -1893,10 +1744,10 @@ describe Puppet::Settings do
|
|
1893
1744
|
end
|
1894
1745
|
|
1895
1746
|
it "should use only hostname to generate fqdn" do
|
1896
|
-
Puppet::Settings.default_certname.
|
1747
|
+
expect(Puppet::Settings.default_certname).to eq("testhostname")
|
1897
1748
|
end
|
1898
1749
|
it "should removing trailing dots from fqdn" do
|
1899
|
-
Puppet::Settings.default_certname.
|
1750
|
+
expect(Puppet::Settings.default_certname).to eq("testhostname")
|
1900
1751
|
end
|
1901
1752
|
end
|
1902
1753
|
end
|