puppet 5.3.7-x86-mingw32 → 5.4.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +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
data/lib/puppet/util.rb
CHANGED
@@ -584,17 +584,10 @@ module Util
|
|
584
584
|
# encoding for Uniquefile is not important here because the caller writes to it as it sees fit
|
585
585
|
tempfile = Puppet::FileSystem::Uniquefile.new(Puppet::FileSystem.basename_string(file), Puppet::FileSystem.dir_string(file))
|
586
586
|
|
587
|
-
|
588
|
-
# Tempfile doesn't promise to be safe from reading by other people, just
|
589
|
-
# that it avoids races around creating the file.
|
590
|
-
#
|
591
|
-
# Our Windows emulation is pretty limited, and so we have to carefully
|
592
|
-
# and specifically handle the platform, which has all sorts of magic.
|
593
|
-
# So, unlike Unix, we don't pre-prep security; we use the default "quite
|
594
|
-
# secure" tempfile permissions instead. Magic happens later.
|
587
|
+
effective_mode =
|
595
588
|
if !Puppet.features.microsoft_windows?
|
596
589
|
# Grab the current file mode, and fall back to the defaults.
|
597
|
-
|
590
|
+
|
598
591
|
if Puppet::FileSystem.exist?(file)
|
599
592
|
stat = Puppet::FileSystem.lstat(file)
|
600
593
|
tempfile.chown(stat.uid, stat.gid)
|
@@ -602,17 +595,17 @@ module Util
|
|
602
595
|
else
|
603
596
|
mode
|
604
597
|
end
|
605
|
-
|
606
|
-
if effective_mode
|
607
|
-
# We only care about the bottom four slots, which make the real mode,
|
608
|
-
# and not the rest of the platform stat call fluff and stuff.
|
609
|
-
tempfile.chmod(effective_mode & 07777)
|
610
|
-
end
|
611
598
|
end
|
612
599
|
|
613
600
|
# OK, now allow the caller to write the content of the file.
|
614
601
|
yield tempfile
|
615
602
|
|
603
|
+
if effective_mode
|
604
|
+
# We only care about the bottom four slots, which make the real mode,
|
605
|
+
# and not the rest of the platform stat call fluff and stuff.
|
606
|
+
tempfile.chmod(effective_mode & 07777)
|
607
|
+
end
|
608
|
+
|
616
609
|
# Now, make sure the data (which includes the mode) is safe on disk.
|
617
610
|
tempfile.flush
|
618
611
|
begin
|
@@ -22,7 +22,7 @@ module Puppet::Util::CharacterEncoding
|
|
22
22
|
Puppet.debug(_("%{value} is already labeled as UTF-8 but this encoding is invalid. It cannot be transcoded by Puppet.") %
|
23
23
|
{ value: string.dump })
|
24
24
|
end
|
25
|
-
# String is
|
25
|
+
# String is already valid UTF-8 - noop
|
26
26
|
return string_copy
|
27
27
|
else
|
28
28
|
# If the string comes to us as BINARY encoded, we don't know what it
|
@@ -47,7 +47,7 @@ module Puppet::Util::CharacterEncoding
|
|
47
47
|
end
|
48
48
|
|
49
49
|
# Given a string, tests if that string's bytes represent valid UTF-8, and if
|
50
|
-
# so return a copy of the string with external
|
50
|
+
# so return a copy of the string with external encoding set to UTF-8. Does
|
51
51
|
# not modify the byte representation of the string. If the string does not
|
52
52
|
# represent valid UTF-8, does not set the external encoding.
|
53
53
|
#
|
@@ -10,7 +10,7 @@ module Puppet::Util::Checksums
|
|
10
10
|
# It's not a good idea to use some of these in some contexts: for example, I
|
11
11
|
# wouldn't try bucketing a file using the :none checksum type.
|
12
12
|
def known_checksum_types
|
13
|
-
[:sha256, :sha256lite, :md5, :md5lite, :sha1, :sha1lite,
|
13
|
+
[:sha256, :sha256lite, :md5, :md5lite, :sha1, :sha1lite, :sha512, :sha384, :sha224,
|
14
14
|
:mtime, :ctime, :none]
|
15
15
|
end
|
16
16
|
|
@@ -83,6 +83,87 @@ module Puppet::Util::Checksums
|
|
83
83
|
sha256_hex_length
|
84
84
|
end
|
85
85
|
|
86
|
+
# Calculate a checksum using Digest::SHA384.
|
87
|
+
def sha384(content)
|
88
|
+
require 'digest/sha2'
|
89
|
+
Digest::SHA384.hexdigest(content)
|
90
|
+
end
|
91
|
+
|
92
|
+
def sha384?(string)
|
93
|
+
string =~ /^\h{96}$/
|
94
|
+
end
|
95
|
+
|
96
|
+
def sha384_file(filename, lite = false)
|
97
|
+
require 'digest/sha2'
|
98
|
+
|
99
|
+
digest = Digest::SHA384.new
|
100
|
+
checksum_file(digest, filename, lite)
|
101
|
+
end
|
102
|
+
|
103
|
+
def sha384_stream(lite = false, &block)
|
104
|
+
require 'digest/sha2'
|
105
|
+
digest = Digest::SHA384.new
|
106
|
+
checksum_stream(digest, block, lite)
|
107
|
+
end
|
108
|
+
|
109
|
+
def sha384_hex_length
|
110
|
+
96
|
111
|
+
end
|
112
|
+
|
113
|
+
# Calculate a checksum using Digest::SHA512.
|
114
|
+
def sha512(content)
|
115
|
+
require 'digest/sha2'
|
116
|
+
Digest::SHA512.hexdigest(content)
|
117
|
+
end
|
118
|
+
|
119
|
+
def sha512?(string)
|
120
|
+
string =~ /^\h{128}$/
|
121
|
+
end
|
122
|
+
|
123
|
+
def sha512_file(filename, lite = false)
|
124
|
+
require 'digest/sha2'
|
125
|
+
|
126
|
+
digest = Digest::SHA512.new
|
127
|
+
checksum_file(digest, filename, lite)
|
128
|
+
end
|
129
|
+
|
130
|
+
def sha512_stream(lite = false, &block)
|
131
|
+
require 'digest/sha2'
|
132
|
+
digest = Digest::SHA512.new
|
133
|
+
checksum_stream(digest, block, lite)
|
134
|
+
end
|
135
|
+
|
136
|
+
def sha512_hex_length
|
137
|
+
128
|
138
|
+
end
|
139
|
+
|
140
|
+
# Calculate a checksum using Digest::SHA224.
|
141
|
+
def sha224(content)
|
142
|
+
require 'openssl'
|
143
|
+
OpenSSL::Digest::SHA224.new.hexdigest(content)
|
144
|
+
end
|
145
|
+
|
146
|
+
def sha224?(string)
|
147
|
+
string =~ /^\h{56}$/
|
148
|
+
end
|
149
|
+
|
150
|
+
def sha224_file(filename, lite = false)
|
151
|
+
require 'openssl'
|
152
|
+
|
153
|
+
digest = OpenSSL::Digest::SHA224.new
|
154
|
+
checksum_file(digest, filename, lite)
|
155
|
+
end
|
156
|
+
|
157
|
+
def sha224_stream(lite = false, &block)
|
158
|
+
require 'openssl'
|
159
|
+
digest = OpenSSL::Digest::SHA224.new
|
160
|
+
checksum_stream(digest, block, lite)
|
161
|
+
end
|
162
|
+
|
163
|
+
def sha224_hex_length
|
164
|
+
56
|
165
|
+
end
|
166
|
+
|
86
167
|
# Calculate a checksum using Digest::MD5.
|
87
168
|
def md5(content)
|
88
169
|
Digest::MD5.hexdigest(content)
|
data/lib/puppet/util/errors.rb
CHANGED
data/lib/puppet/util/filetype.rb
CHANGED
@@ -42,7 +42,7 @@ class Puppet::Util::FileType
|
|
42
42
|
else
|
43
43
|
return ""
|
44
44
|
end
|
45
|
-
rescue Puppet::Error
|
45
|
+
rescue Puppet::Error
|
46
46
|
raise
|
47
47
|
rescue => detail
|
48
48
|
message = _("%{klass} could not read %{path}: %{detail}") % { klass: self.class, path: @path, detail: detail }
|
@@ -58,7 +58,7 @@ class Puppet::Util::FileType
|
|
58
58
|
val = real_write(text)
|
59
59
|
@synced = Time.now
|
60
60
|
return val
|
61
|
-
rescue Puppet::Error
|
61
|
+
rescue Puppet::Error
|
62
62
|
raise
|
63
63
|
rescue => detail
|
64
64
|
message = _("%{klass} could not write %{path}: %{detail}") % { klass: self.class, path: @path, detail: detail }
|
@@ -36,7 +36,7 @@ class Puppet::Util::JsonLockfile < Puppet::Util::Lockfile
|
|
36
36
|
file_contents = super
|
37
37
|
return nil if file_contents.nil? or file_contents.empty?
|
38
38
|
JSON.parse(file_contents)
|
39
|
-
rescue JSON::ParserError
|
39
|
+
rescue JSON::ParserError
|
40
40
|
Puppet.warning _("Unable to read lockfile data from %{path}: not in JSON") % { path: @file_path }
|
41
41
|
nil
|
42
42
|
end
|
data/lib/puppet/util/log.rb
CHANGED
@@ -125,7 +125,6 @@ Puppet::Util::Log.newdesttype :logstash_event do
|
|
125
125
|
# logstash_event format is documented at
|
126
126
|
# https://logstash.jira.com/browse/LOGSTASH-675
|
127
127
|
|
128
|
-
data = {}
|
129
128
|
data = msg.to_hash
|
130
129
|
data['version'] = 1
|
131
130
|
data['@timestamp'] = data['time']
|
@@ -217,6 +216,7 @@ Puppet::Util::Log.newdesttype :eventlog do
|
|
217
216
|
Puppet::Util::Log::DestEventlog::EVENTLOG_ERROR_TYPE = 0x0001
|
218
217
|
Puppet::Util::Log::DestEventlog::EVENTLOG_WARNING_TYPE = 0x0002
|
219
218
|
Puppet::Util::Log::DestEventlog::EVENTLOG_INFORMATION_TYPE = 0x0004
|
219
|
+
Puppet::Util::Log::DestEventlog::EVENTLOG_CHARACTER_LIMIT = 31838
|
220
220
|
|
221
221
|
def self.suitable?(obj)
|
222
222
|
Puppet.features.microsoft_windows?
|
@@ -233,6 +233,15 @@ Puppet::Util::Log.newdesttype :eventlog do
|
|
233
233
|
def handle(msg)
|
234
234
|
native_type, native_id = to_native(msg.level)
|
235
235
|
|
236
|
+
stringified_msg = msg.message.to_s
|
237
|
+
if stringified_msg.length > self.class::EVENTLOG_CHARACTER_LIMIT
|
238
|
+
warning = "...Message exceeds character length limit, truncating."
|
239
|
+
truncated_message_length = self.class::EVENTLOG_CHARACTER_LIMIT - warning.length
|
240
|
+
stringified_truncated_msg = stringified_msg[0..truncated_message_length]
|
241
|
+
stringified_truncated_msg << warning
|
242
|
+
msg.message = stringified_truncated_msg
|
243
|
+
end
|
244
|
+
|
236
245
|
@eventlog.report_event(
|
237
246
|
:event_type => native_type,
|
238
247
|
:event_id => native_id,
|
@@ -69,7 +69,7 @@ if Puppet::Util::Platform.windows?
|
|
69
69
|
Puppet::Util::Windows::RootCerts.instance.to_a.uniq { |cert| cert.to_der }.each do |x509|
|
70
70
|
begin
|
71
71
|
add_cert(x509)
|
72
|
-
rescue OpenSSL::X509::StoreError
|
72
|
+
rescue OpenSSL::X509::StoreError
|
73
73
|
warn "Failed to add #{x509.subject.to_s}"
|
74
74
|
end
|
75
75
|
end
|
@@ -99,7 +99,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
99
99
|
:VirtualAccess => %w{Virtual-Access Virtual-A Virtual Virt}
|
100
100
|
}
|
101
101
|
|
102
|
-
def
|
102
|
+
def canonicalize_ifname(interface)
|
103
103
|
IF.each do |k,ifnames|
|
104
104
|
if found = ifnames.find { |ifname| interface =~ /^#{ifname}\s*\d/i }
|
105
105
|
found = /^#{found}(.+)\Z/i.match(interface)
|
@@ -119,7 +119,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def interface(name)
|
122
|
-
ifname =
|
122
|
+
ifname = canonicalize_ifname(name)
|
123
123
|
interface = parse_interface(ifname)
|
124
124
|
return { :ensure => :absent } if interface.empty?
|
125
125
|
interface.merge!(parse_trunking(ifname))
|
@@ -127,7 +127,7 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def new_interface(name)
|
130
|
-
Puppet::Util::NetworkDevice::Cisco::Interface.new(
|
130
|
+
Puppet::Util::NetworkDevice::Cisco::Interface.new(canonicalize_ifname(name), transport)
|
131
131
|
end
|
132
132
|
|
133
133
|
def parse_interface(name)
|
@@ -192,13 +192,13 @@ class Puppet::Util::NetworkDevice::Cisco::Device < Puppet::Util::NetworkDevice::
|
|
192
192
|
when /^(\d+)\s+(\w+)\s+(\w+)\s+([a-zA-Z0-9,\/. ]+)\s*$/
|
193
193
|
vlan = { :name => $1, :description => $2, :status => $3, :interfaces => [] }
|
194
194
|
if $4.strip.length > 0
|
195
|
-
vlan[:interfaces] = $4.strip.split(/\s*,\s*/).map{ |ifn|
|
195
|
+
vlan[:interfaces] = $4.strip.split(/\s*,\s*/).map{ |ifn| canonicalize_ifname(ifn) }
|
196
196
|
end
|
197
197
|
vlans[vlan[:name]] = vlan
|
198
198
|
when /^\s+([a-zA-Z0-9,\/. ]+)\s*$/
|
199
199
|
raise _("invalid sh vlan summary output") unless vlan
|
200
200
|
if $1.strip.length > 0
|
201
|
-
vlan[:interfaces] += $1.strip.split(/\s*,\s*/).map{ |ifn|
|
201
|
+
vlan[:interfaces] += $1.strip.split(/\s*,\s*/).map{ |ifn| canonicalize_ifname(ifn) }
|
202
202
|
end
|
203
203
|
else
|
204
204
|
end
|
@@ -71,13 +71,12 @@ class Puppet::Util::NetworkDevice::Config
|
|
71
71
|
raise Puppet::Error, _("Invalid entry at %{error_location}: %{file_text}") %
|
72
72
|
{ error_location: error_location_str, file_text: line }
|
73
73
|
end
|
74
|
-
file_line_count += 1
|
75
74
|
end
|
76
75
|
end
|
77
|
-
rescue Errno::EACCES
|
76
|
+
rescue Errno::EACCES
|
78
77
|
Puppet.err _("Configuration error: Cannot read %{file}; cannot serve") % { file: @file }
|
79
78
|
#raise Puppet::Error, "Cannot read #{@config}"
|
80
|
-
rescue Errno::ENOENT
|
79
|
+
rescue Errno::ENOENT
|
81
80
|
Puppet.err _("Configuration error: '%{file}' does not exit; cannot serve") % { file: @file }
|
82
81
|
end
|
83
82
|
|
data/lib/puppet/util/platform.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
module Puppet
|
2
2
|
module Util
|
3
3
|
module Platform
|
4
|
+
|
5
|
+
FIPS_STATUS_FILE = "/proc/sys/crypto/fips_enabled".freeze
|
6
|
+
|
4
7
|
def windows?
|
5
8
|
# Ruby only sets File::ALT_SEPARATOR on Windows and the Ruby standard
|
6
9
|
# library uses that to test what platform it's on. In some places we
|
@@ -17,6 +20,16 @@ module Puppet
|
|
17
20
|
%w{/usr/sbin /sbin}
|
18
21
|
end
|
19
22
|
module_function :default_paths
|
23
|
+
|
24
|
+
@fips_enabled = !windows? &&
|
25
|
+
File.exist?(FIPS_STATUS_FILE) &&
|
26
|
+
File.read(FIPS_STATUS_FILE, 1) == '1'
|
27
|
+
|
28
|
+
def fips_enabled?
|
29
|
+
@fips_enabled
|
30
|
+
end
|
31
|
+
module_function :fips_enabled?
|
32
|
+
|
20
33
|
end
|
21
34
|
end
|
22
35
|
end
|
data/lib/puppet/util/plist.rb
CHANGED
@@ -41,7 +41,7 @@ module Puppet::Util::Plist
|
|
41
41
|
|
42
42
|
Puppet.debug "Plist #{file_path} ill-formatted, converting with plutil"
|
43
43
|
begin
|
44
|
-
plist = Puppet::Util::Execution.execute(['/usr/bin/plutil', '-convert', 'xml1', '-o', '
|
44
|
+
plist = Puppet::Util::Execution.execute(['/usr/bin/plutil', '-convert', 'xml1', '-o', '/dev/stdout', file_path],
|
45
45
|
{:failonfail => true, :combine => true})
|
46
46
|
return parse_plist(plist)
|
47
47
|
rescue Puppet::ExecutionFailure => detail
|
@@ -124,11 +124,11 @@ module Puppet::Util::Plist
|
|
124
124
|
|
125
125
|
def to_format(format)
|
126
126
|
if format.to_sym == :xml
|
127
|
-
|
127
|
+
CFPropertyList::List::FORMAT_XML
|
128
128
|
elsif format.to_sym == :binary
|
129
|
-
|
129
|
+
CFPropertyList::List::FORMAT_BINARY
|
130
130
|
elsif format.to_sym == :plain
|
131
|
-
|
131
|
+
CFPropertyList::List::FORMAT_PLAIN
|
132
132
|
else
|
133
133
|
raise FormatError.new "Unknown plist format #{format}"
|
134
134
|
end
|
@@ -160,7 +160,7 @@ module Generators
|
|
160
160
|
@allfiles << { "file" => file, "modules" => modules, "classes" => classes, "methods" => methods, "nodes" => nodes }
|
161
161
|
end
|
162
162
|
|
163
|
-
# scan all classes to create the
|
163
|
+
# scan all classes to create the child's references
|
164
164
|
@allclasses.values.each do |klass|
|
165
165
|
if superklass = klass.context.superclass
|
166
166
|
if superklass = AllReferences[superklass] and (superklass.is_a?(HTMLPuppetClass) or superklass.is_a?(HTMLPuppetNode))
|
@@ -896,7 +896,7 @@ module Generators
|
|
896
896
|
|
897
897
|
def find_symbol(symbol, method=nil)
|
898
898
|
res = @context.parent.find_symbol(symbol, method)
|
899
|
-
res
|
899
|
+
res && res.viewer
|
900
900
|
end
|
901
901
|
|
902
902
|
end
|
@@ -12,6 +12,10 @@ class Puppet::Util::Reference
|
|
12
12
|
|
13
13
|
instance_load(:reference, 'puppet/reference')
|
14
14
|
|
15
|
+
def self.footer
|
16
|
+
"\n\n----------------\n\n" + _("*This page autogenerated on %{current_time}*\n") % { current_time: Time.now.to_s }
|
17
|
+
end
|
18
|
+
|
15
19
|
def self.modes
|
16
20
|
%w{pdf text}
|
17
21
|
end
|
@@ -107,12 +111,15 @@ class Puppet::Util::Reference
|
|
107
111
|
def to_markdown(withcontents = true)
|
108
112
|
# First the header
|
109
113
|
text = markdown_header(@title, 1)
|
110
|
-
|
114
|
+
#TRANSLATORS message accompanied by date of generation
|
115
|
+
text << _("\n\n**This page is autogenerated; any changes will get overwritten** *(last generated on %{current_time})*\n\n") % { current_time: Time.now.to_s }
|
111
116
|
|
112
117
|
text << @header
|
113
118
|
|
114
119
|
text << generate
|
115
120
|
|
121
|
+
text << self.class.footer if withcontents
|
122
|
+
|
116
123
|
text
|
117
124
|
end
|
118
125
|
end
|
@@ -66,7 +66,7 @@ module Puppet::Util::Windows::ADSI
|
|
66
66
|
return sid_uri(sid) if sid.kind_of?(Puppet::Util::Windows::SID::Principal)
|
67
67
|
|
68
68
|
begin
|
69
|
-
sid = Puppet::Util::Windows::SID.
|
69
|
+
sid = Puppet::Util::Windows::SID.name_to_sid_object(sid)
|
70
70
|
sid_uri(sid)
|
71
71
|
rescue Puppet::Util::Windows::Error, Puppet::Error
|
72
72
|
nil
|
@@ -114,7 +114,7 @@ module Puppet::Util::Windows::ADSI
|
|
114
114
|
Puppet::Util::Windows::SID.sid_to_name('S-1-5-32').upcase,
|
115
115
|
# localized version of NT AUTHORITY (can't use S-1-5)
|
116
116
|
# for instance AUTORITE NT on French Windows
|
117
|
-
Puppet::Util::Windows::SID.
|
117
|
+
Puppet::Util::Windows::SID.name_to_sid_object('SYSTEM').domain.upcase
|
118
118
|
]
|
119
119
|
end
|
120
120
|
|
@@ -139,12 +139,10 @@ module Puppet::Util::Windows::ADSI
|
|
139
139
|
return account, domain
|
140
140
|
end
|
141
141
|
|
142
|
-
# returns Puppet::Util::Windows::SID::Principal[]
|
143
|
-
# may contain objects that represent unresolvable SIDs
|
144
142
|
def get_sids(adsi_child_collection)
|
145
143
|
sids = []
|
146
144
|
adsi_child_collection.each do |m|
|
147
|
-
sids << Puppet::Util::Windows::SID.
|
145
|
+
sids << Puppet::Util::Windows::SID.octet_string_to_sid_object(m.objectSID)
|
148
146
|
end
|
149
147
|
|
150
148
|
sids
|
@@ -154,7 +152,7 @@ module Puppet::Util::Windows::ADSI
|
|
154
152
|
return {} if names.nil? || names.empty?
|
155
153
|
|
156
154
|
sids = names.map do |name|
|
157
|
-
sid = Puppet::Util::Windows::SID.
|
155
|
+
sid = Puppet::Util::Windows::SID.name_to_sid_object(name)
|
158
156
|
raise Puppet::Error.new( _("Could not resolve name: %{name}") % { name: name } ) if !sid
|
159
157
|
[sid.sid, sid]
|
160
158
|
end
|
@@ -185,7 +183,7 @@ module Puppet::Util::Windows::ADSI
|
|
185
183
|
end
|
186
184
|
|
187
185
|
def sid
|
188
|
-
@sid ||= Puppet::Util::Windows::SID.
|
186
|
+
@sid ||= Puppet::Util::Windows::SID.octet_string_to_sid_object(native_user.objectSID)
|
189
187
|
end
|
190
188
|
|
191
189
|
def uri
|
@@ -338,12 +336,12 @@ module Puppet::Util::Windows::ADSI
|
|
338
336
|
end
|
339
337
|
|
340
338
|
def self.current_user_sid
|
341
|
-
Puppet::Util::Windows::SID.
|
339
|
+
Puppet::Util::Windows::SID.name_to_sid_object(current_user_name)
|
342
340
|
end
|
343
341
|
|
344
342
|
def self.exists?(name_or_sid)
|
345
343
|
well_known = false
|
346
|
-
if (sid = Puppet::Util::Windows::SID.
|
344
|
+
if (sid = Puppet::Util::Windows::SID.name_to_sid_object(name_or_sid))
|
347
345
|
return true if sid.account_type == :SidTypeUser
|
348
346
|
|
349
347
|
# 'well known group' is special as it can be a group like Everyone OR a user like SYSTEM
|
@@ -433,7 +431,7 @@ module Puppet::Util::Windows::ADSI
|
|
433
431
|
end
|
434
432
|
|
435
433
|
def sid
|
436
|
-
@sid ||= Puppet::Util::Windows::SID.
|
434
|
+
@sid ||= Puppet::Util::Windows::SID.octet_string_to_sid_object(native_group.objectSID)
|
437
435
|
end
|
438
436
|
|
439
437
|
def commit
|
@@ -465,13 +463,18 @@ module Puppet::Util::Windows::ADSI
|
|
465
463
|
end
|
466
464
|
end
|
467
465
|
|
468
|
-
# returns Puppet::Util::Windows::SID::Principal[]
|
469
|
-
# may contain objects that represent unresolvable SIDs
|
470
|
-
# qualified account names are returned by calling #domain_account
|
471
466
|
def members
|
467
|
+
# WIN32OLE objects aren't enumerable, so no map
|
468
|
+
members = []
|
469
|
+
# Setting WIN32OLE.codepage in the microsoft_windows feature ensures
|
470
|
+
# values are returned as UTF-8
|
471
|
+
native_group.Members.each {|m| members << m.Name}
|
472
|
+
members
|
473
|
+
end
|
474
|
+
|
475
|
+
def member_sids
|
472
476
|
self.class.get_sids(native_group.Members)
|
473
477
|
end
|
474
|
-
alias member_sids members
|
475
478
|
|
476
479
|
def set_members(desired_members, inclusive = true)
|
477
480
|
return if desired_members.nil?
|
@@ -505,7 +508,7 @@ module Puppet::Util::Windows::ADSI
|
|
505
508
|
|
506
509
|
def self.exists?(name_or_sid)
|
507
510
|
well_known = false
|
508
|
-
if (sid = Puppet::Util::Windows::SID.
|
511
|
+
if (sid = Puppet::Util::Windows::SID.name_to_sid_object(name_or_sid))
|
509
512
|
return true if sid.account_type == :SidTypeGroup
|
510
513
|
|
511
514
|
# 'well known group' is special as it can be a group like Everyone OR a user like SYSTEM
|