puppet 0.24.7 → 0.24.8
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 +72 -0
- data/README.rst +38 -0
- data/Rakefile +3 -1
- data/bin/filebucket +0 -0
- data/bin/puppet +0 -0
- data/bin/puppetca +0 -0
- data/bin/puppetd +0 -0
- data/bin/puppetdoc +0 -0
- data/bin/puppetmasterd +0 -0
- data/bin/puppetrun +0 -0
- data/bin/ralsh +4 -0
- data/conf/gentoo/init.d/puppetmaster +0 -0
- data/conf/osx/createpackage.sh +0 -0
- data/conf/osx/preflight +0 -0
- data/conf/redhat/puppet.spec +20 -3
- data/conf/solaris/smf/svc-puppetd +0 -0
- data/conf/solaris/smf/svc-puppetmasterd +0 -0
- data/examples/etc/init.d/sleeper +0 -0
- data/examples/mac_dscl.pp +0 -0
- data/examples/mac_dscl_revert.pp +0 -0
- data/examples/mac_netinfo.pp +0 -0
- data/examples/mac_pkgdmg.pp +0 -0
- data/ext/bin/sleeper +0 -0
- data/ext/dbfix.sql +132 -0
- data/ext/logcheck/puppet +2 -1
- data/ext/module_puppet +0 -0
- data/ext/nagios/check_puppet.rb +0 -0
- data/ext/puppet-test +0 -0
- data/ext/puppetlast +0 -0
- data/ext/vim/syntax/puppet.vim +2 -1
- data/install.rb +2 -2
- data/lib/puppet.rb +1 -1
- data/lib/puppet/daemon.rb +0 -0
- data/lib/puppet/defaults.rb +9 -0
- data/lib/puppet/executables/client/certhandler.rb +6 -1
- data/lib/puppet/external/base64.rb +0 -0
- data/lib/puppet/external/nagios.rb +0 -0
- data/lib/puppet/external/nagios/base.rb +0 -0
- data/lib/puppet/external/nagios/parser.rb +39 -57
- data/lib/puppet/file_collection.rb +30 -0
- data/lib/puppet/file_collection/lookup.rb +20 -0
- data/lib/puppet/indirector/facts/facter.rb +6 -2
- data/lib/puppet/indirector/node/ldap.rb +75 -39
- data/lib/puppet/network/authstore.rb +0 -0
- data/lib/puppet/network/handler/filebucket.rb +0 -0
- data/lib/puppet/network/handler/fileserver.rb +0 -0
- data/lib/puppet/network/handler/report.rb +0 -0
- data/lib/puppet/network/handler/resource.rb +0 -0
- data/lib/puppet/network/handler/runner.rb +0 -0
- data/lib/puppet/network/rights.rb +0 -0
- data/lib/puppet/network/xmlrpc/client.rb +113 -53
- data/lib/puppet/node/facts.rb +0 -0
- data/lib/puppet/parser/ast.rb +4 -3
- data/lib/puppet/parser/ast/astarray.rb +2 -1
- data/lib/puppet/parser/ast/leaf.rb +1 -1
- data/lib/puppet/parser/ast/resource.rb +20 -20
- data/lib/puppet/parser/ast/resource_override.rb +2 -2
- data/lib/puppet/parser/collector.rb +1 -2
- data/lib/puppet/parser/functions/realize.rb +1 -1
- data/lib/puppet/parser/functions/regsubst.rb +93 -0
- data/lib/puppet/parser/functions/sprintf.rb +17 -0
- data/lib/puppet/parser/functions/versioncmp.rb +10 -0
- data/lib/puppet/parser/resource.rb +10 -6
- data/lib/puppet/parser/resource/param.rb +17 -14
- data/lib/puppet/parser/resource/reference.rb +2 -0
- data/lib/puppet/parser/scope.rb +3 -3
- data/lib/puppet/property/list.rb +5 -1
- data/lib/puppet/provider/augeas/augeas.rb +146 -44
- data/lib/puppet/provider/cron/crontab.rb +0 -0
- data/lib/puppet/provider/mailalias/aliases.rb +0 -0
- data/lib/puppet/provider/maillist/mailman.rb +0 -0
- data/lib/puppet/provider/mount/parsed.rb +0 -0
- data/lib/puppet/provider/naginator.rb +7 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +128 -44
- data/lib/puppet/provider/package/apple.rb +0 -0
- data/lib/puppet/provider/package/apt.rb +0 -0
- data/lib/puppet/provider/package/aptitude.rb +0 -0
- data/lib/puppet/provider/package/blastwave.rb +0 -0
- data/lib/puppet/provider/package/darwinport.rb +0 -0
- data/lib/puppet/provider/package/dpkg.rb +0 -0
- data/lib/puppet/provider/package/fink.rb +0 -0
- data/lib/puppet/provider/package/freebsd.rb +0 -0
- data/lib/puppet/provider/package/gem.rb +0 -0
- data/lib/puppet/provider/package/openbsd.rb +0 -0
- data/lib/puppet/provider/package/ports.rb +0 -0
- data/lib/puppet/provider/package/rpm.rb +0 -0
- data/lib/puppet/provider/package/sun.rb +0 -0
- data/lib/puppet/provider/package/sunfreeware.rb +0 -0
- data/lib/puppet/provider/package/up2date.rb +4 -2
- data/lib/puppet/provider/package/yum.rb +0 -0
- data/lib/puppet/provider/parsedfile.rb +47 -22
- data/lib/puppet/provider/port/parsed.rb +0 -0
- data/lib/puppet/provider/service/base.rb +0 -0
- data/lib/puppet/provider/service/debian.rb +0 -0
- data/lib/puppet/provider/service/gentoo.rb +1 -1
- data/lib/puppet/provider/service/init.rb +0 -0
- data/lib/puppet/provider/service/launchd.rb +13 -4
- data/lib/puppet/provider/service/redhat.rb +5 -5
- data/lib/puppet/provider/service/smf.rb +0 -0
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +43 -16
- data/lib/puppet/provider/sshkey/parsed.rb +0 -0
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +6 -2
- data/lib/puppet/rails/host.rb +70 -19
- data/lib/puppet/rails/param_value.rb +31 -12
- data/lib/puppet/rails/resource.rb +36 -9
- data/lib/puppet/rails/resource_tag.rb +18 -0
- data/lib/puppet/reference/report.rb +1 -0
- data/lib/puppet/reports.rb +0 -0
- data/lib/puppet/sslcertificates.rb +0 -0
- data/lib/puppet/transaction.rb +1 -1
- data/lib/puppet/type.rb +2 -6
- data/lib/puppet/type/augeas.rb +23 -15
- data/lib/puppet/type/cron.rb +0 -0
- data/lib/puppet/type/exec.rb +0 -0
- data/lib/puppet/type/file/checksum.rb +7 -35
- data/lib/puppet/type/file/content.rb +11 -8
- data/lib/puppet/type/file/ensure.rb +0 -0
- data/lib/puppet/type/file/group.rb +0 -0
- data/lib/puppet/type/file/mode.rb +0 -0
- data/lib/puppet/type/file/owner.rb +0 -0
- data/lib/puppet/type/file/selcontext.rb +8 -0
- data/lib/puppet/type/file/source.rb +0 -0
- data/lib/puppet/type/file/type.rb +0 -0
- data/lib/puppet/type/filebucket.rb +0 -0
- data/lib/puppet/type/group.rb +0 -0
- data/lib/puppet/type/host.rb +0 -0
- data/lib/puppet/type/mailalias.rb +0 -0
- data/lib/puppet/type/maillist.rb +0 -0
- data/lib/puppet/type/mount.rb +0 -0
- data/lib/puppet/type/port.rb +0 -0
- data/lib/puppet/type/schedule.rb +0 -0
- data/lib/puppet/type/ssh_authorized_key.rb +14 -0
- data/lib/puppet/type/sshkey.rb +0 -0
- data/lib/puppet/type/tidy.rb +0 -0
- data/lib/puppet/type/user.rb +6 -0
- data/lib/puppet/type/yumrepo.rb +4 -1
- data/lib/puppet/type/zfs.rb +0 -0
- data/lib/puppet/type/zpool.rb +0 -0
- data/lib/puppet/util/autoload.rb +2 -2
- data/lib/puppet/util/filetype.rb +7 -96
- data/lib/puppet/util/inifile.rb +1 -0
- data/lib/puppet/util/instance_loader.rb +0 -0
- data/lib/puppet/util/loadedfile.rb +0 -0
- data/lib/puppet/util/nagios_maker.rb +4 -0
- data/lib/puppet/util/package.rb +2 -0
- data/lib/puppet/util/posix.rb +0 -0
- data/lib/puppet/util/rails/reference_serializer.rb +18 -0
- data/lib/puppet/util/selinux.rb +3 -1
- data/spec/integration/checksum.rb +1 -0
- data/spec/integration/defaults.rb +9 -0
- data/spec/integration/file_serving/configuration.rb +0 -0
- data/spec/integration/file_serving/content.rb +0 -0
- data/spec/integration/file_serving/metadata.rb +0 -0
- data/spec/integration/indirector/direct_file_server.rb +0 -0
- data/spec/integration/indirector/file_content/file_server.rb +0 -0
- data/spec/integration/indirector/file_metadata/file_server.rb +0 -0
- data/spec/integration/indirector/module_files.rb +0 -0
- data/spec/integration/indirector/node/ldap.rb +0 -0
- data/spec/integration/indirector/rest.rb +0 -0
- data/spec/integration/network/server/mongrel.rb +0 -0
- data/spec/integration/network/server/webrick.rb +0 -0
- data/spec/integration/node.rb +0 -0
- data/spec/integration/node/catalog.rb +0 -0
- data/spec/integration/node/facts.rb +0 -0
- data/spec/integration/provider/package.rb +0 -0
- data/spec/integration/provider/service/init.rb +0 -0
- data/spec/integration/reference/providers.rb +0 -0
- data/spec/integration/reports.rb +4 -0
- data/spec/integration/transaction/report.rb +7 -1
- data/spec/integration/type/package.rb +5 -2
- data/spec/integration/util/file_locking.rb +0 -0
- data/spec/unit/executables/client/certhandler.rb +13 -0
- data/spec/unit/file_collection.rb +53 -0
- data/spec/unit/file_collection/lookup.rb +46 -0
- data/spec/unit/file_serving/configuration.rb +0 -0
- data/spec/unit/file_serving/configuration/parser.rb +0 -0
- data/spec/unit/file_serving/content.rb +0 -0
- data/spec/unit/file_serving/file_base.rb +0 -0
- data/spec/unit/file_serving/fileset.rb +0 -0
- data/spec/unit/file_serving/indirection_hooks.rb +0 -0
- data/spec/unit/file_serving/metadata.rb +0 -0
- data/spec/unit/file_serving/mount.rb +0 -0
- data/spec/unit/file_serving/terminus_helper.rb +0 -0
- data/spec/unit/indirector.rb +0 -0
- data/spec/unit/indirector/catalog/compiler.rb +0 -0
- data/spec/unit/indirector/catalog/yaml.rb +0 -0
- data/spec/unit/indirector/checksum/file.rb +0 -0
- data/spec/unit/indirector/code.rb +0 -0
- data/spec/unit/indirector/direct_file_server.rb +0 -0
- data/spec/unit/indirector/envelope.rb +0 -0
- data/spec/unit/indirector/exec.rb +0 -0
- data/spec/unit/indirector/facts/facter.rb +27 -2
- data/spec/unit/indirector/facts/yaml.rb +0 -0
- data/spec/unit/indirector/file.rb +0 -0
- data/spec/unit/indirector/file_content/file.rb +0 -0
- data/spec/unit/indirector/file_content/file_server.rb +0 -0
- data/spec/unit/indirector/file_content/modules.rb +0 -0
- data/spec/unit/indirector/file_content/rest.rb +0 -0
- data/spec/unit/indirector/file_metadata/file.rb +0 -0
- data/spec/unit/indirector/file_metadata/file_server.rb +0 -0
- data/spec/unit/indirector/file_metadata/modules.rb +0 -0
- data/spec/unit/indirector/file_metadata/rest.rb +0 -0
- data/spec/unit/indirector/file_server.rb +0 -0
- data/spec/unit/indirector/indirection.rb +0 -0
- data/spec/unit/indirector/ldap.rb +0 -0
- data/spec/unit/indirector/memory.rb +0 -0
- data/spec/unit/indirector/module_files.rb +0 -0
- data/spec/unit/indirector/node/exec.rb +0 -0
- data/spec/unit/indirector/node/ldap.rb +20 -0
- data/spec/unit/indirector/node/memory.rb +0 -0
- data/spec/unit/indirector/node/plain.rb +0 -0
- data/spec/unit/indirector/node/rest.rb +0 -0
- data/spec/unit/indirector/node/yaml.rb +0 -0
- data/spec/unit/indirector/plain.rb +0 -0
- data/spec/unit/indirector/report/processor.rb +0 -0
- data/spec/unit/indirector/request.rb +0 -0
- data/spec/unit/indirector/rest.rb +0 -0
- data/spec/unit/indirector/ssl_rsa/file.rb +5 -0
- data/spec/unit/indirector/terminus.rb +0 -0
- data/spec/unit/indirector/yaml.rb +0 -0
- data/spec/unit/module.rb +0 -0
- data/spec/unit/network/client.rb +0 -0
- data/spec/unit/network/client/master.rb +0 -0
- data/spec/unit/network/http.rb +0 -0
- data/spec/unit/network/http/mongrel.rb +0 -0
- data/spec/unit/network/http/mongrel/rest.rb +0 -0
- data/spec/unit/network/http/mongrel/xmlrpc.rb +0 -0
- data/spec/unit/network/http/webrick.rb +0 -0
- data/spec/unit/network/http/webrick/rest.rb +0 -0
- data/spec/unit/network/http/webrick/xmlrpc.rb +0 -0
- data/spec/unit/network/http_pool.rb +0 -0
- data/spec/unit/network/server.rb +0 -0
- data/spec/unit/network/xmlrpc/client.rb +165 -7
- data/spec/unit/node.rb +0 -0
- data/spec/unit/node/catalog.rb +1 -0
- data/spec/unit/node/environment.rb +0 -0
- data/spec/unit/node/facts.rb +0 -0
- data/spec/unit/other/checksum.rb +0 -0
- data/spec/unit/other/pgraph.rb +0 -0
- data/spec/unit/other/transbucket.rb +4 -4
- data/spec/unit/other/transobject.rb +0 -0
- data/spec/unit/parameter.rb +0 -0
- data/spec/unit/parser/ast.rb +5 -1
- data/spec/unit/parser/ast/arithmetic_operator.rb +0 -0
- data/spec/unit/parser/ast/astarray.rb +2 -2
- data/spec/unit/parser/ast/boolean_operator.rb +0 -0
- data/spec/unit/parser/ast/collexpr.rb +0 -0
- data/spec/unit/parser/ast/comparison_operator.rb +0 -0
- data/spec/unit/parser/ast/definition.rb +0 -0
- data/spec/unit/parser/ast/hostclass.rb +0 -0
- data/spec/unit/parser/ast/minus.rb +0 -0
- data/spec/unit/parser/ast/node.rb +0 -0
- data/spec/unit/parser/ast/nop.rb +0 -0
- data/spec/unit/parser/ast/not.rb +0 -0
- data/spec/unit/parser/ast/resource.rb +103 -0
- data/spec/unit/parser/ast/resource_override.rb +0 -0
- data/spec/unit/parser/ast/resource_reference.rb +0 -0
- data/spec/unit/parser/ast/vardef.rb +0 -0
- data/spec/unit/parser/collector.rb +4 -4
- data/spec/unit/parser/compiler.rb +0 -0
- data/spec/unit/parser/functions/realize.rb +51 -0
- data/spec/unit/parser/functions/regsubst.rb +88 -0
- data/spec/unit/parser/functions/sprintf.rb +42 -0
- data/spec/unit/parser/functions/versioncmp.rb +29 -0
- data/spec/unit/parser/interpreter.rb +0 -0
- data/spec/unit/parser/lexer.rb +0 -0
- data/spec/unit/parser/parser.rb +0 -0
- data/spec/unit/parser/resource.rb +4 -0
- data/spec/unit/parser/resource/reference.rb +4 -0
- data/spec/unit/parser/scope.rb +14 -0
- data/spec/unit/parser/templatewrapper.rb +0 -0
- data/spec/unit/property.rb +0 -0
- data/spec/unit/property/list.rb +4 -0
- data/spec/unit/provider/augeas/augeas.rb +219 -92
- data/spec/unit/provider/confine.rb +0 -0
- data/spec/unit/provider/confine/exists.rb +0 -0
- data/spec/unit/provider/confine/false.rb +0 -0
- data/spec/unit/provider/confine/feature.rb +0 -0
- data/spec/unit/provider/confine/true.rb +0 -0
- data/spec/unit/provider/confine/variable.rb +0 -0
- data/spec/unit/provider/confine_collection.rb +0 -0
- data/spec/unit/provider/confiner.rb +0 -0
- data/spec/unit/provider/group/groupadd.rb +0 -0
- data/spec/unit/provider/group/ldap.rb +0 -0
- data/spec/unit/provider/ldap.rb +0 -0
- data/spec/unit/provider/macauthorization.rb +0 -0
- data/spec/unit/provider/mcx/mcxcontent.rb +0 -0
- data/spec/unit/provider/mount.rb +0 -0
- data/spec/unit/provider/mount/parsed.rb +1 -0
- data/spec/unit/provider/naginator.rb +58 -0
- data/spec/unit/provider/package/apt.rb +0 -0
- data/spec/unit/provider/package/dpkg.rb +0 -0
- data/spec/unit/provider/parsedfile.rb +95 -0
- data/spec/unit/provider/selboolean.rb +0 -0
- data/spec/unit/provider/selmodule.rb +0 -0
- data/spec/unit/provider/service/launchd.rb +9 -1
- data/spec/unit/provider/ssh_authorized_key/parsed.rb +63 -19
- data/spec/unit/provider/user/hpux.rb +0 -0
- data/spec/unit/provider/user/ldap.rb +0 -0
- data/spec/unit/provider/user/useradd.rb +0 -0
- data/spec/unit/provider/zfs/solaris.rb +0 -0
- data/spec/unit/provider/zone/solaris.rb +0 -0
- data/spec/unit/provider/zpool/solaris.rb +0 -0
- data/spec/unit/rails.rb +1 -0
- data/spec/unit/relationship.rb +0 -0
- data/spec/unit/reports.rb +0 -0
- data/spec/unit/resource_reference.rb +0 -0
- data/spec/unit/simple_graph.rb +0 -0
- data/spec/unit/{other/transaction.rb → transaction.rb} +16 -1
- data/spec/unit/transaction/change.rb +0 -0
- data/spec/unit/transaction/event.rb +0 -0
- data/spec/unit/transaction/report.rb +0 -0
- data/spec/unit/type.rb +0 -0
- data/spec/unit/type/computer.rb +0 -0
- data/spec/unit/type/exec.rb +0 -0
- data/spec/unit/type/file.rb +2 -0
- data/spec/unit/type/file/content.rb +30 -0
- data/spec/unit/type/file/ensure.rb +0 -0
- data/spec/unit/type/file/group.rb +0 -0
- data/spec/unit/type/file/owner.rb +0 -0
- data/spec/unit/type/file/selinux.rb +6 -0
- data/spec/unit/type/group.rb +3 -0
- data/spec/unit/type/macauthorization.rb +0 -0
- data/spec/unit/type/mcx.rb +0 -0
- data/spec/unit/type/mount.rb +0 -0
- data/spec/unit/type/nagios.rb +0 -0
- data/spec/unit/type/noop_metaparam.rb +1 -0
- data/spec/unit/type/package.rb +0 -0
- data/spec/unit/type/schedule.rb +0 -0
- data/spec/unit/type/selboolean.rb +0 -0
- data/spec/unit/type/selmodule.rb +0 -0
- data/spec/unit/type/service.rb +0 -0
- data/spec/unit/type/ssh_authorized_key.rb +31 -8
- data/spec/unit/type/tidy.rb +4 -0
- data/spec/unit/type/user.rb +17 -0
- data/spec/unit/type/zfs.rb +0 -0
- data/spec/unit/type/zone.rb +0 -0
- data/spec/unit/type/zpool.rb +0 -0
- data/spec/unit/util/autoload.rb +39 -0
- data/spec/unit/util/checksums.rb +0 -0
- data/spec/unit/util/constant_inflector.rb +0 -0
- data/spec/unit/util/file_locking.rb +0 -0
- data/spec/unit/util/filetype.rb +110 -0
- data/spec/unit/util/ldap/connection.rb +0 -0
- data/spec/unit/util/ldap/generator.rb +0 -0
- data/spec/unit/util/ldap/manager.rb +0 -0
- data/spec/unit/util/loadedfile.rb +0 -0
- data/spec/unit/util/log.rb +0 -0
- data/spec/unit/util/metric.rb +0 -0
- data/spec/unit/util/nagios_maker.rb +32 -34
- data/spec/unit/util/package.rb +21 -0
- data/spec/unit/util/posix.rb +0 -0
- data/spec/unit/util/resource_template.rb +0 -0
- data/spec/unit/util/settings.rb +0 -0
- data/spec/unit/util/storage.rb +0 -0
- data/spec/unit/util/tagging.rb +0 -0
- data/spec/unit/util/uri_helper.rb +0 -0
- data/spec/unit/util/warnings.rb +0 -0
- data/test/certmgr/ca.rb +0 -0
- data/test/certmgr/certmgr.rb +0 -0
- data/test/certmgr/inventory.rb +0 -0
- data/test/certmgr/support.rb +0 -0
- data/test/data/snippets/subclass_name_duplication.pp +0 -0
- data/test/executables/filebucket.rb +6 -3
- data/test/executables/puppetbin.rb +1 -1
- data/test/executables/puppetca.rb +0 -0
- data/test/executables/puppetd.rb +0 -0
- data/test/executables/puppetmasterd.rb +0 -0
- data/test/executables/puppetmodule.rb +0 -0
- data/test/language/ast.rb +0 -0
- data/test/language/ast/casestatement.rb +0 -0
- data/test/language/ast/resource.rb +0 -0
- data/test/language/ast/resource_reference.rb +0 -0
- data/test/language/ast/selector.rb +0 -0
- data/test/language/ast/variable.rb +0 -0
- data/test/language/functions.rb +0 -0
- data/test/language/parser.rb +0 -0
- data/test/language/resource.rb +0 -40
- data/test/language/scope.rb +0 -0
- data/test/language/snippets.rb +0 -0
- data/test/language/transportable.rb +0 -0
- data/test/lib/puppettest.rb +3 -0
- data/test/lib/puppettest/support/resources.rb +0 -0
- data/test/network/authconfig.rb +0 -0
- data/test/network/authorization.rb +0 -0
- data/test/network/authstore.rb +0 -0
- data/test/network/client/ca.rb +0 -0
- data/test/network/client/client.rb +0 -0
- data/test/network/client/dipper.rb +0 -0
- data/test/network/client/master.rb +0 -0
- data/test/network/client/resource.rb +0 -0
- data/test/network/client_request.rb +0 -0
- data/test/network/daemon.rb +0 -0
- data/test/network/handler/bucket.rb +0 -0
- data/test/network/handler/ca.rb +0 -0
- data/test/network/handler/fileserver.rb +0 -0
- data/test/network/handler/handler.rb +0 -0
- data/test/network/handler/master.rb +0 -0
- data/test/network/handler/report.rb +0 -0
- data/test/network/handler/resource.rb +0 -0
- data/test/network/handler/runner.rb +0 -0
- data/test/network/rights.rb +0 -0
- data/test/network/server/mongrel_test.rb +0 -0
- data/test/network/server/webrick.rb +0 -0
- data/test/network/xmlrpc/client.rb +0 -0
- data/test/network/xmlrpc/processor.rb +0 -0
- data/test/network/xmlrpc/server.rb +0 -0
- data/test/network/xmlrpc/webrick_servlet.rb +0 -0
- data/test/other/dsl.rb +0 -0
- data/test/other/events.rb +0 -0
- data/test/other/overrides.rb +0 -0
- data/test/other/provider.rb +0 -0
- data/test/other/puppet.rb +0 -0
- data/test/other/relationships.rb +0 -0
- data/test/other/report.rb +0 -0
- data/test/other/transactions.rb +0 -0
- data/test/puppet/conffiles.rb +0 -0
- data/test/puppet/defaults.rb +0 -0
- data/test/puppet/errortest.rb +0 -0
- data/test/puppet/tc_suidmanager.rb +0 -0
- data/test/rails/ast.rb +0 -0
- data/test/rails/configuration.rb +0 -0
- data/test/rails/host.rb +0 -0
- data/test/rails/rails.rb +0 -0
- data/test/rails/railsparameter.rb +0 -0
- data/test/rails/railsresource.rb +0 -0
- data/test/ral/manager/attributes.rb +0 -0
- data/test/ral/manager/instances.rb +0 -0
- data/test/ral/manager/manager.rb +0 -0
- data/test/ral/manager/provider.rb +0 -0
- data/test/ral/manager/type.rb +0 -3
- data/test/ral/providers/cron/crontab.rb +0 -0
- data/test/ral/providers/group.rb +0 -0
- data/test/ral/providers/host/netinfo.rb +0 -0
- data/test/ral/providers/host/parsed.rb +0 -0
- data/test/ral/providers/mailalias/aliases.rb +0 -0
- data/test/ral/providers/mount/netinfo.rb +0 -0
- data/test/ral/providers/nameservice.rb +0 -0
- data/test/ral/providers/package.rb +0 -0
- data/test/ral/providers/package/aptitude.rb +0 -0
- data/test/ral/providers/package/aptrpm.rb +0 -0
- data/test/ral/providers/parsedfile.rb +0 -0
- data/test/ral/providers/port/parsed.rb +0 -0
- data/test/ral/providers/provider.rb +0 -0
- data/test/ral/providers/service/base.rb +0 -0
- data/test/ral/providers/service/debian.rb +0 -0
- data/test/ral/providers/sshkey/parsed.rb +0 -0
- data/test/ral/providers/user.rb +0 -0
- data/test/ral/providers/user/useradd.rb +0 -0
- data/test/ral/type/basic.rb +0 -0
- data/test/ral/type/cron.rb +0 -0
- data/test/ral/type/exec.rb +0 -0
- data/test/ral/type/file.rb +0 -0
- data/test/ral/type/file/target.rb +0 -0
- data/test/ral/type/filebucket.rb +0 -0
- data/test/ral/type/fileignoresource.rb +0 -0
- data/test/ral/type/filesources.rb +0 -0
- data/test/ral/type/group.rb +0 -0
- data/test/ral/type/host.rb +0 -0
- data/test/ral/type/mailalias.rb +0 -0
- data/test/ral/type/parameter.rb +0 -0
- data/test/ral/type/port.rb +0 -0
- data/test/ral/type/property.rb +0 -0
- data/test/ral/type/resources.rb +0 -0
- data/test/ral/type/service.rb +0 -0
- data/test/ral/type/sshkey.rb +0 -0
- data/test/ral/type/tidy.rb +0 -0
- data/test/ral/type/user.rb +0 -0
- data/test/ral/type/yumrepo.rb +0 -0
- data/test/ral/type/zone.rb +0 -0
- data/test/test +0 -0
- data/test/util/autoload.rb +0 -0
- data/test/util/classgen.rb +0 -0
- data/test/util/execution.rb +0 -0
- data/test/util/features.rb +0 -0
- data/test/util/fileparsing.rb +0 -0
- data/test/util/inifile.rb +0 -0
- data/test/util/instance_loader.rb +0 -0
- data/test/util/log.rb +0 -0
- data/test/util/metrics.rb +0 -0
- data/test/util/package.rb +0 -0
- data/test/util/pidlock.rb +0 -0
- data/test/util/settings.rb +0 -0
- data/test/util/storage.rb +0 -0
- data/test/util/subclass_loader.rb +0 -0
- data/test/util/utiltest.rb +0 -0
- metadata +981 -968
- data/test/util/filetype.rb +0 -137
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -36,57 +36,7 @@ module Puppet::Network
|
|
36
36
|
interface.methods.each { |ary|
|
37
37
|
method = ary[0]
|
38
38
|
newclient.send(:define_method,method) { |*args|
|
39
|
-
|
40
|
-
begin
|
41
|
-
call("%s.%s" % [namespace, method.to_s],*args)
|
42
|
-
rescue OpenSSL::SSL::SSLError => detail
|
43
|
-
if detail.message =~ /bad write retry/
|
44
|
-
Puppet.warning "Transient SSL write error; restarting connection and retrying"
|
45
|
-
self.recycle_connection
|
46
|
-
retry
|
47
|
-
end
|
48
|
-
["certificate verify failed", "hostname was not match", "hostname not match"].each do |str|
|
49
|
-
if detail.message.include?(str)
|
50
|
-
Puppet.warning "Certificate validation failed; consider using the certname configuration option"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
raise XMLRPCClientError,
|
54
|
-
"Certificates were not trusted: %s" % detail
|
55
|
-
rescue ::XMLRPC::FaultException => detail
|
56
|
-
raise XMLRPCClientError, detail.faultString
|
57
|
-
rescue Errno::ECONNREFUSED => detail
|
58
|
-
msg = "Could not connect to %s on port %s" %
|
59
|
-
[@host, @port]
|
60
|
-
raise XMLRPCClientError, msg
|
61
|
-
rescue SocketError => detail
|
62
|
-
Puppet.err "Could not find server %s: %s" %
|
63
|
-
[@host, detail.to_s]
|
64
|
-
error = XMLRPCClientError.new(
|
65
|
-
"Could not find server %s" % @host
|
66
|
-
)
|
67
|
-
error.set_backtrace detail.backtrace
|
68
|
-
raise error
|
69
|
-
rescue Errno::EPIPE, EOFError
|
70
|
-
Puppet.warning "Other end went away; restarting connection and retrying"
|
71
|
-
self.recycle_connection
|
72
|
-
retry
|
73
|
-
rescue Timeout::Error => detail
|
74
|
-
Puppet.err "Connection timeout calling %s.%s: %s" %
|
75
|
-
[namespace, method, detail.to_s]
|
76
|
-
error = XMLRPCClientError.new("Connection Timeout")
|
77
|
-
error.set_backtrace(detail.backtrace)
|
78
|
-
raise error
|
79
|
-
rescue => detail
|
80
|
-
if detail.message =~ /^Wrong size\. Was \d+, should be \d+$/
|
81
|
-
Puppet.warning "XMLRPC returned wrong size. Retrying."
|
82
|
-
retry
|
83
|
-
end
|
84
|
-
Puppet.err "Could not call %s.%s: %s" %
|
85
|
-
[namespace, method, detail.inspect]
|
86
|
-
error = XMLRPCClientError.new(detail.to_s)
|
87
|
-
error.set_backtrace detail.backtrace
|
88
|
-
raise error
|
89
|
-
end
|
39
|
+
make_rpc_call(namespace, method, *args)
|
90
40
|
}
|
91
41
|
}
|
92
42
|
|
@@ -97,13 +47,119 @@ module Puppet::Network
|
|
97
47
|
@clients[handler] || self.mkclient(handler)
|
98
48
|
end
|
99
49
|
|
50
|
+
class ErrorHandler
|
51
|
+
def initialize(&block)
|
52
|
+
metaclass.define_method(:execute, &block)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Use a class variable so all subclasses have access to it.
|
57
|
+
@@error_handlers = {}
|
58
|
+
|
59
|
+
def self.error_handler(exception)
|
60
|
+
if handler = @@error_handlers[exception.class]
|
61
|
+
return handler
|
62
|
+
else
|
63
|
+
return @@error_handlers[:default]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.handle_error(*exceptions, &block)
|
68
|
+
handler = ErrorHandler.new(&block)
|
69
|
+
|
70
|
+
exceptions.each do |exception|
|
71
|
+
@@error_handlers[exception] = handler
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
handle_error(OpenSSL::SSL::SSLError) do |client, detail, namespace, method|
|
76
|
+
if detail.message =~ /bad write retry/
|
77
|
+
Puppet.warning "Transient SSL write error; restarting connection and retrying"
|
78
|
+
client.recycle_connection
|
79
|
+
return :retry
|
80
|
+
end
|
81
|
+
["certificate verify failed", "hostname was not match", "hostname not match"].each do |str|
|
82
|
+
if detail.message.include?(str)
|
83
|
+
Puppet.warning "Certificate validation failed; consider using the certname configuration option"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
raise XMLRPCClientError, "Certificates were not trusted: %s" % detail
|
87
|
+
end
|
88
|
+
|
89
|
+
handle_error(:default) do |client, detail, namespace, method|
|
90
|
+
if detail.message.to_s =~ /^Wrong size\. Was \d+, should be \d+$/
|
91
|
+
Puppet.warning "XMLRPC returned wrong size. Retrying."
|
92
|
+
return :retry
|
93
|
+
end
|
94
|
+
Puppet.err "Could not call %s.%s: %s" % [namespace, method, detail.inspect]
|
95
|
+
error = XMLRPCClientError.new(detail.to_s)
|
96
|
+
error.set_backtrace detail.backtrace
|
97
|
+
raise error
|
98
|
+
end
|
99
|
+
|
100
|
+
handle_error(OpenSSL::SSL::SSLError) do |client, detail, namespace, method|
|
101
|
+
if detail.message =~ /bad write retry/
|
102
|
+
Puppet.warning "Transient SSL write error; restarting connection and retrying"
|
103
|
+
client.recycle_connection
|
104
|
+
return :retry
|
105
|
+
end
|
106
|
+
["certificate verify failed", "hostname was not match", "hostname not match"].each do |str|
|
107
|
+
if detail.message.include?(str)
|
108
|
+
Puppet.warning "Certificate validation failed; consider using the certname configuration option"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
raise XMLRPCClientError, "Certificates were not trusted: %s" % detail
|
112
|
+
end
|
113
|
+
|
114
|
+
handle_error(::XMLRPC::FaultException) do |client, detail, namespace, method|
|
115
|
+
raise XMLRPCClientError, detail.faultString
|
116
|
+
end
|
117
|
+
|
118
|
+
handle_error(Errno::ECONNREFUSED) do |client, detail, namespace, method|
|
119
|
+
msg = "Could not connect to %s on port %s" % [client.host, client.port]
|
120
|
+
raise XMLRPCClientError, msg
|
121
|
+
end
|
122
|
+
|
123
|
+
handle_error(SocketError) do |client, detail, namespace, method|
|
124
|
+
Puppet.err "Could not find server %s: %s" % [@host, detail.to_s]
|
125
|
+
error = XMLRPCClientError.new("Could not find server %s" % client.host)
|
126
|
+
error.set_backtrace detail.backtrace
|
127
|
+
raise error
|
128
|
+
end
|
129
|
+
|
130
|
+
handle_error(Errno::EPIPE, EOFError) do |client, detail, namespace, method|
|
131
|
+
Puppet.info "Other end went away; restarting connection and retrying"
|
132
|
+
client.recycle_connection
|
133
|
+
return :retry
|
134
|
+
end
|
135
|
+
|
136
|
+
handle_error(Timeout::Error) do |client, detail, namespace, method|
|
137
|
+
Puppet.err "Connection timeout calling %s.%s: %s" % [namespace, method, detail.to_s]
|
138
|
+
error = XMLRPCClientError.new("Connection Timeout")
|
139
|
+
error.set_backtrace(detail.backtrace)
|
140
|
+
raise error
|
141
|
+
end
|
142
|
+
|
143
|
+
def make_rpc_call(namespace, method, *args)
|
144
|
+
Puppet.debug "Calling %s.%s" % [namespace, method]
|
145
|
+
begin
|
146
|
+
call("%s.%s" % [namespace, method.to_s],*args)
|
147
|
+
rescue Exception => detail
|
148
|
+
retry if self.class.error_handler(detail).execute(self, detail, namespace, method) == :retry
|
149
|
+
end
|
150
|
+
ensure
|
151
|
+
http.finish if http.started?
|
152
|
+
end
|
153
|
+
|
100
154
|
def http
|
101
155
|
unless @http
|
102
|
-
@http = Puppet::Network::HttpPool.http_instance(
|
156
|
+
@http = Puppet::Network::HttpPool.http_instance(host, port, true)
|
103
157
|
end
|
104
158
|
@http
|
105
159
|
end
|
106
160
|
|
161
|
+
attr_reader :host, :port
|
162
|
+
|
107
163
|
def initialize(hash = {})
|
108
164
|
hash[:Path] ||= "/RPC2"
|
109
165
|
hash[:Server] ||= Puppet[:server]
|
@@ -135,7 +191,11 @@ module Puppet::Network
|
|
135
191
|
# or we've just downloaded certs and we need to create new http instances
|
136
192
|
# with the certs added.
|
137
193
|
def recycle_connection
|
138
|
-
|
194
|
+
if http.started?
|
195
|
+
http.finish
|
196
|
+
end
|
197
|
+
@http = nil
|
198
|
+
self.http # force a new one
|
139
199
|
end
|
140
200
|
|
141
201
|
def start
|
data/lib/puppet/node/facts.rb
CHANGED
File without changes
|
data/lib/puppet/parser/ast.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'puppet'
|
4
4
|
require 'puppet/util/autoload'
|
5
|
+
require 'puppet/file_collection/lookup'
|
5
6
|
|
6
7
|
# The base class for all of the objects that make up the parse trees.
|
7
8
|
# Handles things like file name, line #, and also does the initialization
|
@@ -10,11 +11,13 @@ class Puppet::Parser::AST
|
|
10
11
|
# Do this so I don't have to type the full path in all of the subclasses
|
11
12
|
AST = Puppet::Parser::AST
|
12
13
|
|
14
|
+
include Puppet::FileCollection::Lookup
|
15
|
+
|
13
16
|
include Puppet::Util::Errors
|
14
17
|
include Puppet::Util::MethodHelper
|
15
18
|
include Puppet::Util::Docs
|
16
19
|
|
17
|
-
attr_accessor :
|
20
|
+
attr_accessor :parent, :scope
|
18
21
|
|
19
22
|
# don't fetch lexer comment by default
|
20
23
|
def use_docs
|
@@ -82,8 +85,6 @@ class Puppet::Parser::AST
|
|
82
85
|
# method for them. This is probably pretty inefficient and should
|
83
86
|
# likely be changed at some point.
|
84
87
|
def initialize(args)
|
85
|
-
@file = nil
|
86
|
-
@line = nil
|
87
88
|
set_options(args)
|
88
89
|
end
|
89
90
|
end
|
@@ -18,34 +18,34 @@ class Resource < AST::ResourceReference
|
|
18
18
|
param.safeevaluate(scope)
|
19
19
|
}
|
20
20
|
|
21
|
-
|
21
|
+
resource_titles = @title.safeevaluate(scope)
|
22
22
|
|
23
23
|
# it's easier to always use an array, even for only one name
|
24
|
-
unless
|
25
|
-
|
24
|
+
unless resource_titles.is_a?(Array)
|
25
|
+
resource_titles = [resource_titles]
|
26
26
|
end
|
27
27
|
|
28
|
-
|
28
|
+
resource_type = qualified_type(scope)
|
29
|
+
|
30
|
+
# We want virtual to be true if exported is true. We can't
|
31
|
+
# just set :virtual => self.virtual in the initialization,
|
32
|
+
# because sometimes the :virtual attribute is set *after*
|
33
|
+
# :exported, in which case it clobbers :exported if :exported
|
34
|
+
# is true. Argh, this was a very tough one to track down.
|
35
|
+
virt = self.virtual || self.exported
|
29
36
|
|
30
37
|
# This is where our implicit iteration takes place; if someone
|
31
38
|
# passed an array as the name, then we act just like the called us
|
32
39
|
# many times.
|
33
|
-
|
40
|
+
resource_titles.flatten.collect { |resource_title|
|
34
41
|
exceptwrap :type => Puppet::ParseError do
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
# because sometimes the :virtual attribute is set *after*
|
39
|
-
# :exported, in which case it clobbers :exported if :exported
|
40
|
-
# is true. Argh, this was a very tough one to track down.
|
41
|
-
virt = self.virtual || scope.resource.virtual? || exp
|
42
|
-
obj = Puppet::Parser::Resource.new(
|
43
|
-
:type => objtype,
|
44
|
-
:title => objtitle,
|
42
|
+
resource = Puppet::Parser::Resource.new(
|
43
|
+
:type => resource_type,
|
44
|
+
:title => resource_title,
|
45
45
|
:params => paramobjects,
|
46
46
|
:file => self.file,
|
47
47
|
:line => self.line,
|
48
|
-
:exported =>
|
48
|
+
:exported => self.exported,
|
49
49
|
:virtual => virt,
|
50
50
|
:source => scope.source,
|
51
51
|
:scope => scope
|
@@ -53,11 +53,11 @@ class Resource < AST::ResourceReference
|
|
53
53
|
|
54
54
|
# And then store the resource in the compiler.
|
55
55
|
# At some point, we need to switch all of this to return
|
56
|
-
#
|
57
|
-
scope.compiler.add_resource(scope,
|
58
|
-
|
56
|
+
# resources instead of storing them like this.
|
57
|
+
scope.compiler.add_resource(scope, resource)
|
58
|
+
resource
|
59
59
|
end
|
60
|
-
}.reject { |
|
60
|
+
}.reject { |resource| resource.nil? }
|
61
61
|
end
|
62
62
|
|
63
63
|
# Set the parameters for our object.
|
@@ -72,8 +72,7 @@ class Puppet::Parser::Collector
|
|
72
72
|
def collect_exported
|
73
73
|
# First get everything from the export table. Just reuse our
|
74
74
|
# collect_virtual method but tell it to use 'exported? for the test.
|
75
|
-
resources = collect_virtual(true).reject { |r| ! r.virtual? }
|
76
|
-
#resources = collect_virtual(true).reject { |r| ! r.virtual? }
|
75
|
+
resources = collect_virtual(true).reject { |r| ! r.virtual? }
|
77
76
|
|
78
77
|
count = resources.length
|
79
78
|
|
@@ -8,7 +8,7 @@ Puppet::Parser::Functions::newfunction(:realize, :doc => "Make a virtual object
|
|
8
8
|
reference; e.g.: ``realize User[luke]``." ) do |vals|
|
9
9
|
coll = Puppet::Parser::Collector.new(self, :nomatter, nil, nil, :virtual)
|
10
10
|
vals = [vals] unless vals.is_a?(Array)
|
11
|
-
coll.resources = vals
|
11
|
+
coll.resources = vals.flatten
|
12
12
|
|
13
13
|
compiler.add_collection(coll)
|
14
14
|
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
module Puppet::Parser::Functions
|
2
|
+
newfunction(:regsubst, :type => :rvalue,
|
3
|
+
:doc => "\
|
4
|
+
Perform regexp replacement on a string.
|
5
|
+
|
6
|
+
Parameters (in order):
|
7
|
+
|
8
|
+
:str:
|
9
|
+
The string to operate on.
|
10
|
+
|
11
|
+
:regexp:
|
12
|
+
The regular expression matching the string. If you want it
|
13
|
+
anchored at the start and/or end of the string, you must do
|
14
|
+
that with ^ and $ yourself.
|
15
|
+
|
16
|
+
:replacement:
|
17
|
+
Replacement string. Can contain back references to what was
|
18
|
+
matched using \\0, \\1, and so on.
|
19
|
+
|
20
|
+
:flags:
|
21
|
+
Optional. String of single letter flags for how the regexp
|
22
|
+
is interpreted:
|
23
|
+
|
24
|
+
- **E**
|
25
|
+
Extended regexps
|
26
|
+
- **I**
|
27
|
+
Ignore case in regexps
|
28
|
+
- **M**
|
29
|
+
Multiline regexps
|
30
|
+
- **G**
|
31
|
+
Global replacement; all occurances of the regexp in
|
32
|
+
the string will be replaced. Without this, only the
|
33
|
+
first occurance will be replaced.
|
34
|
+
|
35
|
+
:lang:
|
36
|
+
Optional. How to handle multibyte characters. A
|
37
|
+
single-character string with the following values:
|
38
|
+
|
39
|
+
- **N**
|
40
|
+
None
|
41
|
+
- **E**
|
42
|
+
EUC
|
43
|
+
- **S**
|
44
|
+
SJIS
|
45
|
+
- **U**
|
46
|
+
UTF-8
|
47
|
+
|
48
|
+
**Examples**
|
49
|
+
|
50
|
+
Get the third octet from the node's IP address: ::
|
51
|
+
|
52
|
+
$i3 = regsubst($ipaddress,
|
53
|
+
'^([0-9]+)[.]([0-9]+)[.]([0-9]+)[.]([0-9]+)$',
|
54
|
+
'\\\\3')
|
55
|
+
|
56
|
+
Put angle brackets around each octet in the node's IP address: ::
|
57
|
+
|
58
|
+
$x = regsubst($ipaddress, '([0-9]+)', '<\\\\1>', 'G')
|
59
|
+
") \
|
60
|
+
do |args|
|
61
|
+
flag_mapping = {
|
62
|
+
"E" => Regexp::EXTENDED,
|
63
|
+
"I" => Regexp::IGNORECASE,
|
64
|
+
"M" => Regexp::MULTILINE,
|
65
|
+
}
|
66
|
+
if args.length < 3 or args.length > 5
|
67
|
+
raise Puppet::ParseError, ("regsub(): wrong number of arguments" +
|
68
|
+
" (#{args.length}; min 3, max 5)")
|
69
|
+
end
|
70
|
+
str, regexp, replacement, flags, lang = args
|
71
|
+
reflags = 0
|
72
|
+
global = false
|
73
|
+
(flags or "").each_byte do |f|
|
74
|
+
f = f.chr
|
75
|
+
if f == "G"
|
76
|
+
global = true
|
77
|
+
else
|
78
|
+
fvalue = flag_mapping[f]
|
79
|
+
if !fvalue
|
80
|
+
raise Puppet::ParseError, "regsub(): bad flag `#{f}'"
|
81
|
+
end
|
82
|
+
reflags |= fvalue
|
83
|
+
end
|
84
|
+
end
|
85
|
+
re = Regexp.compile(regexp, reflags, lang)
|
86
|
+
if global
|
87
|
+
result = str.gsub(re, replacement)
|
88
|
+
else
|
89
|
+
result = str.sub(re, replacement)
|
90
|
+
end
|
91
|
+
return result
|
92
|
+
end
|
93
|
+
end
|