puppet 5.3.7-x64-mingw32 → 5.4.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +42 -29
- data/README.md +8 -6
- data/ext/cert_inspector +2 -2
- data/ext/envpuppet +1 -1
- data/ext/gentoo/init.d/puppetmaster +4 -4
- data/ext/ips/puppet-agent +11 -11
- data/ext/ips/puppet-master +11 -11
- data/ext/puppet-test +1 -2
- data/ext/redhat/client.init +2 -2
- data/ext/redhat/logrotate +1 -1
- data/ext/solaris/smf/puppet +11 -11
- data/ext/solaris/smf/svc-puppetd +5 -5
- data/ext/solaris/smf/svc-puppetmasterd +5 -5
- data/ext/windows/service/daemon.rb +1 -1
- data/install.rb +2 -3
- data/lib/puppet/agent.rb +1 -1
- data/lib/puppet/application/cert.rb +1 -3
- data/lib/puppet/application/describe.rb +0 -1
- data/lib/puppet/application/device.rb +12 -99
- data/lib/puppet/application/filebucket.rb +32 -11
- data/lib/puppet/application/lookup.rb +1 -11
- data/lib/puppet/application/script.rb +261 -0
- data/lib/puppet/configurer.rb +3 -4
- data/lib/puppet/configurer/plugin_handler.rb +26 -9
- data/lib/puppet/context.rb +1 -1
- data/lib/puppet/datatypes.rb +213 -0
- data/lib/puppet/datatypes/error.rb +21 -0
- data/lib/puppet/datatypes/impl/error.rb +40 -0
- data/lib/puppet/defaults.rb +51 -20
- data/lib/puppet/environments.rb +17 -0
- data/lib/puppet/error.rb +17 -0
- data/lib/puppet/etc.rb +2 -2
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +1 -1
- data/lib/puppet/face/config.rb +45 -0
- data/lib/puppet/face/epp.rb +3 -3
- data/lib/puppet/face/help/action.erb +3 -0
- data/lib/puppet/face/module/build.rb +1 -0
- data/lib/puppet/face/module/generate.rb +5 -0
- data/lib/puppet/face/module/install.rb +1 -0
- data/lib/puppet/face/module/search.rb +6 -2
- data/lib/puppet/face/module/uninstall.rb +1 -0
- data/lib/puppet/face/module/upgrade.rb +1 -0
- data/lib/puppet/face/parser.rb +0 -1
- data/lib/puppet/face/plugin.rb +1 -3
- data/lib/puppet/feature/base.rb +1 -1
- data/lib/puppet/feature/bolt.rb +3 -0
- data/lib/puppet/file_bucket/dipper.rb +1 -2
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system/uniquefile.rb +2 -2
- data/lib/puppet/forge.rb +6 -0
- data/lib/puppet/functions.rb +70 -88
- data/lib/puppet/functions/all.rb +6 -2
- data/lib/puppet/functions/annotate.rb +1 -1
- data/lib/puppet/functions/any.rb +7 -3
- data/lib/puppet/functions/contain.rb +6 -0
- data/lib/puppet/functions/convert_to.rb +32 -0
- data/lib/puppet/functions/defined.rb +0 -3
- data/lib/puppet/functions/each.rb +10 -6
- data/lib/puppet/functions/filter.rb +16 -10
- data/lib/puppet/functions/find_file.rb +0 -1
- data/lib/puppet/functions/include.rb +6 -0
- data/lib/puppet/functions/map.rb +12 -9
- data/lib/puppet/functions/module_directory.rb +41 -0
- data/lib/puppet/functions/new.rb +1 -4
- data/lib/puppet/functions/regsubst.rb +1 -1
- data/lib/puppet/functions/require.rb +6 -0
- data/lib/puppet/generate/type.rb +1 -1
- data/lib/puppet/gettext/config.rb +2 -2
- data/lib/puppet/gettext/stubs.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +0 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +6 -2
- data/lib/puppet/indirector/file_server.rb +1 -1
- data/lib/puppet/indirector/node/ldap.rb +19 -3
- data/lib/puppet/indirector/request.rb +10 -6
- data/lib/puppet/indirector/rest.rb +11 -12
- data/lib/puppet/info_service/class_information_service.rb +1 -1
- data/lib/puppet/interface/action.rb +11 -0
- data/lib/puppet/interface/action_builder.rb +8 -0
- data/lib/puppet/interface/option_manager.rb +1 -1
- data/lib/puppet/loaders.rb +2 -0
- data/lib/puppet/module.rb +6 -2
- data/lib/puppet/module_tool/applications/builder.rb +4 -0
- data/lib/puppet/module_tool/applications/installer.rb +3 -0
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -0
- data/lib/puppet/module_tool/applications/unpacker.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +3 -0
- data/lib/puppet/module_tool/installed_modules.rb +1 -1
- data/lib/puppet/module_tool/metadata.rb +0 -1
- data/lib/puppet/network/authstore.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
- data/lib/puppet/network/http/connection.rb +1 -9
- data/lib/puppet/network/http/factory.rb +0 -3
- data/lib/puppet/network/http/webrick.rb +1 -0
- data/lib/puppet/network/rights.rb +1 -1
- data/lib/puppet/node.rb +53 -0
- data/lib/puppet/node/environment.rb +1 -1
- data/lib/puppet/parameter/boolean.rb +1 -1
- data/lib/puppet/parser.rb +1 -0
- data/lib/puppet/parser/abstract_compiler.rb +36 -0
- data/lib/puppet/parser/ast/branch.rb +1 -1
- data/lib/puppet/parser/ast/pops_bridge.rb +8 -52
- data/lib/puppet/parser/compiler.rb +4 -54
- data/lib/puppet/parser/functions.rb +0 -1
- data/lib/puppet/parser/functions/create_resources.rb +6 -0
- data/lib/puppet/parser/functions/fqdn_rand.rb +6 -2
- data/lib/puppet/parser/functions/inline_template.rb +6 -0
- data/lib/puppet/parser/functions/new.rb +47 -32
- data/lib/puppet/parser/functions/realize.rb +6 -0
- data/lib/puppet/parser/functions/return.rb +1 -22
- data/lib/puppet/parser/functions/reverse_each.rb +1 -1
- data/lib/puppet/parser/functions/scanf.rb +1 -1
- data/lib/puppet/parser/functions/sha256.rb +5 -0
- data/lib/puppet/parser/functions/tag.rb +6 -0
- data/lib/puppet/parser/functions/tagged.rb +6 -0
- data/lib/puppet/parser/functions/template.rb +5 -0
- data/lib/puppet/parser/scope.rb +28 -4
- data/lib/puppet/parser/script_compiler.rb +118 -0
- data/lib/puppet/parser/type_loader.rb +1 -1
- data/lib/puppet/pops.rb +1 -1
- data/lib/puppet/pops/evaluator/access_operator.rb +38 -4
- data/lib/puppet/pops/evaluator/closure.rb +12 -4
- data/lib/puppet/pops/evaluator/compare_operator.rb +4 -4
- data/lib/puppet/pops/evaluator/epp_evaluator.rb +13 -0
- data/lib/puppet/pops/evaluator/evaluator_impl.rb +38 -10
- data/lib/puppet/pops/evaluator/literal_evaluator.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_converter.rb +1 -1
- data/lib/puppet/pops/evaluator/runtime3_support.rb +2 -3
- data/lib/puppet/pops/functions/dispatch.rb +6 -5
- data/lib/puppet/pops/functions/function.rb +2 -2
- data/lib/puppet/pops/issues.rb +34 -2
- data/lib/puppet/pops/loader/base_loader.rb +10 -0
- data/lib/puppet/pops/loader/dependency_loader.rb +7 -0
- data/lib/puppet/pops/loader/loader.rb +21 -2
- data/lib/puppet/pops/loader/loader_paths.rb +180 -30
- data/lib/puppet/pops/loader/module_loaders.rb +202 -33
- data/lib/puppet/pops/loader/puppet_plan_instantiator.rb +84 -0
- data/lib/puppet/pops/loader/puppet_resource_type_impl_instantiator.rb +9 -9
- data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +40 -0
- data/lib/puppet/pops/loader/runtime3_type_loader.rb +6 -1
- data/lib/puppet/pops/loader/static_loader.rb +23 -8
- data/lib/puppet/pops/loader/task_instantiator.rb +69 -0
- data/lib/puppet/pops/loader/type_definition_instantiator.rb +4 -0
- data/lib/puppet/pops/loaders.rb +122 -11
- data/lib/puppet/pops/lookup/data_dig_function_provider.rb +1 -1
- data/lib/puppet/pops/lookup/interpolation.rb +1 -1
- data/lib/puppet/pops/lookup/lookup_adapter.rb +0 -1
- data/lib/puppet/pops/model/ast.pp +3 -0
- data/lib/puppet/pops/model/ast.rb +34 -1
- data/lib/puppet/pops/model/factory.rb +30 -3
- data/lib/puppet/pops/model/model_label_provider.rb +1 -0
- data/lib/puppet/pops/model/model_tree_dumper.rb +12 -1
- data/lib/puppet/pops/model/tree_dumper.rb +1 -1
- data/lib/puppet/pops/parser/code_merger.rb +2 -2
- data/lib/puppet/pops/parser/egrammar.ra +44 -15
- data/lib/puppet/pops/parser/eparser.rb +1687 -1571
- data/lib/puppet/pops/parser/epp_support.rb +1 -3
- data/lib/puppet/pops/parser/evaluating_parser.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +2 -2
- data/lib/puppet/pops/parser/lexer2.rb +4 -4
- data/lib/puppet/pops/parser/lexer_support.rb +2 -2
- data/lib/puppet/pops/parser/locatable.rb +1 -1
- data/lib/puppet/pops/parser/locator.rb +7 -13
- data/lib/puppet/pops/parser/parser_support.rb +3 -3
- data/lib/puppet/pops/parser/slurp_support.rb +0 -3
- data/lib/puppet/pops/pcore.rb +45 -0
- data/lib/puppet/pops/resource/param.rb +1 -1
- data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/lib/puppet/pops/serialization/abstract_reader.rb +4 -0
- data/lib/puppet/pops/serialization/abstract_writer.rb +6 -0
- data/lib/puppet/pops/serialization/extension.rb +1 -0
- data/lib/puppet/pops/serialization/from_data_converter.rb +64 -10
- data/lib/puppet/pops/serialization/json_path.rb +2 -1
- data/lib/puppet/pops/serialization/object.rb +3 -4
- data/lib/puppet/pops/serialization/serializer.rb +2 -1
- data/lib/puppet/pops/serialization/to_data_converter.rb +7 -3
- data/lib/puppet/pops/time/timespan.rb +1 -1
- data/lib/puppet/pops/types/iterable.rb +38 -9
- data/lib/puppet/pops/types/p_init_type.rb +1 -1
- data/lib/puppet/pops/types/p_meta_type.rb +4 -0
- data/lib/puppet/pops/types/p_object_type.rb +146 -14
- data/lib/puppet/pops/types/p_object_type_extension.rb +218 -0
- data/lib/puppet/pops/types/p_sem_ver_range_type.rb +0 -1
- data/lib/puppet/pops/types/p_sem_ver_type.rb +10 -2
- data/lib/puppet/pops/types/p_type_set_type.rb +0 -1
- data/lib/puppet/pops/types/p_uri_type.rb +190 -0
- data/lib/puppet/pops/types/puppet_object.rb +15 -1
- data/lib/puppet/pops/types/ruby_generator.rb +46 -54
- data/lib/puppet/pops/types/string_converter.rb +22 -1
- data/lib/puppet/pops/types/type_acceptor.rb +1 -1
- data/lib/puppet/pops/types/type_calculator.rb +13 -4
- data/lib/puppet/pops/types/type_factory.rb +29 -5
- data/lib/puppet/pops/types/type_formatter.rb +67 -4
- data/lib/puppet/pops/types/type_parser.rb +92 -4
- data/lib/puppet/pops/types/type_with_members.rb +43 -0
- data/lib/puppet/pops/types/types.rb +212 -80
- data/lib/puppet/pops/validation/checker4_0.rb +10 -6
- data/lib/puppet/pops/validation/tasks_checker.rb +60 -0
- data/lib/puppet/pops/validation/validator_factory_4_0.rb +6 -1
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/provider.rb +18 -8
- data/lib/puppet/provider/augeas/augeas.rb +3 -4
- data/lib/puppet/provider/exec.rb +0 -2
- data/lib/puppet/provider/group/groupadd.rb +25 -1
- data/lib/puppet/provider/group/windows_adsi.rb +7 -4
- data/lib/puppet/provider/mount.rb +25 -8
- data/lib/puppet/provider/nameservice.rb +9 -4
- data/lib/puppet/provider/nameservice/directoryservice.rb +3 -3
- data/lib/puppet/provider/nameservice/objectadd.rb +13 -24
- data/lib/puppet/provider/nameservice/pw.rb +14 -14
- data/lib/puppet/provider/package/appdmg.rb +0 -1
- data/lib/puppet/provider/package/apple.rb +0 -1
- data/lib/puppet/provider/package/gem.rb +2 -2
- data/lib/puppet/provider/package/macports.rb +2 -2
- data/lib/puppet/provider/package/pkg.rb +3 -0
- data/lib/puppet/provider/package/pkgdmg.rb +0 -1
- data/lib/puppet/provider/package/portage.rb +0 -1
- data/lib/puppet/provider/package/yum.rb +23 -8
- data/lib/puppet/provider/package/zypper.rb +2 -2
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
- data/lib/puppet/provider/service/init.rb +1 -0
- data/lib/puppet/provider/service/launchd.rb +6 -7
- data/lib/puppet/provider/service/redhat.rb +3 -2
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +3 -2
- data/lib/puppet/provider/user/openbsd.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +7 -1
- data/lib/puppet/provider/user/useradd.rb +36 -6
- data/lib/puppet/provider/user/windows_adsi.rb +1 -1
- data/lib/puppet/provider/yumrepo/inifile.rb +2 -4
- data/lib/puppet/provider/zfs/zfs.rb +23 -3
- data/lib/puppet/provider/zpool/zpool.rb +1 -1
- data/lib/puppet/reference/configuration.rb +0 -2
- data/lib/puppet/reference/type.rb +0 -1
- data/lib/puppet/resource.rb +1 -2
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/resource/status.rb +0 -1
- data/lib/puppet/resource/type.rb +4 -4
- data/lib/puppet/resource/type_collection.rb +1 -1
- data/lib/puppet/settings/base_setting.rb +1 -1
- data/lib/puppet/settings/environment_conf.rb +0 -1
- data/lib/puppet/settings/ini_file.rb +66 -12
- data/lib/puppet/ssl/certificate_authority.rb +1 -1
- data/lib/puppet/ssl/certificate_request.rb +2 -2
- data/lib/puppet/ssl/certificate_revocation_list.rb +2 -1
- data/lib/puppet/ssl/certificate_signer.rb +11 -0
- data/lib/puppet/ssl/host.rb +2 -2
- data/lib/puppet/syntax_checkers/base64.rb +1 -1
- data/lib/puppet/transaction.rb +37 -14
- data/lib/puppet/transaction/report.rb +3 -1
- data/lib/puppet/type.rb +17 -4
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +5 -4
- data/lib/puppet/type/file.rb +3 -3
- data/lib/puppet/type/file/checksum.rb +7 -1
- data/lib/puppet/type/file/checksum_value.rb +4 -3
- data/lib/puppet/type/group.rb +3 -0
- data/lib/puppet/type/k5login.rb +101 -0
- data/lib/puppet/type/macauthorization.rb +1 -1
- data/lib/puppet/type/mount.rb +6 -2
- data/lib/puppet/type/tidy.rb +6 -4
- data/lib/puppet/type/user.rb +26 -39
- data/lib/puppet/type/yumrepo.rb +9 -0
- data/lib/puppet/type/zfs.rb +4 -0
- data/lib/puppet/util.rb +8 -15
- data/lib/puppet/util/character_encoding.rb +2 -2
- data/lib/puppet/util/checksums.rb +82 -1
- data/lib/puppet/util/errors.rb +0 -2
- data/lib/puppet/util/filetype.rb +2 -2
- data/lib/puppet/util/json_lockfile.rb +1 -1
- data/lib/puppet/util/log.rb +1 -1
- data/lib/puppet/util/log/destinations.rb +10 -1
- data/lib/puppet/util/monkey_patches.rb +1 -1
- data/lib/puppet/util/network_device/cisco/device.rb +5 -5
- data/lib/puppet/util/network_device/config.rb +2 -3
- data/lib/puppet/util/platform.rb +13 -0
- data/lib/puppet/util/plist.rb +4 -4
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +2 -2
- data/lib/puppet/util/rdoc/parser/puppet_parser_rdoc2.rb +1 -1
- data/lib/puppet/util/reference.rb +8 -1
- data/lib/puppet/util/windows/adsi.rb +18 -15
- data/lib/puppet/util/windows/principal.rb +6 -7
- data/lib/puppet/util/windows/process.rb +1 -1
- data/lib/puppet/util/windows/registry.rb +2 -2
- data/lib/puppet/util/windows/sid.rb +7 -62
- data/lib/puppet/vendor/deep_merge/README.md +2 -2
- data/lib/puppet/vendor/pathspec/lib/pathspec/gitignorespec.rb +18 -18
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version.rb +2 -2
- data/lib/puppet/vendor/semantic_puppet/lib/semantic_puppet/version_range.rb +5 -5
- data/lib/puppet/vendor/semantic_puppet/locales/config.yaml +1 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet_pal.rb +874 -0
- data/locales/ja/puppet.po +140 -163
- data/locales/puppet.pot +940 -597
- data/man/man5/puppet.conf.5 +16 -91
- data/man/man8/puppet-agent.8 +2 -6
- data/man/man8/puppet-apply.8 +2 -2
- data/man/man8/puppet-ca.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +1 -1
- data/man/man8/puppet-certificate_request.8 +1 -1
- data/man/man8/puppet-certificate_revocation_list.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +11 -33
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +4 -22
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-master.8 +1 -1
- data/man/man8/puppet-module.8 +2 -11
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/application/lookup_spec.rb +0 -21
- data/spec/integration/parser/compiler_spec.rb +18 -0
- data/spec/integration/parser/script_compiler_spec.rb +113 -0
- data/spec/integration/provider/mount_spec.rb +2 -0
- data/spec/integration/type/file_spec.rb +11 -3
- data/spec/integration/util/windows/adsi_spec.rb +1 -86
- data/spec/integration/util/windows/principal_spec.rb +1 -10
- data/spec/shared_contexts/checksum.rb +4 -1
- data/spec/shared_contexts/digests.rb +46 -1
- data/spec/shared_contexts/types_setup.rb +8 -3
- data/spec/unit/agent_spec.rb +2 -2
- data/spec/unit/application/cert_spec.rb +5 -17
- data/spec/unit/application/device_spec.rb +2 -96
- data/spec/unit/application/filebucket_spec.rb +18 -4
- data/spec/unit/configurer/plugin_handler_spec.rb +5 -32
- data/spec/unit/configurer_spec.rb +3 -3
- data/spec/unit/datatypes_spec.rb +304 -0
- data/spec/unit/defaults_spec.rb +41 -20
- data/spec/unit/face/config_spec.rb +46 -1
- data/spec/unit/face/epp_face_spec.rb +7 -3
- data/spec/unit/face/module/search_spec.rb +11 -0
- data/spec/unit/face/parser_spec.rb +2 -2
- data/spec/unit/file_bucket/dipper_spec.rb +12 -1
- data/spec/unit/forge/module_release_spec.rb +70 -0
- data/spec/unit/functions/break_spec.rb +34 -2
- data/spec/unit/functions/contain_spec.rb +1 -0
- data/spec/unit/functions/convert_to_spec.rb +22 -0
- data/spec/unit/functions/epp_spec.rb +5 -0
- data/spec/unit/functions/include_spec.rb +15 -0
- data/spec/unit/functions/module_directory_spec.rb +43 -0
- data/spec/unit/functions/new_spec.rb +14 -14
- data/spec/unit/functions/require_spec.rb +2 -0
- data/spec/unit/functions/shared.rb +12 -0
- data/spec/unit/functions/step_spec.rb +1 -1
- data/spec/unit/functions4_spec.rb +49 -4
- data/spec/unit/indirector/catalog/compiler_spec.rb +3 -3
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +148 -94
- data/spec/unit/indirector/node/ldap_spec.rb +15 -12
- data/spec/unit/indirector/rest_spec.rb +0 -43
- data/spec/unit/interface/action_spec.rb +33 -0
- data/spec/unit/module_tool/applications/builder_spec.rb +7 -0
- data/spec/unit/module_tool/applications/installer_spec.rb +8 -0
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +8 -0
- data/spec/unit/module_tool/applications/upgrader_spec.rb +6 -0
- data/spec/unit/network/http/connection_spec.rb +1 -1
- data/spec/unit/network/http/factory_spec.rb +28 -35
- data/spec/unit/parser/compiler_spec.rb +0 -8
- data/spec/unit/parser/environment_compiler_spec.rb +36 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +9 -0
- data/spec/unit/parser/functions/inline_template_spec.rb +7 -0
- data/spec/unit/parser/functions/realize_spec.rb +9 -0
- data/spec/unit/parser/functions/tag_spec.rb +7 -0
- data/spec/unit/parser/functions/tagged_spec.rb +25 -0
- data/spec/unit/parser/functions/template_spec.rb +8 -0
- data/spec/unit/parser/scope_spec.rb +19 -0
- data/spec/unit/pops/evaluator/conditionals_spec.rb +1 -1
- data/spec/unit/pops/loaders/loader_spec.rb +516 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +11 -0
- data/spec/unit/pops/loaders/module_loaders_spec.rb +43 -0
- data/spec/unit/pops/loaders/static_loader_spec.rb +15 -7
- data/spec/unit/pops/model/model_spec.rb +5 -0
- data/spec/unit/pops/parser/lexer2_spec.rb +15 -0
- data/spec/unit/pops/parser/locator_spec.rb +20 -0
- data/spec/unit/pops/parser/parse_basic_expressions_spec.rb +33 -0
- data/spec/unit/pops/parser/parse_calls_spec.rb +28 -0
- data/spec/unit/pops/parser/parse_conditionals_spec.rb +12 -0
- data/spec/unit/pops/parser/parse_plan_spec.rb +48 -0
- data/spec/unit/pops/serialization/packer_spec.rb +8 -0
- data/spec/unit/pops/serialization/serialization_spec.rb +30 -0
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +31 -0
- data/spec/unit/pops/types/error_spec.rb +207 -0
- data/spec/unit/pops/types/p_init_type_spec.rb +98 -0
- data/spec/unit/pops/types/p_object_type_spec.rb +275 -10
- data/spec/unit/pops/types/p_uri_type_spec.rb +191 -0
- data/spec/unit/pops/types/ruby_generator_spec.rb +82 -44
- data/spec/unit/pops/types/task_spec.rb +353 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +76 -5
- data/spec/unit/pops/types/type_formatter_spec.rb +31 -13
- data/spec/unit/pops/types/type_parser_spec.rb +13 -1
- data/spec/unit/pops/types/types_spec.rb +60 -0
- data/spec/unit/pops/validator/validator_spec.rb +76 -0
- data/spec/unit/provider/group/groupadd_spec.rb +77 -1
- data/spec/unit/provider/group/pw_spec.rb +4 -4
- data/spec/unit/provider/group/windows_adsi_spec.rb +22 -79
- data/spec/unit/provider/mount_spec.rb +18 -5
- data/spec/unit/provider/nameservice_spec.rb +5 -5
- data/spec/unit/provider/package/dnf_spec.rb +2 -2
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +3 -0
- data/spec/unit/provider/package/yum_spec.rb +40 -0
- data/spec/unit/provider/service/launchd_spec.rb +2 -1
- data/spec/unit/provider/service/redhat_spec.rb +5 -0
- data/spec/unit/provider/service/systemd_spec.rb +1 -1
- data/spec/unit/provider/user/hpux_spec.rb +2 -2
- data/spec/unit/provider/user/openbsd_spec.rb +2 -2
- data/spec/unit/provider/user/pw_spec.rb +14 -14
- data/spec/unit/provider/user/user_role_add_spec.rb +19 -2
- data/spec/unit/provider/user/useradd_spec.rb +188 -22
- data/spec/unit/provider/user/windows_adsi_spec.rb +4 -4
- data/spec/unit/provider/zfs/zfs_spec.rb +55 -1
- data/spec/unit/provider_spec.rb +48 -0
- data/spec/unit/puppet_pal_2pec.rb +1005 -0
- data/spec/unit/puppet_pal_spec.rb +11 -0
- data/spec/unit/settings/ini_file_spec.rb +313 -2
- data/spec/unit/ssl/certificate_request_spec.rb +42 -1
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +2 -1
- data/spec/unit/transaction/report_spec.rb +1 -0
- data/spec/unit/transaction_spec.rb +112 -21
- data/spec/unit/type/file/checksum_spec.rb +20 -0
- data/spec/unit/type/file_spec.rb +8 -0
- data/spec/unit/type/group_spec.rb +8 -0
- data/spec/unit/type/k5login_spec.rb +22 -1
- data/spec/unit/type/scheduled_task_spec.rb +15 -0
- data/spec/unit/type/user_spec.rb +11 -1
- data/spec/unit/type/yumrepo_spec.rb +5 -0
- data/spec/unit/util/checksums_spec.rb +3 -3
- data/spec/unit/util/log/destinations_spec.rb +14 -0
- data/spec/unit/util/network_device/cisco/device_spec.rb +1 -1
- data/spec/unit/util/plist_spec.rb +3 -3
- data/spec/unit/util/windows/adsi_spec.rb +27 -31
- data/spec/unit/util/windows/sid_spec.rb +15 -86
- data/spec/unit/util_spec.rb +17 -3
- data/tasks/manpages.rake +1 -1
- metadata +220 -182
- data/lib/puppet/bindings.rb +0 -148
- data/lib/puppet/configurer/downloader_factory.rb +0 -44
- data/spec/unit/configurer/downloader_factory_spec.rb +0 -129
@@ -18,13 +18,15 @@ describe Puppet::Node::Ldap do
|
|
18
18
|
let(:request) { Puppet::Indirector::Request.new(:node, :find, nodename, nil, :environment => environment) }
|
19
19
|
|
20
20
|
it "should convert the hostname into a search filter" do
|
21
|
-
|
21
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({})
|
22
|
+
entry = stub 'entry', :dn => 'cn=mynode.domain.com,ou=hosts,dc=madstop,dc=com', :vals => %w{}
|
22
23
|
node_indirection.expects(:ldapsearch).with("(&(objectclass=puppetClient)(cn=#{nodename}))").yields entry
|
23
24
|
node_indirection.name2hash(nodename)
|
24
25
|
end
|
25
26
|
|
26
27
|
it "should convert any found entry into a hash" do
|
27
|
-
|
28
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({})
|
29
|
+
entry = stub 'entry', :dn => 'cn=mynode.domain.com,ou=hosts,dc=madstop,dc=com', :vals => %w{}
|
28
30
|
node_indirection.expects(:ldapsearch).with("(&(objectclass=puppetClient)(cn=#{nodename}))").yields entry
|
29
31
|
myhash = {"myhash" => true}
|
30
32
|
node_indirection.expects(:entry2hash).with(entry).returns myhash
|
@@ -34,7 +36,8 @@ describe Puppet::Node::Ldap do
|
|
34
36
|
# This heavily tests our entry2hash method, so we don't have to stub out the stupid entry information any more.
|
35
37
|
describe "when an ldap entry is found" do
|
36
38
|
before do
|
37
|
-
@entry = stub 'entry', :dn => 'cn=mynode,ou=hosts,dc=madstop,dc=com', :vals => %w{}
|
39
|
+
@entry = stub 'entry', :dn => 'cn=mynode,ou=hosts,dc=madstop,dc=com', :vals => %w{}
|
40
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({})
|
38
41
|
node_indirection.stubs(:ldapsearch).yields @entry
|
39
42
|
end
|
40
43
|
|
@@ -56,7 +59,7 @@ describe Puppet::Node::Ldap do
|
|
56
59
|
end
|
57
60
|
|
58
61
|
it "should deduplicate class values" do
|
59
|
-
|
62
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({})
|
60
63
|
node_indirection.stubs(:class_attributes).returns(%w{one two})
|
61
64
|
@entry.stubs(:vals).with("one").returns(%w{a b})
|
62
65
|
@entry.stubs(:vals).with("two").returns(%w{b c})
|
@@ -64,7 +67,7 @@ describe Puppet::Node::Ldap do
|
|
64
67
|
end
|
65
68
|
|
66
69
|
it "should add the entry's environment to the hash" do
|
67
|
-
|
70
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns(:environment => %w{production})
|
68
71
|
expect(node_indirection.entry2hash(@entry)[:environment]).to eq("production")
|
69
72
|
end
|
70
73
|
|
@@ -77,37 +80,37 @@ describe Puppet::Node::Ldap do
|
|
77
80
|
|
78
81
|
it "should not add the stacked parameter as a normal parameter" do
|
79
82
|
@entry.stubs(:vals).with("puppetvar").returns(%w{one=two three=four})
|
80
|
-
|
83
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns("puppetvar" => %w{one=two three=four})
|
81
84
|
expect(node_indirection.entry2hash(@entry)[:parameters]["puppetvar"]).to be_nil
|
82
85
|
end
|
83
86
|
|
84
87
|
it "should add all other attributes as parameters in the hash" do
|
85
|
-
|
88
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns("foo" => %w{one two})
|
86
89
|
expect(node_indirection.entry2hash(@entry)[:parameters]["foo"]).to eq(%w{one two})
|
87
90
|
end
|
88
91
|
|
89
92
|
it "should return single-value parameters as strings, not arrays" do
|
90
|
-
|
93
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns("foo" => %w{one})
|
91
94
|
expect(node_indirection.entry2hash(@entry)[:parameters]["foo"]).to eq("one")
|
92
95
|
end
|
93
96
|
|
94
97
|
it "should convert 'true' values to the boolean 'true'" do
|
95
|
-
|
98
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({"one" => ["true"]})
|
96
99
|
expect(node_indirection.entry2hash(@entry)[:parameters]["one"]).to eq(true)
|
97
100
|
end
|
98
101
|
|
99
102
|
it "should convert 'false' values to the boolean 'false'" do
|
100
|
-
|
103
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({"one" => ["false"]})
|
101
104
|
expect(node_indirection.entry2hash(@entry)[:parameters]["one"]).to eq(false)
|
102
105
|
end
|
103
106
|
|
104
107
|
it "should convert 'true' values to the boolean 'true' inside an array" do
|
105
|
-
|
108
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({"one" => ["true", "other"]})
|
106
109
|
expect(node_indirection.entry2hash(@entry)[:parameters]["one"]).to eq([true, "other"])
|
107
110
|
end
|
108
111
|
|
109
112
|
it "should convert 'false' values to the boolean 'false' inside an array" do
|
110
|
-
|
113
|
+
node_indirection.stubs(:ldap_entry_to_hash).returns({"one" => ["false", "other"]})
|
111
114
|
expect(node_indirection.entry2hash(@entry)[:parameters]["one"]).to eq([false, "other"])
|
112
115
|
end
|
113
116
|
|
@@ -723,49 +723,6 @@ describe Puppet::Indirector::REST do
|
|
723
723
|
end
|
724
724
|
end
|
725
725
|
|
726
|
-
describe '#handle_response' do
|
727
|
-
# There are multiple request types to choose from, this may not be the one I want for this situation
|
728
|
-
let(:response) { mock_response(200, 'body') }
|
729
|
-
let(:connection) { stub('mock http connection', :put => response, :verify_callback= => nil) }
|
730
|
-
let(:instance) { model.new('the thing', 'some contents') }
|
731
|
-
let(:request) { save_request(instance.name, instance) }
|
732
|
-
|
733
|
-
before :each do
|
734
|
-
terminus.stubs(:network).returns(connection)
|
735
|
-
end
|
736
|
-
|
737
|
-
it 'adds server_agent_version to the context if not already set' do
|
738
|
-
Puppet.expects(:push_context).with(:server_agent_version => Puppet.version)
|
739
|
-
terminus.handle_response(request, response)
|
740
|
-
end
|
741
|
-
|
742
|
-
it 'does not add server_agent_version to the context if it is already set' do
|
743
|
-
Puppet.override(:server_agent_version => "5.3.4") do
|
744
|
-
Puppet.expects(:push_context).never
|
745
|
-
terminus.handle_response(request, response)
|
746
|
-
end
|
747
|
-
end
|
748
|
-
|
749
|
-
it 'downgrades to pson and emits a warning' do
|
750
|
-
response.stubs(:[]).with(Puppet::Network::HTTP::HEADER_PUPPET_VERSION).returns('4.2.8')
|
751
|
-
Puppet[:preferred_serialization_format] = 'other'
|
752
|
-
|
753
|
-
Puppet.expects(:warning).with('Downgrading to PSON for future requests')
|
754
|
-
|
755
|
-
terminus.handle_response(request, response)
|
756
|
-
|
757
|
-
expect(Puppet[:preferred_serialization_format]).to eq('pson')
|
758
|
-
end
|
759
|
-
|
760
|
-
it 'preserves the set serialization format' do
|
761
|
-
Puppet[:preferred_serialization_format] = 'other'
|
762
|
-
|
763
|
-
expect(Puppet[:preferred_serialization_format]).to eq('other')
|
764
|
-
|
765
|
-
terminus.handle_response(request, response)
|
766
|
-
end
|
767
|
-
end
|
768
|
-
|
769
726
|
context 'dealing with SRV settings' do
|
770
727
|
[
|
771
728
|
:destroy,
|
@@ -644,4 +644,37 @@ describe Puppet::Interface::Action do
|
|
644
644
|
expect(subject.get_default_action).to eq(action)
|
645
645
|
end
|
646
646
|
end
|
647
|
+
|
648
|
+
context "when deprecating a face action" do
|
649
|
+
let :face do
|
650
|
+
Puppet::Interface.new(:foo, '1.0.0') do
|
651
|
+
action :bar do
|
652
|
+
option "--bar"
|
653
|
+
when_invoked do |options| options end
|
654
|
+
end
|
655
|
+
end
|
656
|
+
end
|
657
|
+
|
658
|
+
let :action do face.get_action :bar end
|
659
|
+
|
660
|
+
describe "#deprecate" do
|
661
|
+
it "should set the deprecated value to true" do
|
662
|
+
expect(action).not_to be_deprecated
|
663
|
+
action.deprecate
|
664
|
+
expect(action).to be_deprecated
|
665
|
+
end
|
666
|
+
end
|
667
|
+
|
668
|
+
describe "#deprecated?" do
|
669
|
+
it "should return a nil (falsey) value by default" do
|
670
|
+
expect(action.deprecated?).to be_falsey
|
671
|
+
end
|
672
|
+
|
673
|
+
it "should return true if the action has been deprecated" do
|
674
|
+
expect(action).not_to be_deprecated
|
675
|
+
action.deprecate
|
676
|
+
expect(action).to be_deprecated
|
677
|
+
end
|
678
|
+
end
|
679
|
+
end
|
647
680
|
end
|
@@ -429,4 +429,11 @@ symlinkfile
|
|
429
429
|
|
430
430
|
it_behaves_like "a packagable module"
|
431
431
|
end
|
432
|
+
|
433
|
+
context 'when in FIPS mode...' do
|
434
|
+
it 'module builder refuses to run' do
|
435
|
+
Facter.stubs(:value).with(:fips_enabled).returns(true)
|
436
|
+
expect { builder.run }.to raise_error(/Module building is prohibited in FIPS mode/)
|
437
|
+
end
|
438
|
+
end
|
432
439
|
end
|
@@ -366,6 +366,14 @@ describe Puppet::ModuleTool::Applications::Installer do
|
|
366
366
|
end
|
367
367
|
end
|
368
368
|
end
|
369
|
+
|
370
|
+
context 'when in FIPS mode...' do
|
371
|
+
it 'module installer refuses to run' do
|
372
|
+
Facter.stubs(:value).with(:fips_enabled).returns(true)
|
373
|
+
expect {application.run}.to raise_error(/Module install is prohibited in FIPS mode./)
|
374
|
+
end
|
375
|
+
end
|
376
|
+
|
369
377
|
end
|
370
378
|
|
371
379
|
end
|
@@ -162,4 +162,12 @@ describe Puppet::ModuleTool::Applications::Uninstaller do
|
|
162
162
|
end
|
163
163
|
end
|
164
164
|
end
|
165
|
+
|
166
|
+
context 'when in FIPS mode...' do
|
167
|
+
it 'module uninstaller refuses to run' do
|
168
|
+
Facter.stubs(:value).with(:fips_enabled).returns(true)
|
169
|
+
expect {application.run}.to raise_error(/Module uninstall is prohibited in FIPS mode/)
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
165
173
|
end
|
@@ -327,5 +327,11 @@ describe Puppet::ModuleTool::Applications::Upgrader do
|
|
327
327
|
end
|
328
328
|
end
|
329
329
|
end
|
330
|
+
context 'when in FIPS mode...' do
|
331
|
+
it 'module unpgrader refuses to run' do
|
332
|
+
Facter.stubs(:value).with(:fips_enabled).returns(true)
|
333
|
+
expect { application.run }.to raise_error(/Module upgrade is prohibited in FIPS mode/)
|
334
|
+
end
|
335
|
+
end
|
330
336
|
end
|
331
337
|
end
|
@@ -291,7 +291,7 @@ describe Puppet::Network::HTTP::Connection do
|
|
291
291
|
expect(result.code).to eq(503)
|
292
292
|
end
|
293
293
|
|
294
|
-
it "should return a 503 response if Retry-After is not
|
294
|
+
it "should return a 503 response if Retry-After is not convertible to an Integer or RFC 2822 Date" do
|
295
295
|
httpunavailable['Retry-After'] = 'foo'
|
296
296
|
http.stubs(:request).returns(httpunavailable)
|
297
297
|
|
@@ -78,49 +78,42 @@ describe Puppet::Network::HTTP::Factory do
|
|
78
78
|
|
79
79
|
expect(conn.proxy_port).to eq(proxy_port)
|
80
80
|
end
|
81
|
-
end
|
82
|
-
|
83
|
-
context 'socket timeouts' do
|
84
|
-
it 'sets open timeout' do
|
85
|
-
Puppet[:http_connect_timeout] = "10s"
|
86
|
-
conn = create_connection(site)
|
87
|
-
|
88
|
-
expect(conn.open_timeout).to eq(10)
|
89
|
-
end
|
90
|
-
|
91
|
-
it 'sets read timeout' do
|
92
|
-
Puppet[:http_read_timeout] = "2m"
|
93
|
-
conn = create_connection(site)
|
94
|
-
|
95
|
-
expect(conn.read_timeout).to eq(120)
|
96
|
-
end
|
97
|
-
end
|
98
81
|
|
99
|
-
|
100
|
-
|
101
|
-
|
82
|
+
context 'socket timeouts' do
|
83
|
+
it 'sets open timeout' do
|
84
|
+
Puppet[:http_connect_timeout] = "10s"
|
85
|
+
conn = create_connection(site)
|
102
86
|
|
103
|
-
|
104
|
-
|
87
|
+
expect(conn.open_timeout).to eq(10)
|
88
|
+
end
|
105
89
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
conn = create_connection(site)
|
90
|
+
it 'sets read timeout' do
|
91
|
+
Puppet[:http_read_timeout] = "2m"
|
92
|
+
conn = create_connection(site)
|
110
93
|
|
111
|
-
|
94
|
+
expect(conn.read_timeout).to eq(120)
|
95
|
+
end
|
112
96
|
end
|
113
97
|
|
114
|
-
|
115
|
-
|
116
|
-
|
98
|
+
context 'source address' do
|
99
|
+
it 'defaults to system-defined' do
|
100
|
+
skip "Requires Ruby >= 2.0" unless RUBY_VERSION.to_i >= 2
|
117
101
|
conn = create_connection(site)
|
118
102
|
|
119
|
-
expect(conn.local_host).to
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
103
|
+
expect(conn.local_host).to be(nil)
|
104
|
+
end
|
105
|
+
|
106
|
+
it 'sets the local_host address' do
|
107
|
+
Puppet[:sourceaddress] = "127.0.0.1"
|
108
|
+
if RUBY_VERSION.to_i >= 2
|
109
|
+
conn = create_connection(site)
|
110
|
+
|
111
|
+
expect(conn.local_host).to eq('127.0.0.1')
|
112
|
+
else
|
113
|
+
expect {
|
114
|
+
create_connection(site)
|
115
|
+
}.to raise_error(ArgumentError, "Setting 'sourceaddress' is unsupported by this version of Net::HTTP.")
|
116
|
+
end
|
124
117
|
end
|
125
118
|
end
|
126
119
|
end
|
@@ -279,14 +279,6 @@ describe Puppet::Parser::Compiler do
|
|
279
279
|
expect(@compiler.topscope['wat']).to eq('this is how the sausage is made')
|
280
280
|
end
|
281
281
|
|
282
|
-
it "sets the environment based on node.environment instead of the parameters" do
|
283
|
-
compile_stub(:set_node_parameters)
|
284
|
-
@node.parameters['environment'] = "Not actually #{@node.environment.name}"
|
285
|
-
|
286
|
-
@compiler.compile
|
287
|
-
expect(@compiler.topscope['environment']).to eq('testing')
|
288
|
-
end
|
289
|
-
|
290
282
|
it "should set the client and server versions on the catalog" do
|
291
283
|
params = {"clientversion" => "2", "serverversion" => "3"}
|
292
284
|
@node.stubs(:parameters).returns(params)
|
@@ -9,6 +9,15 @@ describe "Application instantiation" do
|
|
9
9
|
let(:env) { Puppet::Node::Environment.create(:testing, []) }
|
10
10
|
let(:node) { Puppet::Node.new('test', :environment => env) }
|
11
11
|
let(:loaders) { Puppet::Pops::Loaders.new(env) }
|
12
|
+
let(:logs) { [] }
|
13
|
+
let(:notices) { logs.select { |log| log.level == :notice }.map { |log| log.message } }
|
14
|
+
let(:warnings) { logs.select { |log| log.level == :warning }.map { |log| log.message } }
|
15
|
+
|
16
|
+
def compile_collect_log(string)
|
17
|
+
Puppet::Util::Log.with_destination(Puppet::Test::LogCollector.new(logs)) do
|
18
|
+
compile_to_catalog(string, Puppet::Node.new('other', :environment => env))
|
19
|
+
end
|
20
|
+
end
|
12
21
|
|
13
22
|
def compile_to_env_catalog(string, code_id=nil)
|
14
23
|
Puppet[:code] = string
|
@@ -683,4 +692,31 @@ EOS
|
|
683
692
|
}.to raise_error(Puppet::Error, /maps component P\[one\] to multiple nodes/)
|
684
693
|
end
|
685
694
|
end
|
695
|
+
|
696
|
+
describe "site containing a resource named 'plan'" do
|
697
|
+
it 'finds an application named plan' do
|
698
|
+
expect {compile_collect_log(<<-PUPPET)}.not_to raise_error
|
699
|
+
define plan::node_file() {
|
700
|
+
file { "/tmp/plans/${name}.txt":
|
701
|
+
content => "this is ${name}.txt",
|
702
|
+
}
|
703
|
+
}
|
704
|
+
Plan::Node_file produces Node_file {}
|
705
|
+
application plan() {
|
706
|
+
plan::node_file { "node_file_${name}":
|
707
|
+
export => Node_file["node_file_${name}"]
|
708
|
+
}
|
709
|
+
}
|
710
|
+
site {
|
711
|
+
plan { "test":
|
712
|
+
nodes => {
|
713
|
+
Node["test.example.com"] => Plan::Node_file["node_file_plan_test"],
|
714
|
+
}
|
715
|
+
}
|
716
|
+
}
|
717
|
+
PUPPET
|
718
|
+
|
719
|
+
expect(warnings).to include(/Use of future reserved word: 'plan'/)
|
720
|
+
end
|
721
|
+
end
|
686
722
|
end
|
@@ -324,6 +324,15 @@ describe 'function for dynamically creating resources' do
|
|
324
324
|
compile_to_catalog('include foo')
|
325
325
|
}.to raise_error(Puppet::Error, /Syntax error at.*/)
|
326
326
|
end
|
327
|
+
|
328
|
+
it 'is not available when --tasks is on' do
|
329
|
+
Puppet[:tasks] = true
|
330
|
+
expect do
|
331
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
332
|
+
create_resources('class', {'bar'=>{}}, {'one' => 'two'})
|
333
|
+
MANIFEST
|
334
|
+
end.to raise_error(Puppet::ParseError, /is only available when compiling a catalog/)
|
335
|
+
end
|
327
336
|
end
|
328
337
|
|
329
338
|
def collect_notices(code)
|
@@ -28,6 +28,13 @@ describe "the inline_template function" do
|
|
28
28
|
expect(inline_template("string was: <%= @string %>")).to eq("string was: this is a variable")
|
29
29
|
end
|
30
30
|
|
31
|
+
it 'is not available when --tasks is on' do
|
32
|
+
Puppet[:tasks] = true
|
33
|
+
expect {
|
34
|
+
inline_template("<%= lookupvar('myvar') %>")
|
35
|
+
}.to raise_error(Puppet::ParseError, /is only available when compiling a catalog/)
|
36
|
+
end
|
37
|
+
|
31
38
|
def inline_template(*templates)
|
32
39
|
scope.function_inline_template(templates)
|
33
40
|
end
|
@@ -58,4 +58,13 @@ describe "the realize function" do
|
|
58
58
|
realize([])
|
59
59
|
EOM
|
60
60
|
end
|
61
|
+
|
62
|
+
it 'is not available when --tasks is on' do
|
63
|
+
Puppet[:tasks] = true
|
64
|
+
expect do
|
65
|
+
catalog = compile_to_catalog(<<-MANIFEST)
|
66
|
+
realize([])
|
67
|
+
MANIFEST
|
68
|
+
end.to raise_error(Puppet::ParseError, /is only available when compiling a catalog/)
|
69
|
+
end
|
61
70
|
end
|
@@ -25,4 +25,11 @@ describe "the 'tag' function" do
|
|
25
25
|
expect(resource).to be_tagged("one")
|
26
26
|
expect(resource).to be_tagged("two")
|
27
27
|
end
|
28
|
+
|
29
|
+
it 'is not available when --tasks is on' do
|
30
|
+
Puppet[:tasks] = true
|
31
|
+
expect do
|
32
|
+
@scope.function_tag(['one', 'two'])
|
33
|
+
end.to raise_error(Puppet::ParseError, /is only available when compiling a catalog/)
|
34
|
+
end
|
28
35
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe "the 'tagged' function" do
|
5
|
+
before :all do
|
6
|
+
Puppet::Parser::Functions.autoloader.loadall
|
7
|
+
end
|
8
|
+
|
9
|
+
before :each do
|
10
|
+
node = Puppet::Node.new('localhost')
|
11
|
+
compiler = Puppet::Parser::Compiler.new(node)
|
12
|
+
@scope = Puppet::Parser::Scope.new(compiler)
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should exist" do
|
16
|
+
expect(Puppet::Parser::Functions.function(:tagged)).to eq("function_tagged")
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'is not available when --tasks is on' do
|
20
|
+
Puppet[:tasks] = true
|
21
|
+
expect do
|
22
|
+
@scope.function_tagged(['one', 'two'])
|
23
|
+
end.to raise_error(Puppet::ParseError, /is only available when compiling a catalog/)
|
24
|
+
end
|
25
|
+
end
|