puppet 2.7.26 → 3.0.0.rc4
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/CHANGELOG +533 -204
- data/Gemfile +8 -24
- data/Gemfile.lock +44 -0
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/README_DEVELOPER.md +18 -210
- data/Rakefile +30 -47
- data/bin/puppet +5 -3
- data/conf/auth.conf +3 -3
- data/{ext → conf}/osx/PackageInfo.plist +0 -0
- data/{ext → conf}/osx/createpackage.sh +0 -0
- data/conf/osx/preflight +24 -0
- data/conf/redhat/client.init +8 -8
- data/{ext/redhat/puppet.spec.erb → conf/redhat/puppet.spec} +29 -46
- data/conf/redhat/queue.init +105 -0
- data/conf/redhat/rundir-perms.patch +13 -13
- data/conf/redhat/server.init +4 -4
- data/conf/solaris/pkginfo +1 -1
- data/conf/suse/puppet.spec +8 -3
- data/conf/windows/eventlog/puppetres.dll +0 -0
- data/ext/emacs/puppet-mode.el +204 -150
- data/ext/nagios/naggen +1 -1
- data/ext/puppet-test +1 -1
- data/ext/puppetlisten/puppetlisten.rb +1 -2
- data/ext/puppetlisten/puppetrun.rb +1 -2
- data/ext/rack/files/config.ru +21 -3
- data/ext/regexp_nodes/environment/development +2 -0
- data/ext/regexp_nodes/parameters/{environment → service}/prod +0 -0
- data/ext/regexp_nodes/parameters/{environment → service}/qa +0 -0
- data/ext/regexp_nodes/parameters/service/sandbox +1 -0
- data/ext/regexp_nodes/regexp_nodes.rb +115 -59
- data/ext/upload_facts.rb +0 -1
- data/install.rb +10 -10
- data/lib/puppet.rb +49 -24
- data/lib/puppet/agent.rb +40 -16
- data/lib/puppet/agent/disabler.rb +53 -0
- data/lib/puppet/agent/locker.rb +18 -24
- data/lib/puppet/application.rb +93 -72
- data/lib/puppet/application/agent.rb +29 -47
- data/lib/puppet/application/apply.rb +40 -39
- data/lib/puppet/application/cert.rb +9 -11
- data/lib/puppet/application/certificate.rb +7 -2
- data/lib/puppet/application/certificate_request.rb +3 -0
- data/lib/puppet/application/certificate_revocation_list.rb +3 -0
- data/lib/puppet/application/describe.rb +1 -3
- data/lib/puppet/application/device.rb +15 -16
- data/lib/puppet/application/doc.rb +12 -11
- data/lib/puppet/application/face_base.rb +9 -13
- data/lib/puppet/application/filebucket.rb +2 -8
- data/lib/puppet/application/inspect.rb +3 -6
- data/lib/puppet/application/instrumentation_data.rb +3 -0
- data/lib/puppet/application/instrumentation_listener.rb +3 -0
- data/lib/puppet/application/instrumentation_probe.rb +3 -0
- data/lib/puppet/application/kick.rb +2 -8
- data/lib/puppet/application/master.rb +9 -15
- data/lib/puppet/application/module.rb +0 -7
- data/lib/puppet/application/queue.rb +7 -6
- data/lib/puppet/application/resource.rb +1 -5
- data/lib/puppet/application/resource_type.rb +3 -0
- data/lib/puppet/application/secret_agent.rb +3 -0
- data/lib/puppet/configurer.rb +87 -88
- data/lib/puppet/configurer/downloader.rb +8 -23
- data/lib/puppet/configurer/fact_handler.rb +5 -17
- data/lib/puppet/configurer/plugin_handler.rb +4 -23
- data/lib/puppet/daemon.rb +24 -6
- data/lib/puppet/data_binding.rb +11 -0
- data/lib/puppet/defaults.rb +1058 -518
- data/lib/puppet/error.rb +31 -25
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/external/nagios/base.rb +8 -4
- data/lib/puppet/face/ca.rb +1 -1
- data/lib/puppet/face/catalog.rb +1 -2
- data/lib/puppet/face/certificate.rb +12 -0
- data/lib/puppet/face/config.rb +3 -0
- data/lib/puppet/face/help.rb +92 -28
- data/lib/puppet/face/help/action.erb +36 -3
- data/lib/puppet/face/help/face.erb +35 -3
- data/lib/puppet/face/help/global.erb +8 -12
- data/lib/puppet/face/help/man.erb +20 -2
- data/lib/puppet/face/instrumentation_data.rb +1 -0
- data/lib/puppet/face/instrumentation_listener.rb +1 -0
- data/lib/puppet/face/instrumentation_probe.rb +1 -0
- data/lib/puppet/face/module.rb +2 -0
- data/lib/puppet/face/module/build.rb +32 -6
- data/lib/puppet/face/module/changes.rb +1 -0
- data/lib/puppet/face/module/generate.rb +1 -0
- data/lib/puppet/face/module/install.rb +10 -41
- data/lib/puppet/face/module/list.rb +2 -19
- data/lib/puppet/face/module/search.rb +12 -6
- data/lib/puppet/face/module/uninstall.rb +3 -18
- data/lib/puppet/face/module/upgrade.rb +2 -9
- data/lib/puppet/face/node/clean.rb +25 -27
- data/lib/puppet/face/report.rb +2 -4
- data/lib/puppet/face/resource.rb +1 -1
- data/lib/puppet/feature/base.rb +9 -3
- data/lib/puppet/feature/rails.rb +18 -0
- data/lib/puppet/feature/rdoc1.rb +16 -0
- data/lib/puppet/file_bucket/dipper.rb +3 -2
- data/lib/puppet/file_serving/base.rb +4 -8
- data/lib/puppet/file_serving/configuration.rb +1 -12
- data/lib/puppet/file_serving/configuration/parser.rb +1 -1
- data/lib/puppet/file_serving/metadata.rb +0 -14
- data/lib/puppet/file_serving/mount/plugins.rb +10 -1
- data/lib/puppet/file_serving/terminus_selector.rb +15 -13
- data/lib/puppet/forge.rb +29 -13
- data/lib/puppet/forge/cache.rb +1 -1
- data/lib/puppet/forge/errors.rb +69 -0
- data/lib/puppet/forge/repository.rb +84 -21
- data/lib/puppet/indirector/catalog/active_record.rb +2 -12
- data/lib/puppet/indirector/catalog/compiler.rb +8 -18
- data/lib/puppet/indirector/catalog/json.rb +6 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +3 -2
- data/lib/puppet/indirector/certificate/rest.rb +1 -0
- data/lib/puppet/indirector/certificate_status/file.rb +0 -5
- data/lib/puppet/indirector/data_binding/hiera.rb +6 -0
- data/lib/puppet/indirector/data_binding/none.rb +5 -0
- data/lib/puppet/indirector/exec.rb +8 -18
- data/lib/puppet/indirector/face.rb +5 -4
- data/lib/puppet/indirector/facts/facter.rb +6 -33
- data/lib/puppet/indirector/facts/network_device.rb +0 -1
- data/lib/puppet/indirector/file_bucket_file/file.rb +0 -4
- data/lib/puppet/indirector/file_bucket_file/selector.rb +0 -4
- data/lib/puppet/indirector/file_content/rest.rb +2 -0
- data/lib/puppet/indirector/hiera.rb +69 -0
- data/lib/puppet/indirector/indirection.rb +20 -26
- data/lib/puppet/indirector/json.rb +76 -0
- data/lib/puppet/indirector/ldap.rb +3 -2
- data/lib/puppet/indirector/node/active_record.rb +1 -0
- data/lib/puppet/indirector/node/exec.rb +9 -0
- data/lib/puppet/indirector/node/ldap.rb +6 -3
- data/lib/puppet/indirector/node/plain.rb +1 -0
- data/lib/puppet/indirector/none.rb +9 -0
- data/lib/puppet/indirector/queue.rb +1 -2
- data/lib/puppet/indirector/report/processor.rb +2 -3
- data/lib/puppet/indirector/report/rest.rb +1 -7
- data/lib/puppet/indirector/request.rb +80 -18
- data/lib/puppet/indirector/resource/active_record.rb +0 -3
- data/lib/puppet/indirector/resource/ral.rb +0 -4
- data/lib/puppet/indirector/resource/rest.rb +0 -9
- data/lib/puppet/indirector/resource/store_configs.rb +0 -3
- data/lib/puppet/indirector/resource_type/parser.rb +30 -1
- data/lib/puppet/indirector/rest.rb +103 -126
- data/lib/puppet/indirector/run/local.rb +0 -4
- data/lib/puppet/indirector/run/rest.rb +0 -6
- data/lib/puppet/indirector/terminus.rb +0 -20
- data/lib/puppet/indirector/yaml.rb +11 -5
- data/lib/puppet/interface.rb +6 -14
- data/lib/puppet/interface/action.rb +21 -3
- data/lib/puppet/interface/action_builder.rb +5 -0
- data/lib/puppet/interface/action_manager.rb +1 -1
- data/lib/puppet/interface/documentation.rb +12 -0
- data/lib/puppet/interface/face_collection.rb +1 -1
- data/lib/puppet/interface/option.rb +19 -3
- data/lib/puppet/interface/option_manager.rb +27 -9
- data/lib/puppet/metatype/manager.rb +1 -0
- data/lib/puppet/module.rb +40 -83
- data/lib/puppet/module_tool.rb +42 -5
- data/lib/puppet/module_tool/applications/builder.rb +1 -1
- data/lib/puppet/module_tool/applications/installer.rb +11 -11
- data/lib/puppet/module_tool/applications/searcher.rb +15 -2
- data/lib/puppet/module_tool/applications/unpacker.rb +4 -8
- data/lib/puppet/module_tool/applications/upgrader.rb +6 -5
- data/lib/puppet/module_tool/errors/base.rb +1 -1
- data/lib/puppet/module_tool/errors/installer.rb +24 -4
- data/lib/puppet/module_tool/install_directory.rb +41 -0
- data/lib/puppet/module_tool/metadata.rb +4 -4
- data/lib/puppet/module_tool/shared_behaviors.rb +6 -6
- data/lib/puppet/network/auth_config_parser.rb +81 -0
- data/lib/puppet/network/authconfig.rb +49 -147
- data/lib/puppet/network/authorization.rb +20 -62
- data/lib/puppet/network/authstore.rb +43 -27
- data/lib/puppet/network/formats.rb +10 -20
- data/lib/puppet/network/http/api/v1.rb +1 -1
- data/lib/puppet/network/http/connection.rb +184 -0
- data/lib/puppet/network/http/handler.rb +4 -14
- data/lib/puppet/network/http/mongrel.rb +5 -25
- data/lib/puppet/network/http/rack.rb +2 -34
- data/lib/puppet/network/http/rack/httphandler.rb +0 -3
- data/lib/puppet/network/http/rack/rest.rb +2 -7
- data/lib/puppet/network/http/webrick.rb +9 -32
- data/lib/puppet/network/http_pool.rb +10 -48
- data/lib/puppet/network/resolver.rb +85 -0
- data/lib/puppet/network/rights.rb +33 -89
- data/lib/puppet/network/server.rb +14 -43
- data/lib/puppet/node.rb +13 -11
- data/lib/puppet/node/environment.rb +29 -12
- data/lib/puppet/node/facts.rb +13 -38
- data/lib/puppet/parameter.rb +0 -21
- data/lib/puppet/parameter/package_options.rb +26 -0
- data/lib/puppet/parser/ast.rb +2 -13
- data/lib/puppet/parser/ast/function.rb +0 -2
- data/lib/puppet/parser/ast/leaf.rb +12 -22
- data/lib/puppet/parser/ast/resource.rb +3 -10
- data/lib/puppet/parser/ast/resource_defaults.rb +1 -1
- data/lib/puppet/parser/ast/resource_override.rb +1 -4
- data/lib/puppet/parser/ast/resourceparam.rb +4 -7
- data/lib/puppet/parser/ast/selector.rb +7 -1
- data/lib/puppet/parser/ast/vardef.rb +0 -2
- data/lib/puppet/parser/collector.rb +2 -1
- data/lib/puppet/parser/compiler.rb +43 -46
- data/lib/puppet/parser/files.rb +15 -20
- data/lib/puppet/parser/functions.rb +8 -39
- data/lib/puppet/parser/functions/extlookup.rb +8 -8
- data/lib/puppet/parser/functions/file.rb +18 -18
- data/lib/puppet/parser/functions/fqdn_rand.rb +2 -2
- data/lib/puppet/parser/functions/generate.rb +3 -3
- data/lib/puppet/parser/functions/include.rb +6 -1
- data/lib/puppet/parser/functions/require.rb +16 -21
- data/lib/puppet/parser/functions/shellquote.rb +29 -21
- data/lib/puppet/parser/functions/versioncmp.rb +2 -5
- data/lib/puppet/parser/grammar.ra +44 -14
- data/lib/puppet/parser/lexer.rb +101 -169
- data/lib/puppet/parser/parser.rb +1103 -1014
- data/lib/puppet/parser/parser_support.rb +10 -61
- data/lib/puppet/parser/relationship.rb +1 -3
- data/lib/puppet/parser/resource.rb +21 -56
- data/lib/puppet/parser/scope.rb +138 -165
- data/lib/puppet/parser/templatewrapper.rb +25 -20
- data/lib/puppet/parser/type_loader.rb +33 -67
- data/lib/puppet/parser/yaml_trimmer.rb +1 -1
- data/lib/puppet/property.rb +5 -4
- data/lib/puppet/provider.rb +133 -28
- data/lib/puppet/provider/augeas/augeas.rb +66 -6
- data/lib/puppet/provider/command.rb +25 -0
- data/lib/puppet/provider/cron/crontab.rb +1 -1
- data/lib/puppet/provider/exec.rb +14 -9
- data/lib/puppet/provider/exec/posix.rb +1 -1
- data/lib/puppet/provider/exec/windows.rb +2 -3
- data/lib/puppet/provider/file/windows.rb +29 -10
- data/lib/puppet/provider/group/groupadd.rb +3 -2
- data/lib/puppet/provider/group/ldap.rb +1 -1
- data/lib/puppet/provider/group/windows_adsi.rb +1 -1
- data/lib/puppet/provider/host/parsed.rb +1 -1
- data/lib/puppet/provider/ldap.rb +1 -5
- data/lib/puppet/provider/mount/parsed.rb +3 -3
- data/lib/puppet/provider/nameservice.rb +22 -22
- data/lib/puppet/provider/nameservice/directoryservice.rb +58 -121
- data/lib/puppet/provider/package/apt.rb +8 -11
- data/lib/puppet/provider/package/blastwave.rb +3 -3
- data/lib/puppet/provider/package/dpkg.rb +1 -1
- data/lib/puppet/provider/package/freebsd.rb +2 -2
- data/lib/puppet/provider/package/gem.rb +1 -1
- data/lib/puppet/provider/package/macports.rb +11 -9
- data/lib/puppet/provider/package/msi.rb +37 -32
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pacman.rb +69 -6
- data/lib/puppet/provider/package/pkg.rb +126 -75
- data/lib/puppet/provider/package/pkgin.rb +60 -0
- data/lib/puppet/provider/package/pkgutil.rb +32 -20
- data/lib/puppet/provider/package/portage.rb +2 -2
- data/lib/puppet/provider/package/sun.rb +83 -116
- data/lib/puppet/provider/package/sunfreeware.rb +1 -1
- data/lib/puppet/provider/package/up2date.rb +2 -3
- data/lib/puppet/provider/package/windows.rb +130 -0
- data/lib/puppet/provider/package/windows/exe_package.rb +70 -0
- data/lib/puppet/provider/package/windows/msi_package.rb +62 -0
- data/lib/puppet/provider/package/windows/package.rb +79 -0
- data/lib/puppet/provider/scheduled_task/win32_taskscheduler.rb +2 -2
- data/lib/puppet/provider/service/base.rb +1 -0
- data/lib/puppet/provider/service/bsd.rb +7 -5
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/freebsd.rb +9 -9
- data/lib/puppet/provider/service/launchd.rb +7 -11
- data/lib/puppet/provider/service/redhat.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +9 -2
- data/lib/puppet/provider/service/smf.rb +14 -2
- data/lib/puppet/provider/service/systemd.rb +3 -3
- data/lib/puppet/provider/service/upstart.rb +6 -6
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +1 -0
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +3 -8
- data/lib/puppet/provider/user/windows_adsi.rb +1 -12
- data/lib/puppet/provider/zfs/{solaris.rb → zfs.rb} +16 -5
- data/lib/puppet/provider/zone/solaris.rb +10 -13
- data/lib/puppet/provider/zpool/{solaris.rb → zpool.rb} +11 -4
- data/lib/puppet/rails.rb +6 -4
- data/lib/puppet/rails/database/schema.rb +9 -4
- data/lib/puppet/rails/inventory_node.rb +13 -26
- data/lib/puppet/reference/configuration.rb +1 -2
- data/lib/puppet/reference/metaparameter.rb +1 -2
- data/lib/puppet/reports/http.rb +9 -10
- data/lib/puppet/reports/rrdgraph.rb +2 -2
- data/lib/puppet/reports/store.rb +1 -2
- data/lib/puppet/reports/tagmail.rb +6 -6
- data/lib/puppet/resource.rb +69 -64
- data/lib/puppet/resource/catalog.rb +11 -60
- data/lib/puppet/resource/status.rb +6 -32
- data/lib/puppet/resource/type.rb +94 -34
- data/lib/puppet/resource/type_collection.rb +17 -8
- data/lib/puppet/run.rb +4 -26
- data/lib/puppet/settings.rb +1315 -0
- data/lib/puppet/settings/base_setting.rb +163 -0
- data/lib/puppet/{util/settings → settings}/boolean_setting.rb +7 -3
- data/lib/puppet/settings/directory_setting.rb +7 -0
- data/lib/puppet/settings/errors.rb +11 -0
- data/lib/puppet/{util/settings → settings}/file_setting.rb +4 -20
- data/lib/puppet/settings/path_setting.rb +10 -0
- data/lib/puppet/settings/string_setting.rb +12 -0
- data/lib/puppet/simple_graph.rb +2 -5
- data/lib/puppet/ssl/base.rb +2 -2
- data/lib/puppet/ssl/certificate_authority.rb +4 -5
- data/lib/puppet/ssl/certificate_authority/interface.rb +5 -7
- data/lib/puppet/ssl/certificate_factory.rb +1 -2
- data/lib/puppet/ssl/certificate_request.rb +2 -2
- data/lib/puppet/ssl/certificate_revocation_list.rb +53 -30
- data/lib/puppet/ssl/configuration.rb +32 -0
- data/lib/puppet/ssl/host.rb +9 -37
- data/lib/puppet/status.rb +2 -6
- data/lib/puppet/test/test_helper.rb +58 -25
- data/lib/puppet/transaction.rb +6 -9
- data/lib/puppet/transaction/event.rb +13 -24
- data/lib/puppet/transaction/event_manager.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -41
- data/lib/puppet/transaction/resource_harness.rb +2 -3
- data/lib/puppet/type.rb +18 -191
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +6 -4
- data/lib/puppet/type/file.rb +33 -44
- data/lib/puppet/type/file/content.rb +13 -9
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +2 -6
- data/lib/puppet/type/file/source.rb +8 -4
- data/lib/puppet/type/filebucket.rb +3 -2
- data/lib/puppet/type/mount.rb +1 -11
- data/lib/puppet/type/package.rb +40 -23
- data/lib/puppet/type/schedule.rb +127 -21
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/service.rb +2 -3
- data/lib/puppet/type/tidy.rb +8 -17
- data/lib/puppet/type/yumrepo.rb +35 -7
- data/lib/puppet/type/zfs.rb +4 -0
- data/lib/puppet/type/zone.rb +48 -38
- data/lib/puppet/util.rb +178 -249
- data/lib/puppet/util/adsi.rb +23 -25
- data/lib/puppet/util/autoload.rb +184 -114
- data/lib/puppet/util/backups.rb +3 -2
- data/lib/puppet/util/colors.rb +0 -1
- data/lib/puppet/util/command_line.rb +42 -104
- data/lib/puppet/util/command_line/puppet_option_parser.rb +89 -0
- data/lib/puppet/util/command_line/trollop.rb +824 -0
- data/lib/puppet/util/config_timeout.rb +24 -0
- data/lib/puppet/util/constant_inflector.rb +15 -7
- data/lib/puppet/util/diff.rb +2 -2
- data/lib/puppet/util/docs.rb +1 -2
- data/lib/puppet/util/errors.rb +3 -4
- data/lib/puppet/util/execution.rb +239 -14
- data/lib/puppet/util/execution_stub.rb +2 -2
- data/lib/puppet/util/feature.rb +2 -4
- data/lib/puppet/util/fileparsing.rb +1 -1
- data/lib/puppet/util/filetype.rb +12 -10
- data/lib/puppet/util/json_lockfile.rb +41 -0
- data/lib/puppet/util/ldap/connection.rb +4 -7
- data/lib/puppet/util/lockfile.rb +62 -0
- data/lib/puppet/util/log.rb +16 -20
- data/lib/puppet/util/log/destinations.rb +12 -27
- data/lib/puppet/util/logging.rb +95 -3
- data/lib/puppet/util/metric.rb +0 -6
- data/lib/puppet/util/monkey_patches.rb +101 -82
- data/lib/puppet/util/monkey_patches/lines.rb +13 -0
- data/lib/puppet/util/network_device/cisco/device.rb +2 -2
- data/lib/puppet/util/network_device/config.rb +1 -0
- data/lib/puppet/util/network_device/transport.rb +2 -0
- data/lib/puppet/util/pidlock.rb +13 -77
- data/lib/puppet/util/platform.rb +0 -7
- data/lib/puppet/util/posix.rb +10 -0
- data/lib/puppet/util/rdoc.rb +12 -8
- data/lib/puppet/util/reference.rb +3 -3
- data/lib/puppet/util/rubygems.rb +55 -0
- data/lib/puppet/util/run_mode.rb +7 -16
- data/lib/puppet/util/selinux.rb +36 -31
- data/lib/puppet/util/storage.rb +14 -19
- data/lib/puppet/util/suidmanager.rb +27 -2
- data/lib/puppet/util/windows.rb +9 -6
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/registry.rb +36 -0
- data/lib/puppet/util/windows/security.rb +46 -9
- data/lib/puppet/util/windows/user.rb +2 -65
- data/lib/puppet/util/zaml.rb +47 -91
- data/lib/puppet/version.rb +1 -1
- data/man/man5/puppet.conf.5 +97 -69
- data/man/man8/puppet-agent.8 +5 -6
- data/man/man8/puppet-apply.8 +7 -3
- data/man/man8/puppet-ca.8 +5 -17
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-cert.8 +1 -1
- data/man/man8/puppet-certificate.8 +3 -9
- 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 +1 -1
- data/man/man8/puppet-doc.8 +7 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-file.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-help.8 +2 -5
- data/man/man8/puppet-inspect.8 +1 -1
- data/man/man8/puppet-instrumentation_data.8 +1 -1
- data/man/man8/puppet-instrumentation_listener.8 +1 -1
- data/man/man8/puppet-instrumentation_probe.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-kick.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 +19 -50
- data/man/man8/puppet-node.8 +2 -5
- data/man/man8/puppet-parser.8 +7 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-queue.8 +1 -1
- data/man/man8/puppet-report.8 +2 -3
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-resource_type.8 +1 -1
- data/man/man8/puppet-secret_agent.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +1 -1
- data/spec/fixtures/unit/indirector/hiera/global.yaml +10 -0
- data/{test/data/providers/cron/crontab_sample_records.yaml → spec/fixtures/unit/provider/cron/crontab/single_line.yaml} +0 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris10 +1 -1
- data/spec/fixtures/unit/provider/package/pkg/{dummy_solaris11 → dummy_solaris11.ifo.installed} +0 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.ifo.known +1 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.installed +1 -0
- data/spec/fixtures/unit/provider/package/pkg/dummy_solaris11.known +1 -0
- data/spec/fixtures/unit/provider/package/pkg/publisher +2 -2
- data/spec/fixtures/unit/provider/package/pkg/simple +2 -4
- data/spec/fixtures/unit/provider/package/pkg/solaris11 +2 -12
- data/spec/fixtures/unit/provider/package/sun/dummy.server +12 -0
- data/spec/fixtures/unit/provider/package/sun/simple +24 -0
- data/spec/fixtures/unit/provider/service/smf/svcs.out +3 -0
- data/{test/data/types/sshkey/1 → spec/fixtures/unit/provider/sshkey/parsed/sample} +0 -0
- data/spec/fixtures/unit/provider/zfs/zfs/zfs-list.out +2 -0
- data/spec/fixtures/unit/provider/zpool/zpool/zpool-list.out +2 -0
- data/spec/integration/application/apply_spec.rb +1 -1
- data/spec/integration/application/doc_spec.rb +3 -2
- data/spec/integration/configurer_spec.rb +1 -1
- data/spec/integration/defaults_spec.rb +21 -51
- data/spec/{unit/face → integration/faces}/ca_spec.rb +89 -130
- data/spec/integration/faces/documentation_spec.rb +36 -29
- data/spec/integration/file_serving/content_spec.rb +1 -2
- data/spec/integration/file_serving/fileset_spec.rb +1 -1
- data/spec/integration/file_serving/metadata_spec.rb +1 -2
- data/spec/integration/file_serving/terminus_helper_spec.rb +1 -1
- data/spec/integration/indirector/catalog/compiler_spec.rb +1 -2
- data/spec/integration/indirector/catalog/queue_spec.rb +3 -3
- data/spec/integration/indirector/direct_file_server_spec.rb +14 -10
- data/spec/integration/indirector/facts/facter_spec.rb +22 -0
- data/spec/integration/indirector/file_content/file_server_spec.rb +1 -1
- data/spec/integration/indirector/file_metadata/file_server_spec.rb +1 -1
- data/spec/integration/indirector/node/ldap_spec.rb +1 -1
- data/spec/integration/network/authconfig_spec.rb +238 -0
- data/spec/integration/network/formats_spec.rb +2 -4
- data/spec/integration/network/server/mongrel_spec.rb +2 -10
- data/spec/integration/network/server/webrick_spec.rb +1 -1
- data/spec/integration/node/environment_spec.rb +1 -1
- data/spec/integration/node/facts_spec.rb +2 -2
- data/spec/integration/node_spec.rb +2 -15
- data/spec/integration/parser/collector_spec.rb +2 -2
- data/spec/integration/parser/compiler_spec.rb +38 -10
- data/spec/integration/parser/functions/require_spec.rb +1 -1
- data/spec/integration/parser/functions_spec.rb +1 -1
- data/spec/integration/parser/parser_spec.rb +1 -1
- data/spec/integration/parser/ruby_manifest_spec.rb +1 -1
- data/spec/integration/parser/scope_spec.rb +608 -0
- data/spec/integration/provider/mailalias/aliases_spec.rb +1 -1
- data/spec/integration/provider/mount_spec.rb +1 -0
- data/spec/integration/provider/package_spec.rb +3 -3
- data/spec/integration/provider/service/init_spec.rb +2 -2
- data/spec/integration/provider/ssh_authorized_key_spec.rb +1 -1
- data/spec/integration/reference/providers_spec.rb +1 -1
- data/spec/integration/reports_spec.rb +1 -1
- data/spec/integration/resource/catalog_spec.rb +1 -2
- data/spec/integration/resource/type_collection_spec.rb +1 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +1 -1
- data/spec/integration/ssl/certificate_request_spec.rb +1 -1
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/integration/ssl/host_spec.rb +1 -1
- data/spec/integration/transaction/report_spec.rb +1 -1
- data/spec/integration/transaction_spec.rb +2 -2
- data/spec/integration/type/exec_spec.rb +1 -1
- data/spec/integration/type/file_spec.rb +140 -158
- data/spec/integration/type/package_spec.rb +6 -2
- data/spec/integration/type/tidy_spec.rb +1 -1
- data/spec/integration/type_spec.rb +1 -1
- data/spec/integration/util/autoload_spec.rb +8 -14
- data/spec/integration/util/feature_spec.rb +1 -1
- data/spec/integration/util/rdoc/parser_spec.rb +11 -9
- data/spec/integration/util/settings_spec.rb +19 -6
- data/spec/integration/util/windows/security_spec.rb +23 -3
- data/spec/integration/util_spec.rb +3 -3
- data/spec/lib/puppet/indirector/indirector_testing/json.rb +6 -0
- data/spec/lib/puppet/indirector_testing.rb +27 -0
- data/spec/lib/puppet_spec/compiler.rb +2 -2
- data/spec/lib/puppet_spec/database.rb +1 -1
- data/spec/lib/puppet_spec/files.rb +4 -4
- data/spec/lib/puppet_spec/matchers.rb +26 -24
- data/spec/lib/puppet_spec/modules.rb +1 -1
- data/spec/lib/puppet_spec/settings.rb +16 -0
- data/spec/shared_behaviours/file_server_terminus.rb +2 -2
- data/spec/shared_behaviours/file_serving.rb +10 -15
- data/spec/shared_behaviours/file_serving_model.rb +2 -6
- data/spec/shared_contexts/platform.rb +0 -8
- data/spec/spec_helper.rb +14 -15
- data/spec/unit/agent/disabler_spec.rb +64 -0
- data/spec/unit/agent/locker_spec.rb +31 -36
- data/spec/unit/agent_spec.rb +79 -26
- data/spec/unit/application/agent_spec.rb +66 -39
- data/spec/unit/application/apply_spec.rb +46 -36
- data/spec/unit/application/cert_spec.rb +1 -5
- data/spec/unit/application/certificate_spec.rb +1 -1
- data/spec/unit/application/config_spec.rb +1 -1
- data/spec/unit/application/describe_spec.rb +1 -5
- data/spec/unit/application/device_spec.rb +22 -12
- data/spec/unit/application/doc_spec.rb +37 -69
- data/spec/unit/application/face_base_spec.rb +10 -6
- data/spec/unit/application/facts_spec.rb +3 -3
- data/spec/unit/application/filebucket_spec.rb +7 -18
- data/spec/unit/application/indirection_base_spec.rb +11 -5
- data/spec/unit/application/inspect_spec.rb +3 -2
- data/spec/unit/application/kick_spec.rb +6 -22
- data/spec/unit/application/master_spec.rb +15 -39
- data/spec/unit/application/queue_spec.rb +2 -6
- data/spec/unit/application/resource_spec.rb +15 -12
- data/spec/unit/application/secret_agent_spec.rb +1 -1
- data/spec/unit/application_spec.rb +110 -123
- data/spec/unit/configurer/downloader_spec.rb +5 -5
- data/spec/unit/configurer/fact_handler_spec.rb +1 -40
- data/spec/unit/configurer/plugin_handler_spec.rb +11 -96
- data/spec/unit/configurer_spec.rb +61 -59
- data/spec/unit/daemon_spec.rb +26 -19
- data/spec/unit/data_binding_spec.rb +11 -0
- data/spec/unit/dsl/resource_api_spec.rb +2 -2
- data/spec/unit/dsl/resource_type_api_spec.rb +1 -1
- data/spec/unit/face/catalog_spec.rb +1 -1
- data/spec/unit/face/certificate_request_spec.rb +1 -1
- data/spec/unit/face/certificate_revocation_list_spec.rb +1 -1
- data/spec/unit/face/certificate_spec.rb +18 -1
- data/spec/unit/face/config_spec.rb +8 -1
- data/spec/unit/face/facts_spec.rb +1 -1
- data/spec/unit/face/file_spec.rb +1 -1
- data/spec/unit/face/help_spec.rb +39 -22
- data/spec/unit/face/instrumentation_data_spec.rb +1 -1
- data/spec/unit/face/instrumentation_listener_spec.rb +1 -1
- data/spec/unit/face/instrumentation_probe_spec.rb +1 -1
- data/spec/unit/face/key_spec.rb +1 -1
- data/spec/unit/face/module/build_spec.rb +68 -0
- data/spec/unit/face/module/install_spec.rb +46 -31
- data/spec/unit/face/module/list_spec.rb +18 -21
- data/spec/unit/face/module/search_spec.rb +87 -49
- data/spec/unit/face/module/uninstall_spec.rb +4 -4
- data/spec/unit/face/node_spec.rb +3 -3
- data/spec/unit/face/plugin_spec.rb +1 -1
- data/spec/unit/face/report_spec.rb +1 -1
- data/spec/unit/face/resource_spec.rb +1 -1
- data/spec/unit/face/resource_type_spec.rb +1 -1
- data/spec/unit/face/secret_agent_spec.rb +1 -1
- data/spec/unit/file_bucket/dipper_spec.rb +1 -1
- data/spec/unit/file_bucket/file_spec.rb +1 -1
- data/spec/unit/file_serving/base_spec.rb +1 -1
- data/spec/unit/file_serving/configuration/parser_spec.rb +1 -1
- data/spec/unit/file_serving/configuration_spec.rb +7 -21
- data/spec/unit/file_serving/content_spec.rb +1 -1
- data/spec/unit/file_serving/fileset_spec.rb +13 -13
- data/spec/unit/file_serving/metadata_spec.rb +29 -47
- data/spec/unit/file_serving/mount/file_spec.rb +1 -1
- data/spec/unit/file_serving/mount/modules_spec.rb +1 -1
- data/spec/unit/file_serving/mount/plugins_spec.rb +17 -4
- data/spec/unit/file_serving/mount_spec.rb +1 -1
- data/spec/unit/file_serving/terminus_helper_spec.rb +1 -1
- data/spec/unit/file_serving/terminus_selector_spec.rb +5 -5
- data/spec/unit/forge/errors_spec.rb +42 -0
- data/spec/unit/forge/repository_spec.rb +108 -31
- data/spec/unit/forge_spec.rb +17 -23
- data/spec/unit/indirector/active_record_spec.rb +1 -1
- data/spec/unit/indirector/catalog/active_record_spec.rb +11 -49
- data/spec/unit/indirector/catalog/compiler_spec.rb +18 -45
- data/spec/unit/indirector/catalog/json_spec.rb +12 -0
- data/spec/unit/indirector/catalog/queue_spec.rb +1 -1
- data/spec/unit/indirector/catalog/rest_spec.rb +1 -1
- data/spec/unit/indirector/catalog/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/catalog/yaml_spec.rb +1 -1
- data/spec/unit/indirector/certificate/ca_spec.rb +5 -6
- data/spec/unit/indirector/certificate/file_spec.rb +5 -6
- data/spec/unit/indirector/certificate/rest_spec.rb +6 -2
- data/spec/unit/indirector/certificate_request/ca_spec.rb +3 -3
- data/spec/unit/indirector/certificate_request/file_spec.rb +3 -3
- data/spec/unit/indirector/certificate_request/rest_spec.rb +1 -1
- data/spec/unit/indirector/certificate_revocation_list/ca_spec.rb +3 -4
- data/spec/unit/indirector/certificate_revocation_list/file_spec.rb +4 -3
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +1 -1
- data/spec/unit/indirector/certificate_status/file_spec.rb +41 -31
- data/spec/unit/indirector/certificate_status/rest_spec.rb +1 -1
- data/spec/unit/indirector/code_spec.rb +1 -1
- data/spec/unit/indirector/data_binding/hiera_spec.rb +21 -0
- data/spec/unit/indirector/data_binding/none_spec.rb +28 -0
- data/spec/unit/indirector/direct_file_server_spec.rb +2 -2
- data/spec/unit/indirector/envelope_spec.rb +1 -1
- data/spec/unit/indirector/exec_spec.rb +1 -1
- data/spec/unit/indirector/face_spec.rb +1 -1
- data/spec/unit/indirector/facts/active_record_spec.rb +1 -1
- data/spec/unit/indirector/facts/couch_spec.rb +3 -3
- data/spec/unit/indirector/facts/facter_spec.rb +13 -20
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +2 -2
- data/spec/unit/indirector/facts/inventory_service_spec.rb +2 -3
- data/spec/unit/indirector/facts/network_device_spec.rb +2 -9
- data/spec/unit/indirector/facts/rest_spec.rb +1 -1
- data/spec/unit/indirector/facts/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/facts/yaml_spec.rb +2 -2
- data/spec/unit/indirector/file_bucket_file/file_spec.rb +2 -2
- data/spec/unit/indirector/file_bucket_file/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_content/file_server_spec.rb +1 -1
- data/spec/unit/indirector/file_content/file_spec.rb +1 -1
- data/spec/unit/indirector/file_content/rest_spec.rb +7 -3
- data/spec/unit/indirector/file_metadata/file_server_spec.rb +1 -1
- data/spec/unit/indirector/file_metadata/file_spec.rb +3 -3
- data/spec/unit/indirector/file_metadata/rest_spec.rb +1 -1
- data/spec/unit/indirector/file_server_spec.rb +1 -1
- data/spec/unit/indirector/hiera_spec.rb +149 -0
- data/spec/unit/indirector/indirection_spec.rb +10 -29
- data/spec/unit/indirector/instrumentation_data/local_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_data/rest_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_listener/local_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_listener/rest_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_probe/local_spec.rb +1 -1
- data/spec/unit/indirector/instrumentation_probe/rest_spec.rb +1 -1
- data/spec/unit/indirector/json_spec.rb +193 -0
- data/spec/unit/indirector/key/ca_spec.rb +5 -6
- data/spec/unit/indirector/key/file_spec.rb +10 -12
- data/spec/unit/indirector/ldap_spec.rb +3 -3
- data/spec/unit/indirector/memory_spec.rb +1 -1
- data/spec/unit/indirector/node/active_record_spec.rb +11 -7
- data/spec/unit/indirector/node/exec_spec.rb +12 -5
- data/spec/unit/indirector/node/ldap_spec.rb +173 -194
- data/spec/unit/indirector/node/memory_spec.rb +1 -1
- data/spec/unit/indirector/node/plain_spec.rb +16 -8
- data/spec/unit/indirector/node/rest_spec.rb +1 -1
- data/spec/unit/indirector/node/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/node/yaml_spec.rb +1 -1
- data/spec/unit/indirector/none_spec.rb +33 -0
- data/spec/unit/indirector/plain_spec.rb +1 -1
- data/spec/unit/indirector/queue_spec.rb +1 -1
- data/spec/unit/indirector/report/processor_spec.rb +4 -4
- data/spec/unit/indirector/report/rest_spec.rb +3 -46
- data/spec/unit/indirector/report/yaml_spec.rb +3 -12
- data/spec/unit/indirector/request_spec.rb +238 -61
- data/spec/unit/indirector/resource/active_record_spec.rb +2 -2
- data/spec/unit/indirector/resource/ral_spec.rb +2 -2
- data/spec/unit/indirector/resource/rest_spec.rb +1 -1
- data/spec/unit/indirector/resource/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/resource_type/parser_spec.rb +153 -53
- data/spec/unit/indirector/resource_type/rest_spec.rb +1 -1
- data/spec/unit/indirector/rest_spec.rb +350 -361
- data/spec/unit/indirector/run/local_spec.rb +2 -2
- data/spec/unit/indirector/run/rest_spec.rb +1 -1
- data/spec/unit/indirector/ssl_file_spec.rb +12 -10
- data/spec/unit/indirector/status/rest_spec.rb +1 -1
- data/spec/unit/indirector/store_configs_spec.rb +1 -1
- data/spec/unit/indirector/terminus_spec.rb +1 -46
- data/spec/unit/indirector/yaml_spec.rb +36 -36
- data/spec/unit/indirector_spec.rb +1 -1
- data/spec/unit/interface/action_builder_spec.rb +1 -1
- data/spec/unit/interface/action_manager_spec.rb +1 -1
- data/spec/unit/interface/action_spec.rb +1 -1
- data/spec/unit/interface/documentation_spec.rb +3 -2
- data/spec/unit/interface/face_collection_spec.rb +19 -9
- data/spec/unit/interface/option_builder_spec.rb +9 -1
- data/spec/unit/interface/option_spec.rb +8 -0
- data/spec/unit/interface_spec.rb +49 -11
- data/spec/unit/module_spec.rb +95 -303
- data/spec/unit/module_tool/application_spec.rb +6 -6
- data/spec/unit/module_tool/applications/installer_spec.rb +131 -69
- data/spec/unit/module_tool/applications/searcher_spec.rb +37 -0
- data/spec/unit/module_tool/applications/uninstaller_spec.rb +27 -19
- data/spec/unit/module_tool/applications/unpacker_spec.rb +4 -10
- data/spec/unit/module_tool/applications/upgrader_spec.rb +1 -4
- data/spec/unit/module_tool/install_directory_spec.rb +70 -0
- data/spec/unit/module_tool_spec.rb +132 -1
- data/spec/unit/network/auth_config_parser_spec.rb +101 -0
- data/spec/unit/network/authconfig_spec.rb +54 -272
- data/spec/unit/network/authorization_spec.rb +20 -0
- data/spec/unit/network/authstore_spec.rb +17 -15
- data/spec/unit/network/format_handler_spec.rb +3 -3
- data/spec/unit/network/format_spec.rb +1 -1
- data/spec/unit/network/formats_spec.rb +28 -37
- data/spec/unit/network/http/api/v1_spec.rb +3 -3
- data/spec/unit/network/http/compression_spec.rb +3 -3
- data/spec/unit/network/http/connection_spec.rb +244 -0
- data/spec/unit/network/http/handler_spec.rb +4 -20
- data/spec/unit/network/http/mongrel/rest_spec.rb +12 -31
- data/spec/unit/network/http/mongrel_spec.rb +7 -37
- data/spec/unit/network/http/rack/rest_spec.rb +10 -44
- data/spec/unit/network/http/rack_spec.rb +2 -59
- data/spec/unit/network/http/webrick/rest_spec.rb +14 -4
- data/spec/unit/network/http/webrick_spec.rb +129 -193
- data/spec/unit/network/http_pool_spec.rb +6 -115
- data/spec/unit/network/http_spec.rb +1 -1
- data/spec/unit/network/resolver_spec.rb +207 -0
- data/spec/unit/network/rights_spec.rb +15 -115
- data/spec/unit/network/server_spec.rb +58 -166
- data/spec/unit/node/environment_spec.rb +7 -7
- data/spec/unit/node/facts_spec.rb +15 -30
- data/spec/unit/node_spec.rb +14 -26
- data/spec/unit/other/selinux_spec.rb +1 -1
- data/spec/unit/parameter/package_options_spec.rb +44 -0
- data/spec/unit/parameter/path_spec.rb +1 -1
- data/spec/unit/parameter/value_collection_spec.rb +1 -1
- data/spec/unit/parameter/value_spec.rb +1 -1
- data/spec/unit/parameter_spec.rb +1 -1
- data/spec/unit/parser/ast/arithmetic_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/astarray_spec.rb +4 -2
- data/spec/unit/parser/ast/asthash_spec.rb +4 -2
- data/spec/unit/parser/ast/boolean_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/casestatement_spec.rb +9 -5
- data/spec/unit/parser/ast/collection_spec.rb +2 -2
- data/spec/unit/parser/ast/collexpr_spec.rb +4 -2
- data/spec/unit/parser/ast/comparison_operator_spec.rb +5 -2
- data/spec/unit/parser/ast/definition_spec.rb +1 -1
- data/spec/unit/parser/ast/function_spec.rb +3 -3
- data/spec/unit/parser/ast/hostclass_spec.rb +1 -1
- data/spec/unit/parser/ast/ifstatement_spec.rb +4 -2
- data/spec/unit/parser/ast/in_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/leaf_spec.rb +66 -39
- data/spec/unit/parser/ast/match_operator_spec.rb +4 -2
- data/spec/unit/parser/ast/minus_spec.rb +4 -2
- data/spec/unit/parser/ast/node_spec.rb +1 -1
- data/spec/unit/parser/ast/nop_spec.rb +1 -1
- data/spec/unit/parser/ast/not_spec.rb +4 -2
- data/spec/unit/parser/ast/relationship_spec.rb +2 -2
- data/spec/unit/parser/ast/resource_defaults_spec.rb +2 -2
- data/spec/unit/parser/ast/resource_override_spec.rb +2 -2
- data/spec/unit/parser/ast/resource_reference_spec.rb +5 -3
- data/spec/unit/parser/ast/resource_spec.rb +5 -32
- data/spec/unit/parser/ast/selector_spec.rb +56 -106
- data/spec/unit/parser/ast/vardef_spec.rb +4 -2
- data/spec/unit/parser/ast_spec.rb +22 -51
- data/spec/unit/parser/collector_spec.rb +2 -2
- data/spec/unit/parser/compiler_spec.rb +89 -42
- data/spec/unit/parser/files_spec.rb +81 -10
- data/spec/unit/parser/functions/create_resources_spec.rb +5 -4
- data/spec/unit/parser/functions/defined_spec.rb +2 -2
- data/spec/unit/parser/functions/extlookup_spec.rb +9 -8
- data/spec/unit/parser/functions/fail_spec.rb +28 -0
- data/spec/unit/parser/functions/file_spec.rb +55 -0
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +6 -12
- data/spec/unit/parser/functions/generate_spec.rb +54 -3
- data/spec/unit/parser/functions/include_spec.rb +19 -2
- data/spec/unit/parser/functions/inline_template_spec.rb +9 -20
- data/spec/unit/parser/functions/realize_spec.rb +4 -4
- data/spec/unit/parser/functions/regsubst_spec.rb +4 -2
- data/spec/unit/parser/functions/require_spec.rb +5 -14
- data/spec/unit/parser/functions/search_spec.rb +23 -0
- data/spec/unit/parser/functions/shellquote_spec.rb +31 -38
- data/spec/unit/parser/functions/split_spec.rb +4 -2
- data/spec/unit/parser/functions/sprintf_spec.rb +4 -2
- data/spec/unit/parser/functions/tag_spec.rb +4 -3
- data/spec/unit/parser/functions/template_spec.rb +45 -27
- data/spec/unit/parser/functions/versioncmp_spec.rb +4 -2
- data/spec/unit/parser/functions_spec.rb +14 -22
- data/spec/unit/parser/lexer_spec.rb +10 -134
- data/spec/unit/parser/parser_spec.rb +126 -35
- data/spec/unit/parser/relationship_spec.rb +1 -25
- data/spec/unit/parser/resource_spec.rb +15 -79
- data/spec/unit/parser/scope_spec.rb +175 -602
- data/spec/unit/parser/templatewrapper_spec.rb +8 -25
- data/spec/unit/parser/type_loader_spec.rb +37 -21
- data/spec/unit/property/ensure_spec.rb +1 -1
- data/spec/unit/property/keyvalue_spec.rb +1 -1
- data/spec/unit/property/list_spec.rb +1 -1
- data/spec/unit/property/ordered_list_spec.rb +1 -1
- data/spec/unit/property_spec.rb +1 -1
- data/spec/unit/{puppet/provider → provider}/README.markdown +0 -0
- data/spec/unit/provider/augeas/augeas_spec.rb +88 -1
- data/spec/unit/provider/cisco_spec.rb +1 -1
- data/spec/unit/provider/command_spec.rb +62 -0
- data/spec/unit/provider/confine/exists_spec.rb +8 -1
- data/spec/unit/provider/confine/false_spec.rb +1 -1
- data/spec/unit/provider/confine/feature_spec.rb +1 -1
- data/spec/unit/provider/confine/true_spec.rb +1 -1
- data/spec/unit/provider/confine/variable_spec.rb +1 -1
- data/spec/unit/provider/confine_collection_spec.rb +1 -1
- data/spec/unit/provider/confine_spec.rb +1 -1
- data/spec/unit/provider/confiner_spec.rb +1 -1
- data/spec/unit/provider/cron/crontab_spec.rb +116 -0
- data/spec/unit/provider/exec/posix_spec.rb +99 -12
- data/spec/unit/provider/exec/shell_spec.rb +1 -1
- data/spec/unit/provider/exec/windows_spec.rb +1 -1
- data/spec/unit/provider/exec_spec.rb +1 -1
- data/spec/unit/provider/file/posix_spec.rb +1 -1
- data/spec/unit/provider/file/windows_spec.rb +30 -30
- data/spec/unit/provider/group/groupadd_spec.rb +31 -37
- data/spec/unit/provider/group/ldap_spec.rb +1 -1
- data/spec/unit/provider/group/pw_spec.rb +1 -1
- data/spec/unit/provider/group/windows_adsi_spec.rb +2 -2
- data/spec/unit/provider/host/parsed_spec.rb +1 -1
- data/spec/unit/provider/interface/cisco_spec.rb +1 -1
- data/spec/unit/provider/ldap_spec.rb +1 -1
- data/spec/unit/provider/macauthorization_spec.rb +1 -1
- data/spec/unit/provider/mcx/mcxcontent_spec.rb +1 -1
- data/spec/unit/provider/mount/parsed_spec.rb +18 -12
- data/spec/unit/provider/mount_spec.rb +1 -1
- data/spec/unit/provider/naginator_spec.rb +1 -1
- data/spec/unit/provider/nameservice/directoryservice_spec.rb +9 -29
- data/spec/unit/provider/network_device_spec.rb +1 -1
- data/spec/unit/provider/package/aix_spec.rb +1 -1
- data/spec/unit/provider/package/appdmg_spec.rb +1 -1
- data/spec/unit/provider/package/apt_spec.rb +1 -1
- data/spec/unit/provider/package/aptitude_spec.rb +38 -0
- data/spec/unit/provider/package/aptrpm_spec.rb +39 -0
- data/spec/unit/provider/package/dpkg_spec.rb +4 -4
- data/spec/unit/provider/package/freebsd_spec.rb +3 -3
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/hpux_spec.rb +1 -1
- data/spec/unit/provider/package/macports_spec.rb +27 -10
- data/spec/unit/provider/package/msi_spec.rb +29 -14
- data/spec/unit/provider/package/nim_spec.rb +1 -1
- data/spec/unit/provider/package/openbsd_spec.rb +3 -3
- data/spec/unit/provider/package/pacman_spec.rb +109 -81
- data/spec/unit/provider/package/pip_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +205 -97
- data/spec/unit/provider/package/pkgdmg_spec.rb +1 -1
- data/spec/unit/provider/package/pkgin_spec.rb +176 -0
- data/spec/unit/provider/package/pkgutil_spec.rb +64 -10
- data/spec/unit/provider/package/rpm_spec.rb +58 -0
- data/spec/unit/provider/package/sun_spec.rb +122 -0
- data/spec/unit/provider/package/up2date_spec.rb +24 -0
- data/spec/unit/provider/package/windows/exe_package_spec.rb +99 -0
- data/spec/unit/provider/package/windows/msi_package_spec.rb +115 -0
- data/spec/unit/provider/package/windows/package_spec.rb +126 -0
- data/spec/unit/provider/package/windows_spec.rb +255 -0
- data/spec/unit/provider/package/yum_spec.rb +1 -1
- data/spec/unit/provider/package/zypper_spec.rb +1 -1
- data/spec/unit/provider/parsedfile_spec.rb +1 -1
- data/spec/unit/provider/scheduled_task/win32_taskscheduler_spec.rb +12 -15
- data/spec/unit/provider/selboolean_spec.rb +1 -1
- data/spec/unit/provider/selmodule-example.pp +0 -0
- data/spec/unit/provider/selmodule_spec.rb +1 -1
- data/spec/unit/provider/service/base_spec.rb +77 -0
- data/spec/unit/provider/service/daemontools_spec.rb +1 -1
- data/spec/unit/provider/service/debian_spec.rb +1 -1
- data/spec/unit/provider/service/freebsd_spec.rb +1 -1
- data/spec/unit/provider/service/gentoo_spec.rb +1 -1
- data/spec/unit/provider/service/init_spec.rb +1 -1
- data/spec/unit/provider/service/launchd_spec.rb +0 -17
- data/spec/unit/provider/service/redhat_spec.rb +12 -3
- data/spec/unit/provider/service/runit_spec.rb +2 -1
- data/spec/unit/provider/service/smf_spec.rb +16 -1
- data/spec/unit/provider/service/src_spec.rb +6 -6
- data/spec/unit/provider/service/systemd_spec.rb +18 -1
- data/spec/unit/provider/service/upstart_spec.rb +12 -7
- data/spec/unit/provider/service/windows_spec.rb +1 -1
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +1 -1
- data/spec/unit/provider/sshkey/parsed_spec.rb +42 -12
- data/spec/unit/provider/user/hpux_spec.rb +1 -1
- data/spec/unit/provider/user/ldap_spec.rb +9 -23
- data/spec/unit/provider/user/pw_spec.rb +1 -1
- data/spec/unit/provider/user/user_role_add_spec.rb +5 -2
- data/spec/unit/provider/user/useradd_spec.rb +118 -146
- data/spec/unit/provider/user/windows_adsi_spec.rb +2 -24
- data/spec/unit/provider/vlan/cisco_spec.rb +1 -1
- data/spec/unit/provider/zfs/zfs_spec.rb +106 -0
- data/spec/unit/provider/zone/solaris_spec.rb +56 -34
- data/spec/unit/provider/zpool/zpool_spec.rb +213 -0
- data/spec/unit/provider_spec.rb +621 -16
- data/spec/unit/puppet_spec.rb +21 -9
- data/spec/unit/rails/host_spec.rb +1 -1
- data/spec/unit/rails/param_value_spec.rb +1 -1
- data/spec/unit/rails/resource_spec.rb +1 -1
- data/spec/unit/rails_spec.rb +70 -70
- data/spec/unit/relationship_spec.rb +1 -1
- data/spec/unit/reports/http_spec.rb +48 -15
- data/spec/unit/reports/rrdgraph_spec.rb +1 -1
- data/spec/unit/reports/store_spec.rb +1 -1
- data/spec/unit/reports/tagmail_spec.rb +1 -1
- data/spec/unit/reports_spec.rb +1 -1
- data/spec/unit/resource/catalog_spec.rb +8 -175
- data/spec/unit/resource/status_spec.rb +2 -2
- data/spec/unit/resource/type_collection_helper_spec.rb +1 -1
- data/spec/unit/resource/type_collection_spec.rb +72 -45
- data/spec/unit/resource/type_spec.rb +31 -33
- data/spec/unit/resource_spec.rb +163 -98
- data/spec/unit/run_spec.rb +7 -23
- data/spec/unit/settings/directory_setting_spec.rb +32 -0
- data/spec/unit/{util/settings → settings}/file_setting_spec.rb +14 -23
- data/spec/unit/settings/path_setting_spec.rb +30 -0
- data/spec/unit/settings/string_setting_spec.rb +75 -0
- data/spec/unit/settings_spec.rb +1583 -0
- data/spec/unit/simple_graph_spec.rb +19 -5
- data/spec/unit/ssl/base_spec.rb +2 -2
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +7 -7
- data/spec/unit/ssl/certificate_authority_spec.rb +27 -53
- data/spec/unit/ssl/certificate_factory_spec.rb +1 -1
- data/spec/unit/ssl/certificate_request_spec.rb +2 -4
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +3 -3
- data/spec/unit/ssl/certificate_spec.rb +1 -1
- data/spec/unit/ssl/configuration_spec.rb +60 -0
- data/spec/unit/ssl/host_spec.rb +37 -89
- data/spec/unit/ssl/inventory_spec.rb +13 -20
- data/spec/unit/ssl/key_spec.rb +11 -9
- data/spec/unit/status_spec.rb +1 -7
- data/spec/unit/transaction/event_manager_spec.rb +1 -1
- data/spec/unit/transaction/event_spec.rb +6 -6
- data/spec/unit/transaction/report_spec.rb +1 -1
- data/spec/unit/transaction/resource_harness_spec.rb +2 -2
- data/spec/unit/transaction_spec.rb +8 -8
- data/spec/unit/{puppet/type → type}/README.markdown +0 -0
- data/spec/unit/type/augeas_spec.rb +2 -2
- data/spec/unit/type/component_spec.rb +1 -1
- data/spec/unit/type/computer_spec.rb +1 -1
- data/spec/unit/type/cron_spec.rb +1 -1
- data/spec/unit/type/exec_spec.rb +40 -12
- data/spec/unit/type/file/checksum_spec.rb +1 -1
- data/spec/unit/type/file/content_spec.rb +9 -6
- data/spec/unit/type/file/ctime_spec.rb +1 -1
- data/spec/unit/type/file/ensure_spec.rb +1 -1
- data/spec/unit/type/file/group_spec.rb +1 -1
- data/spec/unit/type/file/mode_spec.rb +1 -1
- data/spec/unit/type/file/mtime_spec.rb +1 -1
- data/spec/unit/type/file/owner_spec.rb +1 -1
- data/spec/unit/type/file/selinux_spec.rb +1 -1
- data/spec/unit/type/file/source_spec.rb +14 -13
- data/spec/unit/type/file/type_spec.rb +1 -1
- data/spec/unit/type/file_spec.rb +39 -87
- data/spec/unit/type/filebucket_spec.rb +1 -1
- data/spec/unit/type/group_spec.rb +5 -5
- data/spec/unit/type/host_spec.rb +1 -1
- data/spec/unit/type/interface_spec.rb +1 -1
- data/spec/unit/type/macauthorization_spec.rb +1 -1
- data/spec/unit/type/mailalias_spec.rb +21 -0
- data/spec/unit/type/maillist_spec.rb +1 -1
- data/spec/unit/type/mcx_spec.rb +1 -1
- data/spec/unit/type/mount_spec.rb +2 -2
- data/spec/unit/type/nagios_spec.rb +1 -1
- data/spec/unit/type/noop_metaparam_spec.rb +3 -3
- data/spec/unit/type/package_spec.rb +1 -1
- data/spec/unit/type/resources_spec.rb +2 -2
- data/spec/unit/type/schedule_spec.rb +297 -39
- data/spec/unit/type/scheduled_task_spec.rb +3 -3
- data/spec/unit/type/selboolean_spec.rb +1 -1
- data/spec/unit/type/selmodule_spec.rb +1 -1
- data/spec/unit/type/service_spec.rb +1 -1
- data/spec/unit/type/ssh_authorized_key_spec.rb +3 -3
- data/spec/unit/type/sshkey_spec.rb +1 -1
- data/spec/unit/type/stage_spec.rb +1 -1
- data/spec/unit/type/tidy_spec.rb +1 -1
- data/spec/unit/type/user_spec.rb +1 -1
- data/spec/unit/type/vlan_spec.rb +1 -1
- data/spec/unit/type/whit_spec.rb +1 -1
- data/spec/unit/type/yumrepo_spec.rb +243 -0
- data/spec/unit/type/zfs_spec.rb +8 -6
- data/spec/unit/type/zone_spec.rb +41 -36
- data/spec/unit/type/zpool_spec.rb +1 -1
- data/spec/unit/type_spec.rb +180 -31
- data/spec/unit/util/adsi_spec.rb +8 -23
- data/spec/unit/util/autoload_spec.rb +181 -45
- data/spec/unit/util/backups_spec.rb +1 -1
- data/spec/unit/util/cache_accumulator_spec.rb +1 -1
- data/spec/unit/util/cacher_spec.rb +1 -1
- data/spec/unit/util/checksums_spec.rb +1 -1
- data/spec/unit/util/command_line_spec.rb +114 -108
- data/spec/unit/util/command_line_utils/puppet_option_parser_spec.rb +129 -0
- data/spec/unit/util/config_timeout_spec.rb +57 -0
- data/spec/unit/util/constant_inflector_spec.rb +13 -23
- data/spec/unit/util/diff_spec.rb +5 -4
- data/spec/unit/util/errors_spec.rb +1 -1
- data/spec/unit/util/execution_spec.rb +532 -28
- data/spec/unit/util/execution_stub_spec.rb +4 -4
- data/spec/unit/util/feature_spec.rb +12 -13
- data/spec/unit/util/filetype_spec.rb +9 -9
- data/spec/unit/util/inline_docs_spec.rb +1 -1
- data/spec/unit/util/instrumentation/data_spec.rb +1 -1
- data/spec/unit/util/instrumentation/indirection_probe_spec.rb +1 -1
- data/spec/unit/util/instrumentation/instrumentable_spec.rb +1 -1
- data/spec/unit/util/instrumentation/listener_spec.rb +1 -1
- data/spec/unit/util/instrumentation_spec.rb +1 -1
- data/spec/unit/util/json_lockfile_spec.rb +29 -0
- data/spec/unit/util/ldap/connection_spec.rb +11 -15
- data/spec/unit/util/ldap/generator_spec.rb +1 -1
- data/spec/unit/util/ldap/manager_spec.rb +14 -23
- data/spec/unit/util/loadedfile_spec.rb +1 -1
- data/spec/unit/util/lockfile_spec.rb +76 -0
- data/spec/unit/util/log/destinations_spec.rb +11 -28
- data/spec/unit/util/log_spec.rb +6 -6
- data/spec/unit/util/logging_spec.rb +43 -11
- data/spec/unit/util/metric_spec.rb +4 -3
- data/spec/unit/util/monkey_patches/lines_spec.rb +83 -0
- data/spec/unit/util/monkey_patches_spec.rb +91 -28
- data/spec/unit/util/nagios_maker_spec.rb +1 -1
- data/spec/unit/util/network_device/cisco/device_spec.rb +3 -3
- data/spec/unit/util/network_device/cisco/facts_spec.rb +1 -1
- data/spec/unit/util/network_device/cisco/interface_spec.rb +1 -1
- data/spec/unit/util/network_device/config_spec.rb +1 -1
- data/spec/unit/util/network_device/ipcalc_spec.rb +1 -1
- data/spec/unit/util/network_device/transport/base_spec.rb +1 -1
- data/spec/unit/util/network_device/transport/ssh_spec.rb +2 -2
- data/spec/unit/util/network_device/transport/telnet_spec.rb +1 -1
- data/spec/unit/util/network_device_spec.rb +1 -1
- data/spec/unit/util/package_spec.rb +1 -1
- data/spec/unit/util/pidlock_spec.rb +179 -0
- data/spec/unit/util/posix_spec.rb +2 -2
- data/spec/unit/util/pson_spec.rb +23 -9
- data/spec/unit/util/queue/stomp_spec.rb +10 -13
- data/spec/unit/util/queue_spec.rb +2 -2
- data/spec/unit/util/rdoc/parser_spec.rb +11 -9
- data/spec/unit/util/rdoc_spec.rb +9 -3
- data/spec/unit/util/reference_serializer_spec.rb +1 -1
- data/spec/unit/util/reference_spec.rb +1 -1
- data/spec/unit/util/resource_template_spec.rb +1 -1
- data/spec/unit/util/retryaction_spec.rb +1 -1
- data/spec/unit/util/rubygems_spec.rb +66 -0
- data/spec/unit/util/run_mode_spec.rb +4 -9
- data/spec/unit/util/selinux_spec.rb +33 -25
- data/spec/unit/util/storage_spec.rb +2 -18
- data/spec/unit/util/suidmanager_spec.rb +11 -4
- data/spec/unit/util/symbolic_file_mode_spec.rb +1 -1
- data/spec/unit/util/tagging_spec.rb +1 -1
- data/spec/unit/util/terminal_spec.rb +1 -1
- data/spec/unit/util/user_attr_spec.rb +1 -1
- data/spec/unit/util/warnings_spec.rb +1 -1
- data/spec/unit/util/windows/registry_spec.rb +86 -0
- data/spec/unit/util/zaml_spec.rb +30 -146
- data/spec/unit/util_spec.rb +148 -440
- data/spec/watchr.rb +6 -2
- data/tasks/rake/apple.rake +176 -0
- data/tasks/rake/gem.rake +6 -5
- data/tasks/rake/manpages.rake +8 -1
- data/tasks/rake/metrics.rake +11 -3
- data/tasks/rake/parser.rake +5 -0
- data/{ext/osx → tasks/rake/templates}/prototype.plist.erb +0 -0
- metadata +293 -580
- data/bin/filebucket +0 -7
- data/bin/pi +0 -5
- data/bin/puppetca +0 -4
- data/bin/puppetd +0 -4
- data/bin/puppetdoc +0 -4
- data/bin/puppetmasterd +0 -4
- data/bin/puppetqd +0 -4
- data/bin/puppetrun +0 -5
- data/bin/ralsh +0 -4
- data/ext/build_defaults.yaml +0 -19
- data/ext/debian/README.Debian +0 -8
- data/ext/debian/README.source +0 -2
- data/ext/debian/TODO.Debian +0 -1
- data/ext/debian/changelog.erb +0 -1104
- data/ext/debian/compat +0 -1
- data/ext/debian/control +0 -142
- data/ext/debian/copyright +0 -361
- data/ext/debian/docs +0 -1
- data/ext/debian/fileserver.conf +0 -17
- data/ext/debian/puppet-common.dirs +0 -8
- data/ext/debian/puppet-common.install +0 -3
- data/ext/debian/puppet-common.lintian-overrides +0 -7
- data/ext/debian/puppet-common.manpages +0 -2
- data/ext/debian/puppet-common.postinst +0 -35
- data/ext/debian/puppet-common.postrm +0 -32
- data/ext/debian/puppet-el.dirs +0 -1
- data/ext/debian/puppet-el.emacsen-install +0 -25
- data/ext/debian/puppet-el.emacsen-remove +0 -11
- data/ext/debian/puppet-el.emacsen-startup +0 -9
- data/ext/debian/puppet-el.install +0 -1
- data/ext/debian/puppet-testsuite.install +0 -3
- data/ext/debian/puppet-testsuite.lintian-overrides +0 -4
- data/ext/debian/puppet.NEWS +0 -86
- data/ext/debian/puppet.conf +0 -14
- data/ext/debian/puppet.default +0 -7
- data/ext/debian/puppet.dirs +0 -1
- data/ext/debian/puppet.init +0 -118
- data/ext/debian/puppet.install +0 -4
- data/ext/debian/puppet.lintian-overrides +0 -3
- data/ext/debian/puppet.logrotate +0 -11
- data/ext/debian/puppet.manpages +0 -36
- data/ext/debian/puppet.postinst +0 -20
- data/ext/debian/puppet.postrm +0 -20
- data/ext/debian/puppet.preinst +0 -20
- data/ext/debian/puppetmaster-common.install +0 -5
- data/ext/debian/puppetmaster-common.manpages +0 -5
- data/ext/debian/puppetmaster-common.puppetqd.default +0 -27
- data/ext/debian/puppetmaster-common.puppetqd.init +0 -84
- data/ext/debian/puppetmaster-passenger.dirs +0 -4
- data/ext/debian/puppetmaster-passenger.postinst +0 -66
- data/ext/debian/puppetmaster-passenger.postrm +0 -33
- data/ext/debian/puppetmaster.NEWS +0 -13
- data/ext/debian/puppetmaster.README.debian +0 -16
- data/ext/debian/puppetmaster.default +0 -38
- data/ext/debian/puppetmaster.dirs +0 -1
- data/ext/debian/puppetmaster.init +0 -158
- data/ext/debian/puppetmaster.install +0 -1
- data/ext/debian/puppetmaster.lintian-overrides +0 -3
- data/ext/debian/puppetmaster.manpages +0 -1
- data/ext/debian/puppetmaster.postinst +0 -20
- data/ext/debian/puppetmaster.postrm +0 -5
- data/ext/debian/puppetmaster.preinst +0 -22
- data/ext/debian/rules +0 -127
- data/ext/debian/source/format +0 -1
- data/ext/debian/source/options +0 -1
- data/ext/debian/vim-puppet.README.Debian +0 -13
- data/ext/debian/vim-puppet.dirs +0 -3
- data/ext/debian/vim-puppet.yaml +0 -5
- data/ext/debian/watch +0 -2
- data/ext/osx/file_mapping.yaml +0 -38
- data/ext/osx/preflight.erb +0 -37
- data/ext/packaging/Gemfile +0 -8
- data/ext/packaging/Gemfile.lock +0 -28
- data/ext/packaging/LICENSE +0 -17
- data/ext/packaging/README-Solaris.md +0 -117
- data/ext/packaging/README.md +0 -1074
- data/ext/packaging/lib/packaging.rb +0 -21
- data/ext/packaging/lib/packaging/config.rb +0 -277
- data/ext/packaging/lib/packaging/config/params.rb +0 -175
- data/ext/packaging/lib/packaging/tar.rb +0 -186
- data/ext/packaging/lib/packaging/util.rb +0 -44
- data/ext/packaging/lib/packaging/util/date.rb +0 -15
- data/ext/packaging/lib/packaging/util/file.rb +0 -60
- data/ext/packaging/lib/packaging/util/jira.rb +0 -83
- data/ext/packaging/lib/packaging/util/net.rb +0 -16
- data/ext/packaging/lib/packaging/util/rake_utils.rb +0 -57
- data/ext/packaging/lib/packaging/util/serialization.rb +0 -19
- data/ext/packaging/lib/packaging/util/tool.rb +0 -30
- data/ext/packaging/lib/packaging/util/version.rb +0 -300
- data/ext/packaging/packaging.rake +0 -50
- data/ext/packaging/spec/fixtures/config/ext/build_defaults.yaml +0 -2
- data/ext/packaging/spec/fixtures/config/ext/project_data.yaml +0 -2
- data/ext/packaging/spec/fixtures/config/params.yaml +0 -2
- data/ext/packaging/spec/fixtures/util/pre_tasks.yaml +0 -4
- data/ext/packaging/spec/lib/packaging/config_spec.rb +0 -330
- data/ext/packaging/spec/lib/packaging/tar_spec.rb +0 -122
- data/ext/packaging/spec/lib/packaging/util/file_spec.rb +0 -48
- data/ext/packaging/spec/lib/packaging/util/jira_spec.rb +0 -50
- data/ext/packaging/spec/lib/packaging/util/net_spec.rb +0 -23
- data/ext/packaging/spec/lib/packaging/util/rake_utils_spec.rb +0 -70
- data/ext/packaging/spec/lib/packaging/util/version_spec.rb +0 -67
- data/ext/packaging/spec/lib/packaging_spec.rb +0 -19
- data/ext/packaging/spec/spec_helper.rb +0 -22
- data/ext/packaging/spec/tasks/00_utils_spec.rb +0 -248
- data/ext/packaging/static_artifacts/PackageInfo.plist +0 -3
- data/ext/packaging/tasks/00_utils.rake +0 -402
- data/ext/packaging/tasks/30_metrics.rake +0 -33
- data/ext/packaging/tasks/apple.rake +0 -267
- data/ext/packaging/tasks/build.rake +0 -12
- data/ext/packaging/tasks/clean.rake +0 -5
- data/ext/packaging/tasks/deb.rake +0 -127
- data/ext/packaging/tasks/deb_repos.rake +0 -128
- data/ext/packaging/tasks/doc.rake +0 -20
- data/ext/packaging/tasks/fetch.rake +0 -58
- data/ext/packaging/tasks/gem.rake +0 -158
- data/ext/packaging/tasks/ips.rake +0 -122
- data/ext/packaging/tasks/jenkins.rake +0 -360
- data/ext/packaging/tasks/jenkins_dynamic.rake +0 -123
- data/ext/packaging/tasks/load_extras.rake +0 -21
- data/ext/packaging/tasks/mock.rake +0 -290
- data/ext/packaging/tasks/pe_deb.rake +0 -12
- data/ext/packaging/tasks/pe_remote.rake +0 -41
- data/ext/packaging/tasks/pe_rpm.rake +0 -13
- data/ext/packaging/tasks/pe_ship.rake +0 -179
- data/ext/packaging/tasks/pe_sign.rake +0 -47
- data/ext/packaging/tasks/pe_tar.rake +0 -5
- data/ext/packaging/tasks/release.rake +0 -91
- data/ext/packaging/tasks/remote_build.rake +0 -158
- data/ext/packaging/tasks/retrieve.rake +0 -45
- data/ext/packaging/tasks/rpm.rake +0 -71
- data/ext/packaging/tasks/rpm_repos.rake +0 -139
- data/ext/packaging/tasks/ship.rake +0 -192
- data/ext/packaging/tasks/sign.rake +0 -164
- data/ext/packaging/tasks/tag.rake +0 -8
- data/ext/packaging/tasks/tar.rake +0 -34
- data/ext/packaging/tasks/tickets.rake +0 -449
- data/ext/packaging/tasks/update.rake +0 -16
- data/ext/packaging/tasks/vendor_gems.rake +0 -110
- data/ext/packaging/tasks/version.rake +0 -33
- data/ext/packaging/tasks/z_data_dump.rake +0 -65
- data/ext/packaging/templates/README +0 -1
- data/ext/packaging/templates/downstream.xml.erb +0 -45
- data/ext/packaging/templates/packaging.xml.erb +0 -330
- data/ext/packaging/templates/repo.xml.erb +0 -106
- data/ext/project_data.yaml +0 -24
- data/lib/puppet/file_system.rb +0 -3
- data/lib/puppet/file_system/path_pattern.rb +0 -97
- data/lib/puppet/indirector/certificate/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/errors.rb +0 -5
- data/lib/puppet/indirector/inventory/yaml.rb +0 -81
- data/lib/puppet/indirector/key/disabled_ca.rb +0 -22
- data/lib/puppet/indirector/resource/validator.rb +0 -8
- data/lib/puppet/network/handler.rb +0 -50
- data/lib/puppet/network/handler/ca.rb +0 -61
- data/lib/puppet/network/handler/filebucket.rb +0 -53
- data/lib/puppet/network/handler/fileserver.rb +0 -732
- data/lib/puppet/network/handler/master.rb +0 -87
- data/lib/puppet/network/handler/report.rb +0 -82
- data/lib/puppet/network/handler/runner.rb +0 -33
- data/lib/puppet/network/handler/status.rb +0 -18
- data/lib/puppet/network/http/rack/xmlrpc.rb +0 -65
- data/lib/puppet/network/http_server.rb +0 -3
- data/lib/puppet/network/http_server/mongrel.rb +0 -129
- data/lib/puppet/network/rest_authconfig.rb +0 -102
- data/lib/puppet/network/rest_authorization.rb +0 -23
- data/lib/puppet/network/xmlrpc/processor.rb +0 -86
- data/lib/puppet/network/xmlrpc/server.rb +0 -19
- data/lib/puppet/network/xmlrpc/webrick_servlet.rb +0 -114
- data/lib/puppet/node/inventory.rb +0 -7
- data/lib/puppet/reference/network.rb +0 -39
- data/lib/puppet/transportable.rb +0 -248
- data/lib/puppet/util/autoload/file_cache.rb +0 -92
- data/lib/puppet/util/file_locking.rb +0 -47
- data/lib/puppet/util/settings.rb +0 -926
- data/lib/puppet/util/settings/setting.rb +0 -94
- data/lib/puppet/util/windows/sid.rb +0 -96
- data/lib/puppet/vendor.rb +0 -55
- data/lib/puppet/vendor/load_safe_yaml.rb +0 -1
- data/lib/puppet/vendor/require_vendored.rb +0 -4
- 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/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/man/man8/filebucket.8 +0 -81
- data/man/man8/pi.8 +0 -51
- data/man/man8/puppetca.8 +0 -97
- data/man/man8/puppetd.8 +0 -154
- data/man/man8/puppetdoc.8 +0 -113
- data/man/man8/puppetmasterd.8 +0 -78
- data/man/man8/puppetqd.8 +0 -55
- data/man/man8/puppetrun.8 +0 -127
- data/man/man8/ralsh.8 +0 -84
- data/spec/integration/network/handler_spec.rb +0 -24
- data/spec/integration/network/rest_authconfig_spec.rb +0 -164
- data/spec/integration/util/file_locking_spec.rb +0 -56
- data/spec/unit/agent_backward_compatibility_spec.rb +0 -152
- data/spec/unit/file_system/path_pattern_spec.rb +0 -139
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +0 -194
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +0 -33
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +0 -33
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +0 -33
- data/spec/unit/indirector/inventory/yaml_spec.rb +0 -220
- data/spec/unit/indirector/key/disabled_ca_spec.rb +0 -33
- data/spec/unit/network/handler/ca_spec.rb +0 -87
- data/spec/unit/network/handler/fileserver_spec.rb +0 -201
- data/spec/unit/network/http/mongrel/xmlrpc_spec.rb +0 -0
- data/spec/unit/network/http/rack/xmlrpc_spec.rb +0 -155
- data/spec/unit/network/http/webrick/xmlrpc_spec.rb +0 -0
- data/spec/unit/network/rest_authconfig_spec.rb +0 -142
- data/spec/unit/other/transbucket_spec.rb +0 -184
- data/spec/unit/other/transobject_spec.rb +0 -111
- data/spec/unit/provider/zfs/solaris_spec.rb +0 -99
- data/spec/unit/provider/zpool/solaris_spec.rb +0 -208
- data/spec/unit/transportable_spec.rb +0 -0
- data/spec/unit/util/autoload/file_cache_spec.rb +0 -158
- data/spec/unit/util/file_locking_spec.rb +0 -159
- data/spec/unit/util/settings_spec.rb +0 -1088
- data/spec/unit/util/windows/sid_spec.rb +0 -100
- data/test/README +0 -24
- data/test/Rakefile +0 -96
- data/test/data/failers/badclassnoparam +0 -10
- data/test/data/failers/badclassparam +0 -10
- data/test/data/failers/badcompnoparam +0 -9
- data/test/data/failers/badcompparam +0 -9
- data/test/data/failers/badtypeparam +0 -3
- data/test/data/failers/noobjectrvalue +0 -1
- data/test/data/providers/cron/crontab.allthree +0 -17
- data/test/data/providers/cron/crontab.envNcomment +0 -12
- data/test/data/providers/cron/crontab.envNname +0 -11
- data/test/data/providers/cron/crontab.multirecords +0 -12
- data/test/data/providers/cron/crontab_collections.yaml +0 -44
- data/test/data/providers/cron/crontab_multiple_with_env.yaml +0 -54
- data/test/data/providers/cron/examples/freebsd +0 -2
- data/test/data/providers/cron/examples/one +0 -14
- data/test/data/providers/cron/examples/openbsd +0 -20
- data/test/data/providers/host/parsed/valid_hosts +0 -19
- data/test/data/providers/mailalias/aliases/test1 +0 -28
- data/test/data/providers/mount/parsed/aix.mount +0 -7
- data/test/data/providers/mount/parsed/darwin.mount +0 -6
- data/test/data/providers/mount/parsed/hpux.mount +0 -17
- data/test/data/providers/mount/parsed/linux.mount +0 -5
- data/test/data/providers/mount/parsed/solaris.mount +0 -6
- data/test/data/providers/package/testpackages.yaml +0 -65
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys +0 -7
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys1 +0 -3
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys2 +0 -1
- data/test/data/reports/1.yaml +0 -108
- data/test/data/reports/2.yaml +0 -108
- data/test/data/reports/tagmail_failers.conf +0 -3
- data/test/data/reports/tagmail_passers.conf +0 -30
- data/test/data/snippets/aliastest.pp +0 -16
- data/test/data/snippets/append.pp +0 -11
- data/test/data/snippets/argumentdefaults +0 -14
- data/test/data/snippets/arithmetic_expression.pp +0 -8
- data/test/data/snippets/arraytrailingcomma.pp +0 -3
- data/test/data/snippets/casestatement.pp +0 -65
- data/test/data/snippets/classheirarchy.pp +0 -15
- data/test/data/snippets/classincludes.pp +0 -17
- data/test/data/snippets/classpathtest +0 -11
- data/test/data/snippets/collection.pp +0 -10
- data/test/data/snippets/collection_override.pp +0 -8
- data/test/data/snippets/collection_within_virtual_definitions.pp +0 -20
- data/test/data/snippets/componentmetaparams.pp +0 -11
- data/test/data/snippets/componentrequire.pp +0 -8
- data/test/data/snippets/deepclassheirarchy.pp +0 -23
- data/test/data/snippets/defineoverrides.pp +0 -17
- data/test/data/snippets/emptyclass.pp +0 -9
- data/test/data/snippets/emptyexec.pp +0 -3
- data/test/data/snippets/emptyifelse.pp +0 -9
- data/test/data/snippets/falsevalues.pp +0 -3
- data/test/data/snippets/filecreate +0 -11
- data/test/data/snippets/fqdefinition.pp +0 -5
- data/test/data/snippets/fqparents.pp +0 -11
- data/test/data/snippets/funccomma.pp +0 -5
- data/test/data/snippets/hash.pp +0 -33
- data/test/data/snippets/ifexpression.pp +0 -12
- data/test/data/snippets/implicititeration +0 -15
- data/test/data/snippets/multilinecomments.pp +0 -10
- data/test/data/snippets/multipleclass.pp +0 -9
- data/test/data/snippets/multipleinstances +0 -7
- data/test/data/snippets/multisubs.pp +0 -13
- data/test/data/snippets/namevartest +0 -9
- data/test/data/snippets/scopetest +0 -13
- data/test/data/snippets/selectorvalues.pp +0 -49
- data/test/data/snippets/simpledefaults +0 -5
- data/test/data/snippets/simpleselector +0 -38
- data/test/data/snippets/singleary.pp +0 -19
- data/test/data/snippets/singlequote.pp +0 -11
- data/test/data/snippets/singleselector.pp +0 -22
- data/test/data/snippets/subclass_name_duplication.pp +0 -11
- data/test/data/snippets/tag.pp +0 -9
- data/test/data/snippets/tagged.pp +0 -35
- data/test/data/snippets/virtualresources.pp +0 -14
- data/test/data/types/hosts/1 +0 -3
- data/test/data/types/hosts/2 +0 -13
- data/test/data/types/hosts/solaris +0 -5
- data/test/data/types/mailalias/file1 +0 -183
- data/test/data/types/mount/freebsd.fstab +0 -7
- data/test/data/types/mount/linux.fstab +0 -12
- data/test/data/types/mount/solaris.fstab +0 -12
- data/test/data/types/port/1 +0 -533
- data/test/data/types/port/darwin +0 -11866
- data/test/data/types/ssh_authorized_key/1 +0 -2
- data/test/data/types/yumrepos/fedora-devel.repo +0 -26
- data/test/data/types/yumrepos/fedora.repo +0 -9
- data/test/language/ast.rb +0 -90
- data/test/language/ast/variable.rb +0 -25
- data/test/language/functions.rb +0 -540
- data/test/language/parser.rb +0 -739
- data/test/language/scope.rb +0 -261
- data/test/language/snippets.rb +0 -512
- data/test/language/transportable.rb +0 -87
- data/test/lib/puppettest.rb +0 -307
- data/test/lib/puppettest/certificates.rb +0 -74
- data/test/lib/puppettest/exetest.rb +0 -125
- data/test/lib/puppettest/fakes.rb +0 -199
- data/test/lib/puppettest/fileparsing.rb +0 -28
- data/test/lib/puppettest/filetesting.rb +0 -221
- data/test/lib/puppettest/parsertesting.rb +0 -424
- data/test/lib/puppettest/railstesting.rb +0 -18
- data/test/lib/puppettest/reporttesting.rb +0 -16
- data/test/lib/puppettest/resourcetesting.rb +0 -54
- data/test/lib/puppettest/runnable_test.rb +0 -43
- data/test/lib/puppettest/servertest.rb +0 -77
- data/test/lib/puppettest/support.rb +0 -8
- data/test/lib/puppettest/support/assertions.rb +0 -69
- data/test/lib/puppettest/support/helpers.rb +0 -18
- data/test/lib/puppettest/support/resources.rb +0 -31
- data/test/lib/puppettest/support/utils.rb +0 -141
- data/test/lib/puppettest/testcase.rb +0 -24
- data/test/lib/rake/puppet_test_loader.rb +0 -14
- data/test/lib/rake/puppet_testtask.rb +0 -19
- data/test/lib/stubba.rb +0 -2
- data/test/network/authconfig.rb +0 -69
- data/test/network/authorization.rb +0 -138
- data/test/network/authstore.rb +0 -538
- data/test/network/client_request.rb +0 -38
- data/test/network/handler/fileserver.rb +0 -1266
- data/test/network/handler/master.rb +0 -93
- data/test/network/handler/report.rb +0 -47
- data/test/network/handler/runner.rb +0 -20
- data/test/network/rights.rb +0 -40
- data/test/network/xmlrpc/processor.rb +0 -79
- data/test/network/xmlrpc/server.rb +0 -26
- data/test/network/xmlrpc/webrick_servlet.rb +0 -35
- data/test/other/provider.rb +0 -90
- data/test/other/puppet.rb +0 -85
- data/test/other/relationships.rb +0 -91
- data/test/other/report.rb +0 -135
- data/test/other/transactions.rb +0 -395
- data/test/puppet/defaults.rb +0 -65
- data/test/rails/rails.rb +0 -24
- data/test/rails/railsparameter.rb +0 -80
- data/test/ral/manager/attributes.rb +0 -296
- data/test/ral/manager/instances.rb +0 -88
- data/test/ral/manager/manager.rb +0 -50
- data/test/ral/manager/provider.rb +0 -84
- data/test/ral/manager/type.rb +0 -361
- data/test/ral/providers/cron/crontab.rb +0 -652
- data/test/ral/providers/group.rb +0 -242
- data/test/ral/providers/host/parsed.rb +0 -32
- data/test/ral/providers/mailalias/aliases.rb +0 -55
- data/test/ral/providers/nameservice.rb +0 -32
- data/test/ral/providers/package.rb +0 -245
- data/test/ral/providers/package/aptitude.rb +0 -83
- data/test/ral/providers/package/aptrpm.rb +0 -100
- data/test/ral/providers/parsedfile.rb +0 -695
- data/test/ral/providers/port/parsed.rb +0 -232
- data/test/ral/providers/provider.rb +0 -529
- data/test/ral/providers/service/base.rb +0 -76
- data/test/ral/providers/sshkey/parsed.rb +0 -112
- data/test/ral/providers/user.rb +0 -586
- data/test/ral/providers/user/useradd.rb +0 -233
- data/test/ral/type/cron.rb +0 -505
- data/test/ral/type/exec.rb +0 -717
- data/test/ral/type/file.rb +0 -912
- data/test/ral/type/file/target.rb +0 -346
- data/test/ral/type/fileignoresource.rb +0 -265
- data/test/ral/type/filesources.rb +0 -446
- data/test/ral/type/host.rb +0 -180
- data/test/ral/type/mailalias.rb +0 -45
- data/test/ral/type/port.rb +0 -147
- data/test/ral/type/resources.rb +0 -104
- data/test/ral/type/service.rb +0 -38
- data/test/ral/type/sshkey.rb +0 -148
- data/test/ral/type/user.rb +0 -167
- data/test/ral/type/yumrepo.rb +0 -116
- data/test/ral/type/zone.rb +0 -447
- data/test/test +0 -241
- data/test/util/classgen.rb +0 -241
- data/test/util/execution.rb +0 -33
- data/test/util/fileparsing.rb +0 -721
- data/test/util/inifile.rb +0 -138
- data/test/util/instance_loader.rb +0 -52
- data/test/util/log.rb +0 -219
- data/test/util/metrics.rb +0 -72
- data/test/util/package.rb +0 -25
- data/test/util/pidlock.rb +0 -125
- data/test/util/settings.rb +0 -773
- data/test/util/storage.rb +0 -81
- data/test/util/subclass_loader.rb +0 -89
- data/test/util/utiltest.rb +0 -223
@@ -80,7 +80,7 @@ Puppet::Type.newtype(:scheduled_task) do
|
|
80
80
|
end
|
81
81
|
|
82
82
|
newproperty(:trigger, :array_matching => :all) do
|
83
|
-
desc <<-
|
83
|
+
desc <<-EOT
|
84
84
|
One or more triggers defining when the task should run. A single trigger is
|
85
85
|
represented as a hash, and multiple triggers can be specified with an array of
|
86
86
|
hashes.
|
data/lib/puppet/type/service.rb
CHANGED
@@ -198,9 +198,8 @@ module Puppet
|
|
198
198
|
newparam :hasrestart do
|
199
199
|
desc "Specify that an init script has a `restart` command. If this is
|
200
200
|
false and you do not specify a command in the `restart` attribute,
|
201
|
-
the init script's `stop` and `start` commands will be used.
|
202
|
-
|
203
|
-
Defaults to false."
|
201
|
+
the init script's `stop` and `start` commands will be used. Defaults
|
202
|
+
to true; note that this is a change from earlier versions of Puppet."
|
204
203
|
newvalues(:true, :false)
|
205
204
|
end
|
206
205
|
|
data/lib/puppet/type/tidy.rb
CHANGED
@@ -43,7 +43,7 @@ Puppet::Type.newtype(:tidy) do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
newparam(:matches) do
|
46
|
-
desc <<-
|
46
|
+
desc <<-EOT
|
47
47
|
One or more (shell type) file glob patterns, which restrict
|
48
48
|
the list of files to be tidied to those whose basenames match
|
49
49
|
at least one of the patterns specified. Multiple patterns can
|
@@ -101,17 +101,16 @@ Puppet::Type.newtype(:tidy) do
|
|
101
101
|
|
102
102
|
Specifying 0 will remove all files."
|
103
103
|
|
104
|
-
|
104
|
+
AgeConvertors = {
|
105
105
|
:s => 1,
|
106
|
-
:m => 60
|
106
|
+
:m => 60,
|
107
|
+
:h => 60 * 60,
|
108
|
+
:d => 60 * 60 * 24,
|
109
|
+
:w => 60 * 60 * 24 * 7,
|
107
110
|
}
|
108
111
|
|
109
|
-
@@ageconvertors[:h] = @@ageconvertors[:m] * 60
|
110
|
-
@@ageconvertors[:d] = @@ageconvertors[:h] * 24
|
111
|
-
@@ageconvertors[:w] = @@ageconvertors[:d] * 7
|
112
|
-
|
113
112
|
def convert(unit, multi)
|
114
|
-
if num =
|
113
|
+
if num = AgeConvertors[unit]
|
115
114
|
return num * multi
|
116
115
|
else
|
117
116
|
self.fail "Invalid age unit '#{unit}'"
|
@@ -148,16 +147,8 @@ Puppet::Type.newtype(:tidy) do
|
|
148
147
|
Only the first character is significant, so the full word can also
|
149
148
|
be used."
|
150
149
|
|
151
|
-
@@sizeconvertors = {
|
152
|
-
:b => 0,
|
153
|
-
:k => 1,
|
154
|
-
:m => 2,
|
155
|
-
:g => 3,
|
156
|
-
:t => 4
|
157
|
-
}
|
158
|
-
|
159
150
|
def convert(unit, multi)
|
160
|
-
if num =
|
151
|
+
if num = { :b => 0, :k => 1, :m => 2, :g => 3, :t => 4 }[unit]
|
161
152
|
result = multi
|
162
153
|
num.times do result *= 1024 end
|
163
154
|
return result
|
data/lib/puppet/type/yumrepo.rb
CHANGED
@@ -112,11 +112,11 @@ module Puppet
|
|
112
112
|
reposdir.gsub!(/[\n,]/, " ")
|
113
113
|
reposdir.split.each do |dir|
|
114
114
|
Dir::glob("#{dir}/*.repo").each do |file|
|
115
|
-
@inifile.read(file) if File.file?(file)
|
115
|
+
@inifile.read(file) if ::File.file?(file)
|
116
116
|
end
|
117
117
|
end
|
118
118
|
reposdir.split.each do |dir|
|
119
|
-
if File
|
119
|
+
if ::File.directory?(dir) && ::File.writable?(dir)
|
120
120
|
@defaultrepodir = dir
|
121
121
|
break
|
122
122
|
end
|
@@ -138,12 +138,12 @@ module Puppet
|
|
138
138
|
reposdir.gsub!(/[\n,]/, " ")
|
139
139
|
reposdir.split.each do |dir|
|
140
140
|
Dir::glob("#{dir}/*.repo").each do |file|
|
141
|
-
result.read(file) if File.file?(file)
|
141
|
+
result.read(file) if ::File.file?(file)
|
142
142
|
end
|
143
143
|
end
|
144
144
|
if @defaultrepodir.nil?
|
145
145
|
reposdir.split.each do |dir|
|
146
|
-
if File
|
146
|
+
if ::File.directory?(dir) && ::File.writable?(dir)
|
147
147
|
@defaultrepodir = dir
|
148
148
|
break
|
149
149
|
end
|
@@ -159,7 +159,7 @@ module Puppet
|
|
159
159
|
if result.nil?
|
160
160
|
# Brand new section
|
161
161
|
path = yumconf
|
162
|
-
path = File
|
162
|
+
path = ::File.join(@defaultrepodir, "#{name}.repo") unless @defaultrepodir.nil?
|
163
163
|
Puppet::info "create new repo #{name} in file #{path}"
|
164
164
|
result = inifile.add_section(name, path)
|
165
165
|
end
|
@@ -172,10 +172,10 @@ module Puppet
|
|
172
172
|
unless Puppet[:noop]
|
173
173
|
target_mode = 0644 # FIXME: should be configurable
|
174
174
|
inifile.each_file do |file|
|
175
|
-
current_mode = File.stat(file).mode & 0777
|
175
|
+
current_mode = ::File.stat(file).mode & 0777
|
176
176
|
unless current_mode == target_mode
|
177
177
|
Puppet::info "changing mode of #{file} from %03o to %03o" % [current_mode, target_mode]
|
178
|
-
File.chmod(target_mode, file)
|
178
|
+
::File.chmod(target_mode, file)
|
179
179
|
end
|
180
180
|
end
|
181
181
|
end
|
@@ -357,5 +357,33 @@ module Puppet
|
|
357
357
|
newvalue(:absent) { self.should = :absent }
|
358
358
|
newvalue(/.*/) { }
|
359
359
|
end
|
360
|
+
|
361
|
+
newproperty(:sslcacert, :parent => Puppet::IniProperty) do
|
362
|
+
desc "Path to the directory containing the databases of the
|
363
|
+
certificate authorities yum should use to verify SSL certificates.\n#{ABSENT_DOC}"
|
364
|
+
newvalue(:absent) { self.should = :absent }
|
365
|
+
newvalue(/.*/) { }
|
366
|
+
end
|
367
|
+
|
368
|
+
newproperty(:sslverify, :parent => Puppet::IniProperty) do
|
369
|
+
desc "Should yum verify SSL certificates/hosts at all.
|
370
|
+
Possible values are 'True' or 'False'.\n#{ABSENT_DOC}"
|
371
|
+
newvalue(:absent) { self.should = :absent }
|
372
|
+
newvalue(%r(True|False)) { }
|
373
|
+
end
|
374
|
+
|
375
|
+
newproperty(:sslclientcert, :parent => Puppet::IniProperty) do
|
376
|
+
desc "Path to the SSL client certificate yum should use to connect
|
377
|
+
to repos/remote sites.\n#{ABSENT_DOC}"
|
378
|
+
newvalue(:absent) { self.should = :absent }
|
379
|
+
newvalue(/.*/) { }
|
380
|
+
end
|
381
|
+
|
382
|
+
newproperty(:sslclientkey, :parent => Puppet::IniProperty) do
|
383
|
+
desc "Path to the SSL client key yum should use to connect
|
384
|
+
to repos/remote sites.\n#{ABSENT_DOC}"
|
385
|
+
newvalue(:absent) { self.should = :absent }
|
386
|
+
newvalue(/.*/) { }
|
387
|
+
end
|
360
388
|
end
|
361
389
|
end
|
data/lib/puppet/type/zfs.rb
CHANGED
@@ -40,6 +40,10 @@ parent zfs instances, the zfs resource will autorequire them."
|
|
40
40
|
desc "The copies property. Valid values are `1`, `2`, `3`."
|
41
41
|
end
|
42
42
|
|
43
|
+
newproperty(:dedup) do
|
44
|
+
desc "The dedup property. Valid values are `on`, `off`."
|
45
|
+
end
|
46
|
+
|
43
47
|
newproperty(:devices) do
|
44
48
|
desc "The devices property. Valid values are `on`, `off`."
|
45
49
|
end
|
data/lib/puppet/type/zone.rb
CHANGED
@@ -98,11 +98,7 @@ autorequire that directory."
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def self.state_name(name)
|
101
|
-
|
102
|
-
other
|
103
|
-
else
|
104
|
-
name
|
105
|
-
end
|
101
|
+
@state_aliases[name.to_sym] || name.to_sym
|
106
102
|
end
|
107
103
|
|
108
104
|
newvalue :absent, :down => :destroy
|
@@ -184,6 +180,15 @@ autorequire that directory."
|
|
184
180
|
current_value = self.retrieve
|
185
181
|
self.class.state_index(current_value) < self.class.state_index(self.should)
|
186
182
|
end
|
183
|
+
|
184
|
+
# We override the newvalue in the parent class. Thus the values that we get from the
|
185
|
+
# manifest are stored as they are and later compared to the current state of the instance,
|
186
|
+
# which is in symbol form. Hence we have to convert this to symbol here for now.
|
187
|
+
# TODO: fix this so that munging is no longer necessary. see also #15886
|
188
|
+
|
189
|
+
munge do |value|
|
190
|
+
value.intern
|
191
|
+
end
|
187
192
|
end
|
188
193
|
|
189
194
|
newparam(:name) do
|
@@ -270,6 +275,29 @@ autorequire that directory."
|
|
270
275
|
end
|
271
276
|
end
|
272
277
|
|
278
|
+
newproperty(:path, :parent => ZoneConfigProperty) do
|
279
|
+
desc "The root of the zone's filesystem. Must be a fully qualified
|
280
|
+
file name. If you include `%s` in the path, then it will be
|
281
|
+
replaced with the zone's name. Currently, you cannot use
|
282
|
+
Puppet to move a zone. Consequently this is a readonly property."
|
283
|
+
|
284
|
+
def configtext
|
285
|
+
"set zonepath=#{self.should}"
|
286
|
+
end
|
287
|
+
|
288
|
+
validate do |value|
|
289
|
+
raise ArgumentError, "The zone base must be fully qualified" unless value =~ /^\//
|
290
|
+
end
|
291
|
+
|
292
|
+
munge do |value|
|
293
|
+
if value =~ /%s/
|
294
|
+
value % @resource[:name]
|
295
|
+
else
|
296
|
+
value
|
297
|
+
end
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
273
301
|
newproperty(:pool, :parent => ZoneConfigProperty) do
|
274
302
|
desc "The resource pool for this zone."
|
275
303
|
|
@@ -374,27 +402,6 @@ autorequire that directory."
|
|
374
402
|
so Puppet only checks for it at that time.}
|
375
403
|
end
|
376
404
|
|
377
|
-
newparam(:path) do
|
378
|
-
desc "The root of the zone's filesystem. Must be a fully qualified
|
379
|
-
file name. If you include `%s` in the path, then it will be
|
380
|
-
replaced with the zone's name. Currently, you cannot use
|
381
|
-
Puppet to move a zone."
|
382
|
-
|
383
|
-
validate do |value|
|
384
|
-
unless value =~ /^\//
|
385
|
-
raise ArgumentError, "The zone base must be fully qualified"
|
386
|
-
end
|
387
|
-
end
|
388
|
-
|
389
|
-
munge do |value|
|
390
|
-
if value =~ /%s/
|
391
|
-
value % @resource[:name]
|
392
|
-
else
|
393
|
-
value
|
394
|
-
end
|
395
|
-
end
|
396
|
-
end
|
397
|
-
|
398
405
|
newparam(:create_args) do
|
399
406
|
desc "Arguments to the `zonecfg` create command. This can be used to create branded zones."
|
400
407
|
end
|
@@ -440,22 +447,25 @@ autorequire that directory."
|
|
440
447
|
self.fail "'#{ip}' is an invalid #{name}"
|
441
448
|
end
|
442
449
|
|
450
|
+
def validate_exclusive(interface, address, router)
|
451
|
+
return if !interface.nil? and address.nil?
|
452
|
+
self.fail "only interface may be specified when using exclusive IP stack: #{interface}:#{address}"
|
453
|
+
end
|
454
|
+
def validate_shared(interface, address, router)
|
455
|
+
self.fail "ip must contain interface name and ip address separated by a \":\"" if interface.nil? or address.nil?
|
456
|
+
[address, router].each do |ip|
|
457
|
+
validate_ip(address, "IP address") unless ip.nil?
|
458
|
+
end
|
459
|
+
end
|
460
|
+
|
443
461
|
validate do
|
444
|
-
|
445
|
-
interface, address,
|
462
|
+
return unless self[:ip]
|
463
|
+
interface, address, router = self[:ip].split(':')
|
446
464
|
if self[:iptype] == :shared
|
447
|
-
|
448
|
-
(interface && address && defrouter)
|
449
|
-
validate_ip(address, "IP address")
|
450
|
-
validate_ip(defrouter, "default router")
|
451
|
-
else
|
452
|
-
self.fail "ip must contain interface name and ip address separated by a \":\""
|
453
|
-
end
|
465
|
+
validate_shared(interface, address, router)
|
454
466
|
else
|
455
|
-
|
467
|
+
validate_exclusive(interface, address, router)
|
456
468
|
end
|
457
|
-
|
458
|
-
self.fail "zone path is required" unless self[:path]
|
459
469
|
end
|
460
470
|
|
461
471
|
def retrieve
|
data/lib/puppet/util.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# A module to collect utility functions.
|
2
2
|
|
3
3
|
require 'English'
|
4
|
-
require 'puppet/util/monkey_patches'
|
5
4
|
require 'puppet/external/lock'
|
5
|
+
require 'puppet/error'
|
6
6
|
require 'puppet/util/execution_stub'
|
7
7
|
require 'uri'
|
8
8
|
require 'sync'
|
@@ -13,11 +13,8 @@ require 'ostruct'
|
|
13
13
|
require 'puppet/util/platform'
|
14
14
|
|
15
15
|
module Puppet
|
16
|
-
# A command failed to execute.
|
17
|
-
require 'puppet/error'
|
18
|
-
class ExecutionFailure < Puppet::Error
|
19
|
-
end
|
20
16
|
module Util
|
17
|
+
require 'puppet/util/monkey_patches'
|
21
18
|
require 'benchmark'
|
22
19
|
|
23
20
|
# These are all for backward compatibility -- these are methods that used
|
@@ -27,6 +24,7 @@ module Util
|
|
27
24
|
|
28
25
|
@@sync_objects = {}.extend MonitorMixin
|
29
26
|
|
27
|
+
|
30
28
|
def self.activerecord_version
|
31
29
|
if (defined?(::ActiveRecord) and defined?(::ActiveRecord::VERSION) and defined?(::ActiveRecord::VERSION::MAJOR) and defined?(::ActiveRecord::VERSION::MINOR))
|
32
30
|
([::ActiveRecord::VERSION::MAJOR, ::ActiveRecord::VERSION::MINOR].join('.').to_f)
|
@@ -35,6 +33,36 @@ module Util
|
|
35
33
|
end
|
36
34
|
end
|
37
35
|
|
36
|
+
|
37
|
+
# Run some code with a specific environment. Resets the environment back to
|
38
|
+
# what it was at the end of the code.
|
39
|
+
def self.withenv(hash)
|
40
|
+
saved = ENV.to_hash
|
41
|
+
hash.each do |name, val|
|
42
|
+
ENV[name.to_s] = val
|
43
|
+
end
|
44
|
+
|
45
|
+
yield
|
46
|
+
ensure
|
47
|
+
ENV.clear
|
48
|
+
saved.each do |name, val|
|
49
|
+
ENV[name] = val
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
|
54
|
+
# Execute a given chunk of code with a new umask.
|
55
|
+
def self.withumask(mask)
|
56
|
+
cur = File.umask(mask)
|
57
|
+
|
58
|
+
begin
|
59
|
+
yield
|
60
|
+
ensure
|
61
|
+
File.umask(cur)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
|
38
66
|
def self.synchronize_on(x,type)
|
39
67
|
sync_object,users = 0,1
|
40
68
|
begin
|
@@ -122,16 +150,6 @@ module Util
|
|
122
150
|
end
|
123
151
|
end
|
124
152
|
|
125
|
-
# Execute a given chunk of code with a new umask.
|
126
|
-
def self.withumask(mask)
|
127
|
-
cur = File.umask(mask)
|
128
|
-
|
129
|
-
begin
|
130
|
-
yield
|
131
|
-
ensure
|
132
|
-
File.umask(cur)
|
133
|
-
end
|
134
|
-
end
|
135
153
|
|
136
154
|
def benchmark(*args)
|
137
155
|
msg = args.pop
|
@@ -174,6 +192,21 @@ module Util
|
|
174
192
|
ENV['PATH'].split(File::PATH_SEPARATOR).each do |dir|
|
175
193
|
begin
|
176
194
|
dest = File.expand_path(File.join(dir, bin))
|
195
|
+
rescue ArgumentError => e
|
196
|
+
# if the user's PATH contains a literal tilde (~) character and HOME is not set, we may get
|
197
|
+
# an ArgumentError here. Let's check to see if that is the case; if not, re-raise whatever error
|
198
|
+
# was thrown.
|
199
|
+
if e.to_s =~ /HOME/ and (ENV['HOME'].nil? || ENV['HOME'] == "")
|
200
|
+
# if we get here they have a tilde in their PATH. We'll issue a single warning about this and then
|
201
|
+
# ignore this path element and carry on with our lives.
|
202
|
+
Puppet::Util::Warnings.warnonce("PATH contains a ~ character, and HOME is not set; ignoring PATH element '#{dir}'.")
|
203
|
+
elsif e.to_s =~ /doesn't exist|can't find user/
|
204
|
+
# ...otherwise, we just skip the non-existent entry, and do nothing.
|
205
|
+
Puppet::Util::Warnings.warnonce("Couldn't expand PATH containing a ~ character; ignoring PATH element '#{dir}'.")
|
206
|
+
else
|
207
|
+
raise
|
208
|
+
end
|
209
|
+
else
|
177
210
|
if Puppet.features.microsoft_windows? && File.extname(dest).empty?
|
178
211
|
exts = ENV['PATHEXT']
|
179
212
|
exts = exts ? exts.split(File::PATH_SEPARATOR) : %w[.COM .EXE .BAT .CMD]
|
@@ -183,9 +216,6 @@ module Util
|
|
183
216
|
end
|
184
217
|
end
|
185
218
|
return dest if FileTest.file? dest and FileTest.executable? dest
|
186
|
-
rescue ArgumentError => e
|
187
|
-
raise unless e.to_s =~ /doesn't exist|can't find user/
|
188
|
-
# ...otherwise, we just skip the non-existent entry, and do nothing.
|
189
219
|
end
|
190
220
|
end
|
191
221
|
end
|
@@ -202,17 +232,9 @@ module Util
|
|
202
232
|
AbsolutePathWindows = %r!^(?:(?:[A-Z]:#{slash})|(?:#{slash}#{slash}#{label}#{slash}#{label})|(?:#{slash}#{slash}\?#{slash}#{label}))!io
|
203
233
|
AbsolutePathPosix = %r!^/!
|
204
234
|
def absolute_path?(path, platform=nil)
|
205
|
-
#
|
206
|
-
#
|
207
|
-
|
208
|
-
# subcommand or if none was specified, then the CommandLine will call the
|
209
|
-
# `which` method to resolve the external executable, and that requires features.
|
210
|
-
# Rather then moving this require to handle the external subcommand case, or
|
211
|
-
# no subcommand case, I'm undoing the performance change from 20efe94. This
|
212
|
-
# code has been eliminated in 3.x since puppet can be required before loading
|
213
|
-
# the application (since the default vardir/confdir locations are solely
|
214
|
-
# based on user vs. system user, and not the application's run_mode).
|
215
|
-
require 'puppet'
|
235
|
+
# Due to weird load order issues, I was unable to remove this require.
|
236
|
+
# This is fixed in Telly so it can be removed there.
|
237
|
+
require 'puppet' unless defined?(Puppet)
|
216
238
|
|
217
239
|
# Ruby only sets File::ALT_SEPARATOR on Windows and the Ruby standard
|
218
240
|
# library uses that to test what platform it's on. Normally in Puppet we
|
@@ -278,72 +300,6 @@ module Util
|
|
278
300
|
end
|
279
301
|
module_function :uri_to_path
|
280
302
|
|
281
|
-
# Execute the provided command with STDIN connected to a pipe, yielding the
|
282
|
-
# pipe object. That allows data to be fed to that subprocess.
|
283
|
-
#
|
284
|
-
# The command can be a simple string, which is executed as-is, or an Array,
|
285
|
-
# which is treated as a set of command arguments to pass through.#
|
286
|
-
#
|
287
|
-
# In all cases this is passed directly to the shell, and STDOUT and STDERR
|
288
|
-
# are connected together during execution.
|
289
|
-
def execpipe(command, failonfail = true)
|
290
|
-
if respond_to? :debug
|
291
|
-
debug "Executing '#{command}'"
|
292
|
-
else
|
293
|
-
Puppet.debug "Executing '#{command}'"
|
294
|
-
end
|
295
|
-
|
296
|
-
# Paste together an array with spaces. We used to paste directly
|
297
|
-
# together, no spaces, which made for odd invocations; the user had to
|
298
|
-
# include whitespace between arguments.
|
299
|
-
#
|
300
|
-
# Having two spaces is really not a big drama, since this passes to the
|
301
|
-
# shell anyhow, while no spaces makes for a small developer cost every
|
302
|
-
# time this is invoked. --daniel 2012-02-13
|
303
|
-
command_str = command.respond_to?(:join) ? command.join(' ') : command
|
304
|
-
output = open("| #{command_str} 2>&1") do |pipe|
|
305
|
-
yield pipe
|
306
|
-
end
|
307
|
-
|
308
|
-
if failonfail
|
309
|
-
unless $CHILD_STATUS == 0
|
310
|
-
raise ExecutionFailure, output
|
311
|
-
end
|
312
|
-
end
|
313
|
-
|
314
|
-
output
|
315
|
-
end
|
316
|
-
|
317
|
-
def execfail(command, exception)
|
318
|
-
output = execute(command)
|
319
|
-
return output
|
320
|
-
rescue ExecutionFailure
|
321
|
-
raise exception, output
|
322
|
-
end
|
323
|
-
|
324
|
-
def execute_posix(command, arguments, stdin, stdout, stderr)
|
325
|
-
child_pid = safe_posix_fork(stdin, stdout, stderr) do
|
326
|
-
# We can't just call Array(command), and rely on it returning
|
327
|
-
# things like ['foo'], when passed ['foo'], because
|
328
|
-
# Array(command) will call command.to_a internally, which when
|
329
|
-
# given a string can end up doing Very Bad Things(TM), such as
|
330
|
-
# turning "/tmp/foo;\r\n /bin/echo" into ["/tmp/foo;\r\n", " /bin/echo"]
|
331
|
-
command = [command].flatten
|
332
|
-
Process.setsid
|
333
|
-
begin
|
334
|
-
Puppet::Util::SUIDManager.change_privileges(arguments[:uid], arguments[:gid], true)
|
335
|
-
|
336
|
-
ENV['LANG'] = ENV['LC_ALL'] = ENV['LC_MESSAGES'] = ENV['LANGUAGE'] = 'C'
|
337
|
-
Kernel.exec(*command)
|
338
|
-
rescue => detail
|
339
|
-
puts detail.to_s
|
340
|
-
exit!(1)
|
341
|
-
end
|
342
|
-
end
|
343
|
-
child_pid
|
344
|
-
end
|
345
|
-
module_function :execute_posix
|
346
|
-
|
347
303
|
def safe_posix_fork(stdin=$stdin, stdout=$stdout, stderr=$stderr, &block)
|
348
304
|
child_pid = Kernel.fork do
|
349
305
|
$stdin.reopen(stdin)
|
@@ -358,105 +314,11 @@ module Util
|
|
358
314
|
end
|
359
315
|
module_function :safe_posix_fork
|
360
316
|
|
361
|
-
def execute_windows(command, arguments, stdin, stdout, stderr)
|
362
|
-
command = command.map do |part|
|
363
|
-
part.include?(' ') ? %Q["#{part.gsub(/"/, '\"')}"] : part
|
364
|
-
end.join(" ") if command.is_a?(Array)
|
365
|
-
|
366
|
-
Puppet::Util::Windows::Process.execute(command, arguments, stdin, stdout, stderr)
|
367
|
-
end
|
368
|
-
module_function :execute_windows
|
369
|
-
|
370
|
-
# Execute the desired command, and return the status and output.
|
371
|
-
# def execute(command, failonfail = true, uid = nil, gid = nil)
|
372
|
-
# :combine sets whether or not to combine stdout/stderr in the output
|
373
|
-
# :stdinfile sets a file that can be used for stdin. Passing a string
|
374
|
-
# for stdin is not currently supported.
|
375
|
-
def execute(command, arguments = {:failonfail => true, :combine => true})
|
376
|
-
if command.is_a?(Array)
|
377
|
-
command = command.flatten.map(&:to_s)
|
378
|
-
str = command.join(" ")
|
379
|
-
elsif command.is_a?(String)
|
380
|
-
str = command
|
381
|
-
end
|
382
|
-
|
383
|
-
if respond_to? :debug
|
384
|
-
debug "Executing '#{str}'"
|
385
|
-
else
|
386
|
-
Puppet.debug "Executing '#{str}'"
|
387
|
-
end
|
388
|
-
|
389
|
-
null_file = Puppet.features.microsoft_windows? ? 'NUL' : '/dev/null'
|
390
|
-
|
391
|
-
stdin = File.open(arguments[:stdinfile] || null_file, 'r')
|
392
|
-
stdout = arguments[:squelch] ? File.open(null_file, 'w') : Tempfile.new('puppet')
|
393
|
-
stderr = arguments[:combine] ? stdout : File.open(null_file, 'w')
|
394
|
-
|
395
|
-
exec_args = [command, arguments, stdin, stdout, stderr]
|
396
|
-
|
397
|
-
if execution_stub = Puppet::Util::ExecutionStub.current_value
|
398
|
-
return execution_stub.call(*exec_args)
|
399
|
-
elsif Puppet.features.posix?
|
400
|
-
child_pid = execute_posix(*exec_args)
|
401
|
-
exit_status = Process.waitpid2(child_pid).last.exitstatus
|
402
|
-
elsif Puppet.features.microsoft_windows?
|
403
|
-
process_info = execute_windows(*exec_args)
|
404
|
-
begin
|
405
|
-
exit_status = Puppet::Util::Windows::Process.wait_process(process_info.process_handle)
|
406
|
-
ensure
|
407
|
-
Process.CloseHandle(process_info.process_handle)
|
408
|
-
Process.CloseHandle(process_info.thread_handle)
|
409
|
-
end
|
410
|
-
end
|
411
|
-
|
412
|
-
[stdin, stdout, stderr].each {|io| io.close rescue nil}
|
413
|
-
|
414
|
-
# read output in if required
|
415
|
-
unless arguments[:squelch]
|
416
|
-
output = wait_for_output(stdout)
|
417
|
-
Puppet.warning "Could not get output" unless output
|
418
|
-
end
|
419
|
-
|
420
|
-
if arguments[:failonfail] and exit_status != 0
|
421
|
-
raise ExecutionFailure, "Execution of '#{str}' returned #{exit_status}: #{output}"
|
422
|
-
end
|
423
|
-
|
424
|
-
output
|
425
|
-
end
|
426
|
-
|
427
|
-
module_function :execute
|
428
|
-
|
429
|
-
def wait_for_output(stdout)
|
430
|
-
# Make sure the file's actually been written. This is basically a race
|
431
|
-
# condition, and is probably a horrible way to handle it, but, well, oh
|
432
|
-
# well.
|
433
|
-
2.times do |try|
|
434
|
-
if File.exists?(stdout.path)
|
435
|
-
stdout.open
|
436
|
-
begin
|
437
|
-
return stdout.read
|
438
|
-
ensure
|
439
|
-
stdout.close
|
440
|
-
stdout.unlink
|
441
|
-
end
|
442
|
-
else
|
443
|
-
time_to_sleep = try / 2.0
|
444
|
-
Puppet.warning "Waiting for output; will sleep #{time_to_sleep} seconds"
|
445
|
-
sleep(time_to_sleep)
|
446
|
-
end
|
447
|
-
end
|
448
|
-
nil
|
449
|
-
end
|
450
|
-
module_function :wait_for_output
|
451
|
-
|
452
317
|
# Create an exclusive lock.
|
453
318
|
def threadlock(resource, type = Sync::EX)
|
454
319
|
Puppet::Util.synchronize_on(resource,type) { yield }
|
455
320
|
end
|
456
321
|
|
457
|
-
# Because some modules provide their own version of this method.
|
458
|
-
alias util_execute execute
|
459
|
-
|
460
322
|
module_function :benchmark
|
461
323
|
|
462
324
|
def memory
|
@@ -470,38 +332,15 @@ module Util
|
|
470
332
|
end
|
471
333
|
end
|
472
334
|
|
473
|
-
def symbolize(value)
|
474
|
-
Puppet.deprecation_warning "symbolize is deprecated. Call the intern method on the object instead."
|
475
|
-
if value.respond_to? :intern
|
476
|
-
value.intern
|
477
|
-
else
|
478
|
-
value
|
479
|
-
end
|
480
|
-
end
|
481
|
-
|
482
335
|
def symbolizehash(hash)
|
483
336
|
newhash = {}
|
484
337
|
hash.each do |name, val|
|
485
|
-
if name.
|
486
|
-
|
487
|
-
else
|
488
|
-
newhash[name] = val
|
489
|
-
end
|
338
|
+
name = name.intern if name.respond_to? :intern
|
339
|
+
newhash[name] = val
|
490
340
|
end
|
491
341
|
newhash
|
492
342
|
end
|
493
|
-
|
494
|
-
def symbolizehash!(hash)
|
495
|
-
Puppet.deprecation_warning "symbolizehash! is deprecated. Use the non-destructive symbolizehash method instead."
|
496
|
-
# this is not the most memory-friendly way to accomplish this, but the
|
497
|
-
# code re-use and clarity seems worthwhile.
|
498
|
-
newhash = symbolizehash(hash)
|
499
|
-
hash.clear
|
500
|
-
hash.merge!(newhash)
|
501
|
-
|
502
|
-
hash
|
503
|
-
end
|
504
|
-
module_function :symbolize, :symbolizehash, :symbolizehash!
|
343
|
+
module_function :symbolizehash
|
505
344
|
|
506
345
|
# Just benchmark, with no logging.
|
507
346
|
def thinmark
|
@@ -520,6 +359,36 @@ module Util
|
|
520
359
|
end
|
521
360
|
module_function :binread
|
522
361
|
|
362
|
+
# utility method to get the current call stack and format it to a human-readable string (which some IDEs/editors
|
363
|
+
# will recognize as links to the line numbers in the trace)
|
364
|
+
def self.pretty_backtrace(backtrace = caller(1))
|
365
|
+
backtrace.collect do |line|
|
366
|
+
file_path, line_num = line.split(":")
|
367
|
+
file_path = expand_symlinks(File.expand_path(file_path))
|
368
|
+
|
369
|
+
file_path + ":" + line_num
|
370
|
+
end .join("\n")
|
371
|
+
|
372
|
+
end
|
373
|
+
|
374
|
+
# utility method that takes a path as input, checks each component of the path to see if it is a symlink, and expands
|
375
|
+
# it if it is. returns the expanded path.
|
376
|
+
def self.expand_symlinks(file_path)
|
377
|
+
file_path.split("/").inject do |full_path, next_dir|
|
378
|
+
next_path = full_path + "/" + next_dir
|
379
|
+
if File.symlink?(next_path) then
|
380
|
+
link = File.readlink(next_path)
|
381
|
+
next_path =
|
382
|
+
case link
|
383
|
+
when /^\// then link
|
384
|
+
else
|
385
|
+
File.expand_path(full_path + "/" + link)
|
386
|
+
end
|
387
|
+
end
|
388
|
+
next_path
|
389
|
+
end
|
390
|
+
end
|
391
|
+
|
523
392
|
# Replace a file, securely. This takes a block, and passes it the file
|
524
393
|
# handle of a file open for writing. Write the replacement content inside
|
525
394
|
# the block and it will safely replace the target file.
|
@@ -538,21 +407,9 @@ module Util
|
|
538
407
|
# The default_mode is the mode to use when the target file doesn't already
|
539
408
|
# exist; if the file is present we copy the existing mode/owner/group values
|
540
409
|
# across.
|
541
|
-
|
542
|
-
DEFAULT_POSIX_MODE = 0644
|
543
|
-
DEFAULT_WINDOWS_MODE = nil
|
544
|
-
|
545
410
|
def replace_file(file, default_mode, &block)
|
546
411
|
raise Puppet::DevError, "replace_file requires a block" unless block_given?
|
547
412
|
|
548
|
-
unless default_mode
|
549
|
-
if Puppet.features.microsoft_windows?
|
550
|
-
default_mode = DEFAULT_WINDOWS_MODE
|
551
|
-
else
|
552
|
-
default_mode = DEFAULT_POSIX_MODE
|
553
|
-
end
|
554
|
-
end
|
555
|
-
|
556
413
|
file = Pathname(file)
|
557
414
|
tempfile = Tempfile.new(file.basename.to_s, file.dirname.to_s)
|
558
415
|
|
@@ -566,21 +423,16 @@ module Util
|
|
566
423
|
# and specifically handle the platform, which has all sorts of magic.
|
567
424
|
# So, unlike Unix, we don't pre-prep security; we use the default "quite
|
568
425
|
# secure" tempfile permissions instead. Magic happens later.
|
569
|
-
|
426
|
+
unless Puppet.features.microsoft_windows?
|
570
427
|
# Grab the current file mode, and fall back to the defaults.
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
effective_mode = stat.mode
|
575
|
-
else
|
576
|
-
effective_mode = default_mode
|
577
|
-
end
|
428
|
+
stat = file.lstat rescue OpenStruct.new(:mode => default_mode,
|
429
|
+
:uid => Process.euid,
|
430
|
+
:gid => Process.egid)
|
578
431
|
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
end
|
432
|
+
# We only care about the bottom four slots, which make the real mode,
|
433
|
+
# and not the rest of the platform stat call fluff and stuff.
|
434
|
+
tempfile.chmod(stat.mode & 07777)
|
435
|
+
tempfile.chown(stat.uid, stat.gid)
|
584
436
|
end
|
585
437
|
|
586
438
|
# OK, now allow the caller to write the content of the file.
|
@@ -603,17 +455,41 @@ module Util
|
|
603
455
|
tempfile.close
|
604
456
|
|
605
457
|
if Puppet.features.microsoft_windows?
|
606
|
-
#
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
458
|
+
# This will appropriately clone the file, but only if the file we are
|
459
|
+
# replacing exists. Which is kind of annoying; thanks Microsoft.
|
460
|
+
#
|
461
|
+
# So, to avoid getting into an infinite loop we will retry once if the
|
462
|
+
# file doesn't exist, but only the once...
|
463
|
+
have_retried = false
|
464
|
+
|
465
|
+
begin
|
466
|
+
# Yes, the arguments are reversed compared to the rename in the rest
|
467
|
+
# of the world.
|
468
|
+
Puppet::Util::Windows::File.replace_file(file, tempfile.path)
|
469
|
+
rescue Puppet::Util::Windows::Error => e
|
470
|
+
# This might race, but there are enough possible cases that there
|
471
|
+
# isn't a good, solid "better" way to do this, and the next call
|
472
|
+
# should fail in the same way anyhow.
|
473
|
+
raise if have_retried or File.exist?(file)
|
474
|
+
have_retried = true
|
475
|
+
|
476
|
+
# OK, so, we can't replace a file that doesn't exist, so let us put
|
477
|
+
# one in place and set the permissions. Then we can retry and the
|
478
|
+
# magic makes this all work.
|
479
|
+
#
|
480
|
+
# This is the least-worst option for handling Windows, as far as we
|
481
|
+
# can determine.
|
482
|
+
File.open(file, 'a') do |fh|
|
483
|
+
# this space deliberately left empty for auto-close behaviour,
|
484
|
+
# append mode, and not actually changing any of the content.
|
611
485
|
end
|
612
|
-
end
|
613
|
-
# Yes, the arguments are reversed compared to the rename in the rest
|
614
|
-
# of the world.
|
615
|
-
Puppet::Util::Windows::File.replace_file(file, tempfile.path)
|
616
486
|
|
487
|
+
# Set the permissions to what we want.
|
488
|
+
Puppet::Util::Windows::Security.set_mode(default_mode, file.to_s)
|
489
|
+
|
490
|
+
# ...and finally retry the operation.
|
491
|
+
retry
|
492
|
+
end
|
617
493
|
else
|
618
494
|
File.rename(tempfile.path, file)
|
619
495
|
end
|
@@ -625,9 +501,62 @@ module Util
|
|
625
501
|
file
|
626
502
|
end
|
627
503
|
module_function :replace_file
|
504
|
+
|
505
|
+
|
506
|
+
# Executes a block of code, wrapped with some special exception handling. Causes the ruby interpreter to
|
507
|
+
# exit if the block throws an exception.
|
508
|
+
#
|
509
|
+
# @param [String] message a message to log if the block fails
|
510
|
+
# @param [Integer] code the exit code that the ruby interpreter should return if the block fails
|
511
|
+
# @yield
|
512
|
+
def exit_on_fail(message, code = 1)
|
513
|
+
yield
|
514
|
+
# First, we need to check and see if we are catching a SystemExit error. These will be raised
|
515
|
+
# when we daemonize/fork, and they do not necessarily indicate a failure case.
|
516
|
+
rescue SystemExit => err
|
517
|
+
raise err
|
518
|
+
|
519
|
+
# Now we need to catch *any* other kind of exception, because we may be calling third-party
|
520
|
+
# code (e.g. webrick), and we have no idea what they might throw.
|
521
|
+
rescue Exception => err
|
522
|
+
## NOTE: when debugging spec failures, these two lines can be very useful
|
523
|
+
#puts err.inspect
|
524
|
+
#puts Puppet::Util.pretty_backtrace(err.backtrace)
|
525
|
+
Puppet.log_exception(err, "Could not #{message}: #{err}")
|
526
|
+
Puppet::Util::Log.force_flushqueue()
|
527
|
+
exit(code)
|
528
|
+
end
|
529
|
+
module_function :exit_on_fail
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
#######################################################################################################
|
535
|
+
# Deprecated methods relating to process execution; these have been moved to Puppet::Util::Execution
|
536
|
+
#######################################################################################################
|
537
|
+
|
538
|
+
def execpipe(command, failonfail = true, &block)
|
539
|
+
Puppet.deprecation_warning("Puppet::Util.execpipe is deprecated; please use Puppet::Util::Execution.execpipe")
|
540
|
+
Puppet::Util::Execution.execpipe(command, failonfail, &block)
|
541
|
+
end
|
542
|
+
module_function :execpipe
|
543
|
+
|
544
|
+
def execfail(command, exception)
|
545
|
+
Puppet.deprecation_warning("Puppet::Util.execfail is deprecated; please use Puppet::Util::Execution.execfail")
|
546
|
+
Puppet::Util::Execution.execfail(command, exception)
|
547
|
+
end
|
548
|
+
module_function :execfail
|
549
|
+
|
550
|
+
def execute(command, arguments = {})
|
551
|
+
Puppet.deprecation_warning("Puppet::Util.execute is deprecated; please use Puppet::Util::Execution.execute")
|
552
|
+
Puppet::Util::Execution.execute(command, arguments)
|
553
|
+
end
|
554
|
+
module_function :execute
|
555
|
+
|
628
556
|
end
|
629
557
|
end
|
630
558
|
|
559
|
+
|
631
560
|
require 'puppet/util/errors'
|
632
561
|
require 'puppet/util/methodhelper'
|
633
562
|
require 'puppet/util/metaid'
|