diff -Nru puppet-0.25.1/CHANGELOG puppet-0.25.4/CHANGELOG --- puppet-0.25.1/CHANGELOG 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/CHANGELOG 2010-01-29 21:32:27.000000000 +0000 @@ -1,5 +1,203 @@ +0.25.4 +====== +0025e13 Partial reversion of patch for #3088 to fix #3104 (Exception misreported) +bfc9e45 Updated CHANGELOG for 0.25.4rc3 + +0.25.4rc3 +========= +a91c476 Fix for #3088 (catching Exception also traps SystemExit) +1a263e2 Fix for #3089 (timestamp may now be a time object, not a string) +75634b7 Fix for #3093 (also need to be able to call pkgget_with_cat on class) +94e269c Uncommeniting the fix for #3001 +9636b93 Updated CHANGELOG for 0.24.5rc2 +d4319a5 Minimal fix for #3001 (failing to fetch metadata on dangling symlink) +cdcbdc7 Fixing #2914 - pre/post hooks now work for transactions +67216aa Fix for #3075 (sshkey host_aliases ignored) +e4462c0 Updated version and CHANGELOG for 0.25.4 + +0.25.4rc2 +========= +d4319a5 Minimal fix for #3001 (failing to fetch metadata on dangling symlink) +cdcbdc7 Fixing #2914 - pre/post hooks now work for transactions +67216aa Fix for #3075 (sshkey host_aliases ignored) +e4462c0 Updated version and CHANGELOG for 0.25.4 +441879f Revert "Fix #2845 Cron entries using "special" parameter lose their title when changed" +f7e1435 Updated rake task to fix gem build issue +49013f0 Updated version and CHANGELOG for 0.25.3 + +0.25.3 +====== +f8c1b08 Reversion of pipe IO patch for testing on #3025 +7f25805 Fix #1464 Mount complains about missing fields +c99f394 Fix #2845 Cron entries using "special" parameter lose their title when changed +0a7e212 Fix #2887 'service' tests paths too early +dd22b71 Replaced ugly gem creation task with slightly less ugly task +d0efcc6 Added tasks directory to Rakefile and gem task file lists +8a6d66e Added puppetpackages task description +eada68a Updated CHANGELOG for 0.25.2 +6111ba8 Fix for temporary file security whole +e7d98cc Fix for #2999 (absent package handling on solaris) +87136b4 Fix typo in documentation: wheter vs. whether. +cbc2ef0 Partial rollback of refinements to fix for #2994 +fd631b9 Do not close stdout or stderr in execute. +f878fe8 Update Red Hat spec file for 0.25.2 +4394c48 Updated CHANGELOG for 0.25.2rc3 +13cbf04 ReFix 2675 ending slash in directory should get stripped off +5c6f07b Use a pipe instead of a temp file for command output. +7e64393 Additional fix for #2994 (followed symlinks do not have checksums) +7e2e12b Fix for #2995 (don't fail to load PSON when UTF-8 missing) +c84186a Revert "Fix for #2731 (problem communicating with processes in SELinux)" +74d9693 Updated man pages for 0.25.2 +7e2b1e9 Fix for #2995 (don't fail to load PSON when UTF-8 missing) +d1ff4b3 Fix for #2994 (undefined method "_file" message) +4d81511 fix #2987 - check correct hash entry + +0.25.2 +====== +6111ba8 Fix for temporary file security whole +e7d98cc Fix for #2999 (absent package handling on solaris) +87136b4 Fix typo in documentation: wheter vs. whether. +cbc2ef0 Partial rollback of refinements to fix for #2994 +fd631b9 Do not close stdout or stderr in execute. +f878fe8 Update Red Hat spec file for 0.25.2 +4394c48 Updated CHANGELOG for 0.25.2rc3 +13cbf04 ReFix 2675 ending slash in directory should get stripped off +5c6f07b Use a pipe instead of a temp file for command output. +7e64393 Additional fix for #2994 (followed symlinks do not have checksums) +7e2e12b Fix for #2995 (don't fail to load PSON when UTF-8 missing) +c84186a Revert "Fix for #2731 (problem communicating with processes in SELinux)" +74d9693 Updated man pages for 0.25.2 +7e2b1e9 Fix for #2995 (don't fail to load PSON when UTF-8 missing) +d1ff4b3 Fix for #2994 (undefined method "_file" message) +4d81511 fix #2987 - check correct hash entry +682000b Updated CHANGELOG for 0.25.2rc2 +e4bb529 Fix for #2967 (RFC-1123 problem and regression on wildcarded domains) +776be7c Updated CHANGELOG + +0.25.2rc1 +========= +a73f799 Updated version +26e7486 Fixing failing tests +05e897e Fix for #2881 (ralsh doesn't find individual parsed resources) +e04f9e4 Code smell reductions +24654a2 Making provider/host/parser.rb compatible with host_aliases +49530ad Fixing #2964 updated resources cannot be collected until they are exported twice +6ab2453 Fix for #2731 (problem communicating with processes in SELinux) +0e5d264 Fix for #2940 (propogating nil rather than reporting the error) +d60ea0e A slide down the RFC-1123 slope towards MS Windows compatibility and chaos +b185801 Fixing #2960 Test Failed: 'Puppet::Type::Mount::ProviderParsed when modifying the filesystem tab should write the mount to disk when :flush is called +5e5c8b5 Fixing tests +0cb5e7d Fix for #2943 (Make puppet --apply respect --preferred_serialization_format) +0884035 Fix #2970 spec/unit/provider/ssh_authorized_key/parsed.rb has order dependencies +b86decc Fix #2816 MySQL server has gone away +854c065 Fix for #2813 (alias propety v. alias metapram) +813cb58 Fix for #2765 (--no-fqdn regression in puppetrun) +e9a0cb7 Fix for #2657 (retain old setting if config has syntax error) +727ee72 Fix #2966 spec/unit/util/queue.rb can't be run twice +8c8e921 Fixing #2963 spec/unit/util/autoload.rb depends on global state +ea90daa Fix for #2965 (Chatty SELinux message) +fc221ff Fixed RSpec deprecation error +037b99a Fixing #2958 inconsistent errors in spec/integration/bin/puppetmasterd.rb +d11c750 Fix for #2951 (SELinux test errors on OS X) +0dc2dba Fix for #2890 (the cached certificates that would not die) +03f37ac Fix for #2950 (parens needed warning) +61fd460 Fix #2924 Test Failed: Puppet::Indirector::FileContent::FileServer when finding files should find plugin file content in the environment specified in the request +2432b23 Fixed test typo +f5960ce Closed #2937 - Migrated a number of requires to features +2d88926 Fix for #2869 (SELinux tests failing under some load orderings) +18c5165 Adds partial IPv6 support to authstore +857047d Fix for #2567 (Authstore does unintended/pointless DNS lookups) +dddbd28 Enabling steps for #2567 (Authstore does unintended/pointless DNS lookups) +ea0a43f Fix 2948 Failing rests in spec/unit/rails.rb +b6f4291 Fix #2923 failing tests in spec/unit/ssl/host.rb +bf7c108 Fix #2677 Proper OIDs on puppet.schema for LDAP +e0488b2 Fix #2808 puppetqd doesn't give an error when no config is given +7b2e2ba Fixing 2851 spec/unit/network/rest_authconfig.rb test descriptions change +1c69af2 Fixing 2855 Inadvertent zlib dependency +3528a7b 2850 spec/unit/application/puppetd.rb generates warnings if run with certain other tests +d343af0 2876 spec/unit/indirector/catalog/compiler.rb changes behaviour +a7fae47 Fix 2936 Insufficient mocks for webrick in spec/unit/network/http/webrick.rb +b96b757 Fix for #887 (safely setting pager to cat for blastwave) +d685f44 2633 file and line info on bad params in type/file +4326eb2 Fix for #2817 (links created even when links property set to follow) +118adc1 2875 spurious test failure in spec/integration/file_serving/content.rb +0f63a54 2877 race condition in webrick +4895329 Fix for #2921 (test not checking for what it really wanted) +f47fa40 Fix for #2925 (accept higher versions of rspec) +c261721 Fix for #2911 (Allow capital letters in selinux contexts) +bf7d650 Fix for #2900 (rug output parsing too specific) +cccbca4 Fix for #2786 (failed trying to backup directory in recursive purge) +6dfac97 Fixing 2907 rspec crash when spec/unit/application/puppetrun.rb is run after spec/unit/util/ldap/connection.rb +1c8d272 Fixing 2870 Spurious failures in spec/integration/ssl/certificate_request.rb +979440f Fixing 2862 spec/integration/file_serving/metadata.rb fails unless run with other tests +e04d299 Fixing 2858 spec/unit/application/puppetmasterd.rb fails if run twice +53a9805 Minimal fix for #2822 +9ac1ed6 Fix for #2863 (calling each on uninitialized tag list) +bd9e06f Feature 2827 Option to disable managing internal files +8b66998 Fixing 2849 puppet changes sshkey alias every run if it is blank +7136c85 Fixed spellquote function documentation +de16fd3 Updated yumrepo type documentation +d1fa7cf Fixed --no-ca option in Gentoo also +8b5b4b6 Fixed incorrect command line in Red Hat sysconfig file +623d9c7 Fixing 2886: Failing specs in format_handler +feb021f Avoiding rspec bug which causes 'be_all' tests to always pass +228f105 Removed some extraneous files from ext +01c98f6 Fixed #2798 - Correct issue with crontab provider on AIX +f7c5ceb Fixing 2725 Error message when permissions incorrect on file server directory +07b94b4 2842 Format debugging should be removed +3abcc89 Fix #2783, take2 - puppetdoc should use environment to get modulepath/manifestdir +f5dd6c8 Fix #2831 - puppetdoc doesn't cope with regex node +4a06379 Fixing #2857 (quote nesting error) +9a41c35 Fixing #2791 fs_find should follow symlinks +5629092 Added additional documentation to file mode attribute. +dc8812c Fixing 2792 selinux tries to set properties on unsupported filesystes +57632a0 fix #2854 - parse timestamps +cb6bc27 fix regex for non-installed packages +9cfe390 Fixing 2812 authorized_keys without comments fail +53b3b86 Fix for ticket #2844 (file recursion generated vs. explicit prefix) +8129caa Fix for ticket #2700 -- check for @explicit_waitforcert in puppetd --test +e32f980 Fixed #1806 - supplementary groups are not reset +be7ff82 Fix 2768 maillist resource is broken +48beaba simplify and fix portage provider +0ac0ce9 Implement tasks for git-based workflow. +bd5dc64 Possible workaround for #2824 (MRI GC bug) +c1e47a4 Fixing #2789 puppetrun fails without --tag +106c9a9 Fixing 904 RDoc::usage incompatible with rubygems +5ed2e26 rack: SSL Env vars can only be in Request.env +7f2e5fc Fix #2671, preferred_serialization_format does not complain about invalid values +f0eaf20 Fixing #2764 ActiveRecord 2.1 support +eaab789 Fix failing tests introduced by #2797 +55d8ffa Fix #2810 - adapt tidy to new FileSet api +236bacc conf/redhat: Prevent killproc from removing /usr/sbin/puppetmasterd +41f025c Fixed ldap typo again +6c2daa3 Fix #2783 - Puppetdoc rdoc should use environment to get modulepath/manifestdir +5648666 Add Environment#manifestdir and small refactoring +74a877e Minimal fix for #2821 ("rake spec" is needlessly slow) +cd10e6d Added package signing task +ca56aa7 Least kludgy patch for #2675 +adc0a4e Fix for #2661 and related issues +65f601a Fixing 2806 Specifying multiple tags fails to apply any of them +e2c675e Updated generate function documentation to make it clear it runs on the master +53f40bd Fix #2681 Incorrectly duplicating resources +3fdc8ef Ticket #2770 (deserializing Exec[...]s with "\n"s) +b172287 Fixing #2767 invoke-rc.d warnings +4013560 Fix #2797 - tags are not inherited by recursed file sub child +f05a04e Fix #2784 - puppetdoc/rdoc didn't parse mono-instruction class content +38ec9fc Fix #2796 - Fix puppetdoc rdoc selector parsing +5f7177e Fix #2795 - puppetdoc rdoc reports a better error message +136949d Fixing #2631 show_diff sometimes doesn't happen +cb3e5e1 Fix #2787 - Storeconfig doesn't store/update node ip and environment anymore +ff23b57 Fix for #2670, Puppet silently ignores catalog_format +ee13efa Add docs to Mac OS X package creation script and clean out old docs in the preflight +b8470b8 Fix #2757 & CSR 92 (symlinks in recursively managed dirs) +5b750c2 Fix #2769 - default schedule are not defined +eca338c Fix for #2772 (webrick test failures) +b1c57e9 Al Hoang's patch for #2781, removing obsolete when/: syntax +50e9c98 Follow-on for #2724 - Adding an external node classifier + 0.25.1 ====== +2f0b1e5 Updated CHANGELOG 20e5222 Fixing #2689 - file owner warnings are reduced 09fb3f7 Fixing #2752 - "require" loads "include" 6846c32 Fixing some recently broken Scope tests @@ -24,6 +222,9 @@ ae528f6 Ticket #2734 PSON/JSON not serializing classes of a catalog f59f805 Bug #1900 Parsing of quoted $ in stdin 6ba122f Fixing #2735 - node classes are immed. added to classlist + +0.25.1rc2 +========= bca3b70 Bundling of pure ruby json lib as "pson" ce46be5 Proposed alternative solution for #2664 (REGEX / DIV lexing) b0518c3 Fix for #2681 (duplicate resource) @@ -38,6 +239,9 @@ d891f7a Ticket #2676 (a typo) bfba2cd Fix #2672 - Make sure nodenames keep their underscores when used as classname db67e5f Added rcov exclusion to Rakefile + +0.25.1rc1 +========= 6912a7e Incremented version to 0.25.1 fd322da Fixes #1538 - Fixes the yumrepo backtrace in noop mode. 6551e86 Fix #2664 - Mathematic expressions mis-lexed as Regex @@ -75,340 +279,6 @@ c2e26b9 vim: match regexp language features 1494bd7 Require active_record/version to support ActiveRecord < 2.3 a5c56fc Fixed #2607 - Added Facter dependency for Puppet Gem -b1eddbb Updated and created new CHANGELOG format -994d6e0 Adding tests for the #2599 fix -42ab73f Ticket #2525 don't fail find_manifest on invalid module names -a0f0dcc Updated permissions on test files -d45812b Refactoring tests to reduce code size, increase coverage, and make -aba2f66 This further normalizes the handling of init-style services (including -fb236a0 Combined fix for #2525, #2552 -- RedHat service issues -d40b942 Fixed #2589 - Renamed zfs delete to destroy and added tests -4aa7fce Monkey patch to improve yaml compatibility between ruby versions -1f6c74d Fixed typo in parser test -2e9b706 Updated Red Hat spec file and RH patches for 0.25.0. -19815dd Fixing #2592 - you can escape slashes in regexes -ea58478 Fixing #2590 - modulepath is not cached inappropriately -1a3d0c8 Fixed #2593: puppet init script status command not returning proper exit code -8dabc72 Update documentation string to reflect actual intent of Puppet::Node::Facts::Rest -b30a3c7 Fixes #2581. Use new 10.6 global launchd overrides file for service status/enabled -7f05469 Fixed Naginator link -e589cd3 Fixing #2582 - / no longer autorequires / -3342b73 Fixing #2577 - clarifying and demoting the deprecation notice -d397f8d Fixing #2574 - autoloading finds plugins in modules -800a78b The first regex node now matches first -6750aeb Fixing #2563 - multiple regex nodes now work together -b728b93 Fixes #724 - false is equivalent to 'ruby -W1' -a9d5863 Fix parser error output -ee4f6ba Fixing #2551 - fixing content changed logs -c8f859e Fix for test isolation portion of Ticket #2511 -6fa9271 Fixing #2549 - autoloading of top-level classes works again -c752680 Fixing a heisenbug resulting from a race condition -ea417d6 Fixing #2460 - puppetmasterd can now read the cert and key -a49915a Not using the service user in settings when it's unavailable -14ec838 Explicitly loading all facts in the directory service provider -5ee6602 Adding an 'exists?' delegator from user type to provider -06fcece Switching the owner/group settings to use symbolic values -4eb325a Fixing the yamldir group to be a group instead of user -058514a Moving Setting classes into separate files -b0f219a Removing chuser on darwin restriction -7f749cb Fixing a ruby warning in the authstore test -c0da3bf Fixing #2558 - propagating recent fileserving changes -ff39bc7 Fixes #2550 Handles case where metadata is nil -47dee83 Ticket 2559 -- parseonly ignored specified file -a4f6896 Fixed #2562 - Recognize the usecacheonfailure option again -e408d6c Refactoring the Module/Environment co-interface -796ba5c Fixing #1544 - plugins in modules now works again -6bd3627 Adding a global cleanup to the spec_helper -0ef5f22 Removed misguided case sensitivity tests -c1967bb Fixes #2513. debian service provider now uses invoke-rc.d to determine enabled? status -7e09247 Fixing fact-missing problem when puppet.conf is reparsed -a35e9bf Fix for #2531; adds tests to confirm problem and related cases, -299eadb Fixed #2530 - Fixed status setting in the SMF provider -e6a7e82 Fixed spec typo -75c6e4a Fixes #2493 -b62d966 conf/redhat/*.init: Fix condrestart/try-restart -e9fbd4c conf/redhat/client.init: Fix #2123, status options on older RHEL -0461a02 Updates to Solaris smf files to reflect new binary locations -55a9cdb Fix #2517 - Stack overflow when CA cert missing -601a2e5 Fix #2516 - Fix format detection when content-type contains charset -d86bc88 Fix #2507 - Add missing integration tests -aad3b76 Fix #2507 - Exported resources were not correctly collected. -63cb1ad Fixes #2503 -c129f2a Fixes #2360 - Removed annoying log message -b1ffffa Fixed #2525 - Wrong method being overridden in Red Hat services -a88fc4d Fixing more tests broken from missing libraries -9a356ab Fixing ActiveRecord Indirector tests to skip w/out Rails -acc5a96 Fixing #2489 - queue integration tests are skipped w/out json -1a5c5b3 Fixing #2508 - removing mention of ActiveRecord 2.3 -0cb9072 Fixing #2541 - file cache is more resilient to failure -23948d0 vim: Mark puppetFunction values as contained -79a4339 Add shellquote() function. -79d705f Fixes #2499. Allows execs to specify an array for the returns parameter -b611c34 Updated fix for #2481 -f385072 Revert "Fxied #2481 - Added status and restart overrides for Red Hat service provider." -cc379b6 Fixed #2498 - logcheck update -85a3633 Removed extraneous debugging -bf94de9 Updated two more tests -5b87dba Logs now assume resource params have metadata -1410bed Adding metadata delegation from param to resource -3ab3a5c Removing unnecessary debug output -488e368 Adding integration tests for #2371 (backup refactor) -f1406bf Adding many tests for #2371, and slightly refactoring -8f60f0c Fixes for Redmine 2371. -cd224c6 Fixes #2464, #2457. Deprecate reportserver for report_server. Add report_port setting. Add tests. -401a9ec Fixing #2484 - "format missing" messages are better -f6cc598 Fixes #2483 - Log only copies metadata from RAL objects -7c4c00f Fixed #2486 - Missing require 'monitor' in parser_support.rb -ea34ee6 Added R.I.Pienaar's extlookup.rb to the ext directory -36d3f58 Added example conf/puppet-queue.conf -967eb9f Fxied #2481 - Added status and restart overrides for Red Hat service provider. -c702f76 rack: SSL Env vars can be in Request.env or ENV -ca17b3c rack: don't directly use the forbidden HTTP_CONTENT_TYPE env var (fixes rack specification conformance) -a002e58 Removing old filebucket test -d8de446 Cleaning up tests for #2469 -266aafa default server in remote filebuckets -1f8ef60 Fixes #2444 - Various JSON test failures -11c0fb7 Fixed #2294 - Classes sometimes cannot be found -7e5b562 Adding #2477 - puppet can apply provided catalogs -97274ad Fixing problems my Feature refactor caused -6fb8bf6 Fixing ruby warning in definition test -b3545fc Fixed global deprecation error in useradd Unit tests -dc24472 Adding a test for the Exec type -58d9587 Speeding a test up through stubbing -d4d8372 Fixing a small test by stubbing instead of mocking -f7e1c36 Fixing a test broken by the regex features -54a225d Fixing tests broken by caching autoload results -1ce31b4 Migrating Handler base tests from test/ to spec/ -cc3f56a Migrating Feature tests to spec -21d1d25 Fixing cron test to match new behaviour -849fa67 Migrating tests to spec and removing an obsolete test -6f458cc Logging the configuration version we're applying -ac58e27 Configuration version information is now in logs -6ed0103 Adding support for an external catalog version -39320b8 Cleaning up duplication in another test file -25fae5f Removing duplication in the test structure -36c0662 Simplified Rakefile and moved tasks to tasks/rake directorya -b45ccf8 Implement node matching with regexes -58a73b5 Make sure node are referenced by their names -3ebf148 Enhance selector and case statements to match with regexp -ef68967 Fix #2033 - Allow regexp in if expression -17e62b1 Add AST::Regex, an AST leaf node representing a regex -4f9545f Add regexes and regex match operators to the parser -0ccd259 Add regex, match and not match token to the lexer -201ae59 Allow variable $0 to $9 to be interpolated, if ephemeral -f357a91 Implement ephemeral scope variables -d40ef29 Signed-off-by: Eric Sorenson -6d22afb Modifying the REST client error to make server errors more clear -21f477a Fixes #2472. Load Facter facts when ralsh is invoked, plus test. -2e41edb Update CHANGELOG.git -ebb5a1f Fixed ci_spec task for RubyGems 1.3.5 -b6b903e Fixes #2461. Provide new and old code paths for macosx_productversion_major with deprecation warning -26b0c70 Fixing typo in two tests which caused them to always pass -76fc2b1 Fixing #2440 - catalogs can now be compiled on demand -832b6ff Exiting from app failures instead of raising -4ea3f17 Minimal patch to fix #2290 (/tmp permissions) -08ff9e8 Fix #2467 - rack: suggest putting puppet/lib at beginning of RUBYLIB search path -fb60f90 Fix #2465 - Default auth information is confusing with no auth.conf -0ca9b53 Fix #2459 - puppetdoc added namespace classes as RDoc modules instead of classes -18b5d61 Fix #2429 - vim: class/define/node should only be followed by whitespace -da828a4 Fix #2448 - fix the broken runit provider and tests -3898436 Fixed #2405 - Mount parameter "dump" doesn't accept all valid values on FreeBSD -9825bec Fixes #2362. Do not validate users/groups when supplied with numeric uid/gids -450a19c Fix #2454 - Definition named after a module don't show in puppetdoc -8551ece Fix #2453 - puppetdoc mixes long class names that look alike -e3ee594 Fix #2422 & #2433 - make sure puppetdoc transform AST::Leaf boolean correctly -b3b76df Fixing #2296 - overlapping recursions work again -9120712 Fixing mocks to remove warnings -eeec8e9 Fixing #2423 - no more strange dependency cycles -7d40f9e Fixing #2443: Adding debugging guidance to dep cycle errors -b4facb0 Fixing a test broken by changing the default os x package type -b418921 Fixing selinux tests broken in the fix for #1963 -719e76b Fixing #2445 - fixing the mount test mock -f13f08d Minor fix to URL for LDAP nodes documentation -7c859a7 Fixing #2399 - removing client-side rrd graphs -f6d6145 Fixing #2421 - file renaming errors now propagate -db82523 Fixes #2438, get major OS X version from Facter and replace Puppet::Error invocations with fail builtin -22145e7 Update install.rb to cope with all OS X versions, not just 10.5 -935c463 Fixing #2403 - provider specificity is richer and better -d95b687 Fix #2439 - let puppetdoc use loaded_code -ef5c4ae Fixed #2436 - Changed ralsh to use Puppet::Type.new and avoid deprecation notice -0c18013 Fixes #2430 - Stock apache2.conf for passenger incorrect -c383ceb Make pkgdmg default Darwin provider, make confines consistent on Darwin package providers. -98599c4 Convert to using sbindir for OS X packages, clean out previous executables in bindir -c659743 Fix #2425 - make sure client can contact CA server with REST -17205bb Fix #2424 - take 2, make sure default mounts allow every clients -f2c55cc Fix #2378 and #2391 tests -8bbd8b4 Fix #2424 - File server can't find module in environment -effaf80 Fix small typo in the fix for #2394 -a06094e Feature #2378 - Implement "thin_storeconfigs" -b2a008e Fix #2391 - Exported resources never make to the storeconfigs db -8f82407 Fix #2261 - Make sure query string parameters are properly escaped -c86d44e Fixed #579 - puppet should try to clear solaris 10 services in maintenance state -910a5e2 Fix #1963 - Failing to read /proc/mounts for selinux kills file downloads -ba824e9 Fixing #2245 - provider lists are not lost on type reload -eb40966 Ruby no longer clobbers puppet autoloading -a42e878 deprecate NetInfo providers and examples, remove all NetInfo references and tests. -22f5632 Fixed #2410 - default acl logs as info instead of warn. -65b0137 Adding test for current auth config warning. -74f5ad4 Fixed #2394 - warn once on module mount deprecation. -f46a52a Add test for current module mount deprec warning. -858d333 Fixes #2258,#2257,#2256. Maintain correct type for integers/booleans, allow correct values, and fix rule array handling -44f127f Added Markdown mode to puppetdoc to output Markdown. -8a8ce9d Excluded directories from rcov coverage report -d152c5e Allow boolean value for boolean cli parameter -911b490 Fix #2364 - Associates the correct comment to the right statement -faefd92 Make sure the parser sees the correct line number -869ec27 Fix #2366 - puppetdoc was parsing classes in the wrong order -4c659b7 Added rcov coverage to Spec tests -1fd98b1 Fixes #2367 - Mongrel::HTTPRequest returns a StringIO object -8b09b83 Fix #2082 - puppetca shouldn't list revoked certificates -ea66cf6 Fix #2348 - Allow authstore (and REST auth) to match allow/deny against opaque strings -1e83aad Fix #2392 - use Content-Type for REST communication -aaca17a Fixed #2293 - Added cron syntax X-Y/Z and '7' for sunday -cddc365 Switching to LoadedCode from ASTSet -fc1f8cd Adding a special class to handle loaded classes/defines/nodes -325b8e4 Fix #2383, an incompatibility with early ruby 1.8 versions -46112da Fixing #2238 In some cases blank? is not available on String. -cdd1662 Fixing #2238 - Deal with nil hash keys from mongrel params -769c8aa Final fix to CI test rakes -a6816ff Set ENV['PATH'] to an empty string if non-existent -64a4720 Fix to CI rake tasks -5680cd5 Fixing #2197 - daemontools tests now pass -603b9cf Change the diff default output to "unified" -9bc9b5c Added missing colon to suntab -0f2d70d Fixed #2087 and refactored the code that gets the smf service state -3f070c1 Using the logging utilities to clean up module warnings -feb7f89 Fixing #1064 - Deprecating module 'plugins' directories -ccf4e69 Removing deprecated :pluginpath setting -4036de9 Fixing #2094 - filebucket failures are clearer now -ed876e0 Refactoring part of the file/filebucket integration -bd81c25 Adding tests for file/backup behaviour -c45ebfa Fixed pi binary so --meta option works and updated documentation -d2080a5 Fixing #2323 - Modules use environments correctly -b9e632f Fixed #2102 - Rails feature update fixed for Debian and Ubuntu -1c4ef61 Fixed #2052 - Added -e option to puppet --help output -d332333 Fix #2333 - Make sure lexer skip whitespace on non-token -5fbf63c Updated split function and add split function unit tests (courtesy of Thomas Bellman) -a585bdd * provider/augeas: strip whitespace and ignore blank lines -a94d2de Fixed pi tests -5f7455e Fixed #2222 - Cleanup pi binary options and --help output -134ae3e Fixing #2329 - puppetqd tests now pass -de55e19 Cleaning up scope tests a bit -e4ae870 Fixing #2336 - qualified variables only throw warnings -607b01e Fix #2246 - take2: make sure we run the rails tag query only when needed -06b919d Fix collector specs which were not working -2945f8d Make sure overriding a tag also produces a tag -e142ca6 Removed a unit test which tested munging which is no longer done in the type -d8ee6cf Clearn up a parsing error reported by the tests -446557f vim: several improvements + cleanup -9152678 Fixed #2229 - Red Hat init script error -b5a8c4d Fix #1907 (or sort) - 'require' puppet function -74730df #2332: Remove trailing slashes from path commands in the plugin -1a89455 Changing the preferred serialization format to json -0de70b7 Switching Queueing to using JSON instead of YAML -7b33b6d Adding JSON support to Catalogs -c0bd0aa Providing JSON support to the Resource class -c16fd1b Adding a JSON utility module for providing Ruby compat -f059c51 Adding JSON support to Puppet::Relationship -7f322b3 Adding a JSON format -7666597 Allowing formats to specify the individual method names to use -d40068f Allowing formats to specify the methods they require -024ccf5 Adding a "json" feature -c8b382d Fix some tests who were missing some actions -f9516d4 Make sure virtual and rails query use tags when tag are searched -b5855ec Make sure resources are tagged with the user tag on the server -d69fffb Fix #2246 - Array tagged resources can't be collected or exported -6ce0d1e Partial fix for #2329 -4f2c066 Removed extra whitespace from end of lines -97e6975 Changed indentation to be more consistent with style guide (4 spaces per level) -41ce18c Changed tabs to spaces without interfering with indentation or alignment -f3b4092 Fix #2308 - Mongrel should use X-Forwarded-For -7b0413e Fixes Bug #2324 - Puppetd fails to start without rails -48d5e8c Enhance versioncmp documentation -ef56ba5 * provider/augeas: minor spec test cleanup -d322329 * provider/augeas: allow escaped whitespace and brackets in paths -9735c50 * provider/augeas: match comparison uses '==' and '!=' again -dbfa61b * provider/augeas (process_match): no match results in empty array -386923e * provider/augeas: remove useless checks for nil -171669a * provider/augeas: simplify evaluation in process_get/match -51cc752 * provider/augeas (open_augeas): use Augeas flag names, not ints -4951cdf * provider/augeas: ensure Augeas connection is always closed -0d5a24d * provider/augeas: minor code cleanup -cea7bb5 * provider/augeas (parse_commands): use split to split string into lines -95bd826 * provider/augeas: remove trailing whitespace (no functional change) -7c5125b Brought in lutters parse_commands patch and integrated it into the type. -6ce8154 Removed --no-chain-reply-to in rake mail_patches task -4ef7bba Removing --no-thread from the mail_patches rake target -508934b Fixing a bunch of warnings -fb0ed7a Fixing tests broken by a recent fix to Cacher -650029e Always providing a value for 'exported' on Rails resources -f1dba91 Fixing #2230 - exported resources work again -5522eb8 Disabling the catalog cache, so puppetqd is compatible with storeconfigs -abbb282 Fixing the rails feature to be compatible with 2.1+ -907b39b Using Message acknowledgement in queueing -42247f0 Fixing #2315 - ca --generate works again -d7be033 Fix #2220 - Make sure stat is refreshed while managing Files -e4d5966 Added puppet branding to format patch command -00d5139 vim: Remove another mention of 'site' from syntax -9067abd vim: Highlight parameters with 'plusignment' operator -736b0e4 vim: Highlight strings in single quotes -ce01c95 vim: Clean up syntax spacing -3af2dbf JRuby OpenSSL implementation is more strict than real ruby one and -62534a1 Logging when a cached catalog is used. -ff5c44f Changing Puppet::Cacher::Expirer#expired? method name -e3d4c8e Fixing #2240 - external node failures now log output -bc1445b Fixing #2237 - client_yaml dir is always created by puppetd -e0c19f9 Fixing #2228 - --logdest works again in puppetd and puppetmasterd -ab34cf6 Fixing puppetmasterd tests when missing rack -9d5d0a0 Fixing the Agent so puppetrun actually works server-side -b0ef08b Fixing #2248 - --no-client correctly leaves off client -b83b159 Fixing #2243 - puppetrun works again -3d2189f Fixed #2304 - Added naggen script to directly generate nagios configuration files from a StoreConfigs Rails database -700ad5b Sync conf/redhat/puppet.spec with Fedora/EPEL -3ec3f91 Fixed #2280 - Detailed exit codes fix -f98d49f Fixing #2253 - pluginsync failures propagate correctly -d860a2f Fixing a transaction test that had some broken plumbing -a728757 Refactoring resource generation slightly -6e824d8 Adding a Spec lib directory and moving tmpfile to it -1d69dbf Extracting a method from eval_resource in Transaction -7650fb2 Not trying to load files that get removed in pluginsyncing -3995e70 Fix #2300 - Update ssh_authorized_key documentation -cb4a4d3 Changed version to allow Rake to work. Minor -99f666f enable maillist on centos, redhat, fedora -e13befa Fixing #2288 - fixing the tests broken by my attr_ttl code -a406d58 Fix for #2234: test fails with old Rack version -c189b46 Fixing #2273 - file purging works more intuitively -138f19f Caching whether named autoloaded files are missing -415553e Adding caching of file metadata to the autoloader -d489a2b Adding modulepath caching to the Autoloader -5f1c228 Adding caching to the Environment class -047ab78 Adding TTL support to attribute caching -6a413d2 Fixed #2666 - Broken docstring formatting -469604f Deprecating factsync - pluginsync should be used instead -d39c485 Added spec and unit tests to the Rakefile files list and fixed CI rake tasks -e1a7f84 Added install.rb to Rakefile package task -e180a91 Fixed #2271 - Fix to puppetd documentation -4bf2980 Protecting Stomp client against internal failures -f4cb8f3 Adding some usability bits to puppetqd -a18298a Refactoring the stomp client and tests a bit -2771918 Relying on threads rather than sleeping for puppetqd -07ff4be Fixing #2250 - Missing templates throw a helpful error -7ce42da Fixing #2273 - CA location is set correctly in puppetca -e1779c7 RackXMLRPC: buffer request contents in memory, as a real string. -fb957cc Modules now can find their own paths -c608409 Moving file-searching code out of Puppet::Module -83ba0e5 Fixing #2234 - fixing all of the tests broken by my bindaddress fix -4f3a67f Fixing #2221 - pluginsignore should work again -2d580c2 Fix snippets tests failing because of activated storeconfigs -8c718c9 Fix failing test: file.close! and file.path ordering fix -17f2c7d Confine stomp tests to Stomp enabled systems -6a80b76 Fix some master failing tests -172422f Fix bug #2124 - ssh_authorized_key always changes target if target is not defined -f945b66 Fixing #2265 - rack is loaded with features rather than manually -5aef915 Added .git to pluginsignore default list of ignores -6db5e8d Cleanup of the Puppet Rakefile and removal of the requirement for the Reductive Build Library -5cc4910 Fix #1409 once again, including test -a6af5bf Added split function 0.25.0 ====== @@ -416,8 +286,8 @@ 994d6e0 Adding tests for the #2599 fix 42ab73f Ticket #2525 don't fail find_manifest on invalid module names a0f0dcc Updated permissions on test files -d45812b Refactoring tests to reduce code size, increase coverage, and make -aba2f66 This further normalizes the handling of init-style services (including +d45812b Refactoring tests to reduce code size, increase coverage, and make Luke happy. +aba2f66 This further normalizes the handling of init-style services (including the redhat "service" wrapper script). Removes special case handling of non-zero exit code in redhat (base already did this) and centralizes scattered @resource[:has_____] checks. Tests that proper versions of each are called and one level of fallbacks. fb236a0 Combined fix for #2525, #2552 -- RedHat service issues d40b942 Fixed #2589 - Renamed zfs delete to destroy and added tests 4aa7fce Monkey patch to improve yaml compatibility between ruby versions @@ -452,14 +322,14 @@ c0da3bf Fixing #2558 - propagating recent fileserving changes ff39bc7 Fixes #2550 Handles case where metadata is nil 47dee83 Ticket 2559 -- parseonly ignored specified file -a4f6896 Fixed #2562 - Recognize the usecacheonfailure option again +a4f6896 Fixed #2562 - Recognize the usecacheonfailure option again Signed-off-by: John A. Barbuto e408d6c Refactoring the Module/Environment co-interface 796ba5c Fixing #1544 - plugins in modules now works again 6bd3627 Adding a global cleanup to the spec_helper 0ef5f22 Removed misguided case sensitivity tests c1967bb Fixes #2513. debian service provider now uses invoke-rc.d to determine enabled? status 7e09247 Fixing fact-missing problem when puppet.conf is reparsed -a35e9bf Fix for #2531; adds tests to confirm problem and related cases, +a35e9bf Fix for #2531; adds tests to confirm problem and related cases, notes fixes specific issue by eliminating the specal case for opaque strings which caused them to be strings when everything else was arrays; adds nots and pending tests where FQDN support could be added but stops short of a full refactor. 299eadb Fixed #2530 - Fixed status setting in the SMF provider e6a7e82 Fixed spec typo 75c6e4a Fixes #2493 @@ -485,6 +355,9 @@ f385072 Revert "Fxied #2481 - Added status and restart overrides for Red Hat service provider." cc379b6 Fixed #2498 - logcheck update 85a3633 Removed extraneous debugging + +0.25.0rc1 +========= bf94de9 Updated two more tests 5b87dba Logs now assume resource params have metadata 1410bed Adding metadata delegation from param to resource @@ -676,7 +549,7 @@ 0d5a24d * provider/augeas: minor code cleanup cea7bb5 * provider/augeas (parse_commands): use split to split string into lines 95bd826 * provider/augeas: remove trailing whitespace (no functional change) -7c5125b Brought in lutters parse_commands patch and integrated it into the type. +7c5125b Brought in lutters parse_commands patch and integrated it into the type. This includes reworking the get and match commands as well. This change introduces a few small changes. These are: 6ce8154 Removed --no-chain-reply-to in rake mail_patches task 4ef7bba Removing --no-thread from the mail_patches rake target 508934b Fixing a bunch of warnings @@ -693,7 +566,7 @@ 9067abd vim: Highlight parameters with 'plusignment' operator 736b0e4 vim: Highlight strings in single quotes ce01c95 vim: Clean up syntax spacing -3af2dbf JRuby OpenSSL implementation is more strict than real ruby one and +3af2dbf JRuby OpenSSL implementation is more strict than real ruby one and requires certificate serial number to be strictly positive. 62534a1 Logging when a cached catalog is used. ff5c44f Changing Puppet::Cacher::Expirer#expired? method name e3d4c8e Fixing #2240 - external node failures now log output @@ -713,7 +586,7 @@ 1d69dbf Extracting a method from eval_resource in Transaction 7650fb2 Not trying to load files that get removed in pluginsyncing 3995e70 Fix #2300 - Update ssh_authorized_key documentation -cb4a4d3 Changed version to allow Rake to work. Minor +cb4a4d3 Changed version to allow Rake to work. Minor edit to Rakefile 99f666f enable maillist on centos, redhat, fedora e13befa Fixing #2288 - fixing the tests broken by my attr_ttl code a406d58 Fix for #2234: test fails with old Rack version @@ -749,6 +622,9 @@ 6db5e8d Cleanup of the Puppet Rakefile and removal of the requirement for the Reductive Build Library 5cc4910 Fix #1409 once again, including test a6af5bf Added split function + +0.25.0beta1 +=========== 2dd55fc Fixing #2200 - puppetqd expects Daemon to be a class c016062 Removing unneeded test stubs 1a2e1bc Fixing #2195 - the Server class handles bindaddress @@ -852,31 +728,15 @@ edcbab5 Removing duplicate method definition from SimpleGraph d8eaca8 mini daemon to trigger puppetrun on clients without puppet listen mode d2c417e Fix #2113 - Make temp directory -916dd60 Fixed rspec gem at version 1.2.2 -57b37e5 Add @options to test run call, for compatibility with more recent rspec versions. 173b5f0 Adding #2122 - you can specify the node to test with puppet-test -0863a79 Adding #2122 - you can specify the node to test with puppet-test a677e26 Fixing all tests that were apparently broken in the 0.24.x merge. e016307 Fixing Rakefile; apparently there was a rake or gem incompatibility -a43137c More RST fixes -843cc6e Fixed RST for functions -6160aaf In order for ReST formatting to work properly, newlines and 62dad7a Fix #2107 - flatten resource references arrays properly cbee426 Fix #2101 - Return to recurse=0 == no recursion behavior 3b4816b Fix #2101 - fix failing test f089e11 Fix #2101 - fix recurselimit == 0 bad behaviour 1b4eae7 Added rake ci:all task -d125937 Added rake ci:all task 3f61df8 Fixed #2110 - versioncmp broken -c62c193 Updated to version 0.24.8 -aa00bde Fixing #1631 - adding /sbin and /usr/sbin to PATH -39deaf3 Fixed #2004 - ssh_authorized_key fails if no target is defined -dcf2bf2 Changelog entries for #1629 and #2004 -bbcda1d Fix Bug #1629 -69a0f7d Fix #1807 - make Puppet::Util::Package.versioncmp a module function -081021a Fix #1829 - Add puppet function versioncmp to compare versions -2b33f80 Fixed install.rb typo -5ab63cd Updated lib install permissions to 0644 830e1b1 CHANGELOG updates 3e0a9cd Moved of puppetd, puppetca, puppetmasterd, puppetrun binary from bin to sbin 6ddebf4 Fixed #2086 - Fixes to make building tarballs easier @@ -995,7 +855,7 @@ 37692e5 Renmaing Puppet::Network::Client::Master to Puppet::Agent 15d8768 Revert "Adding the first bits of an Agent class." 63fb514 Revert "This is work that I've decided not to keep" -8f5cbc3 This is work that I've decided not to keep +8f5cbc3 This is work that I've decided not to keep so I'm just applying it here so it continues to show up in the history in case I ever want to look at it again. 25b28c5 Adding a new Agent::Downloader class for downloading files. 1afb821 Adding the first bits of an Agent class. 2afff60 Adding support for skipping cached indirection instances. @@ -1013,7 +873,7 @@ 6af3179 Fixed #1877 - Tidy type reference update for use of 0 a5b0a75 Fix autotest on win32 234a035 Fix #1560 -fb8f8cd In order for ReST formatting to work properly, newlines and +fb8f8cd In order for ReST formatting to work properly, newlines and indentation of doc strings must be retained. 69432d6 Fix Bug #1629 1f6dce5 Fix #1835 : Add whitespace/quote parsing to 8142981 Fix #1847 - Force re-examination of all files to generate correct indices @@ -1080,11 +940,11 @@ e728873 Reducing the number of calls to terminus() to reduce interference with caching aa8d091 Switched all value management in props/params to internal classes. e5b5033 Fixing #1677 - fixing the selinux tests in master. -77d73e0 Changing the meaning of the unused Puppet::Type#parameter method to return an instance +77d73e0 Changing the meaning of the unused Puppet::Type#parameter method to return an instance rather than a value. 05e1325 Moving a file purging test to rspec 6f7ccff Fixing #1641 - file recursion now only passes original parameters to child resources. -a4d4444 Removing obsolete methods and tests: -b4f4866 Making it so (once again) files with sources set can still be deleted +a4d4444 Removing obsolete methods and tests: Removing obsolete handleignore method Removing obsolete FileSource class Removing a now-obsolete test/unit test Removing a now-obsolete recursive filebucket test +b4f4866 Making it so (once again) files with sources set can still be deleted (which I think is kinda stupid, but apparently people want it). caf15c2 Fixing and migrating more file tests. cccd838 Adding a starting point for spec tests for tidy. 255c9fb Setting puppetmasterd up to serve all indirected classes. @@ -1094,7 +954,7 @@ a78c971 Fixing CertificateRequest#save to accept arguments. e70c1a0 Fixing forward-compatibility issues resulting from no global resources 4596d2d Fixing a test I broke when fixing a reporting bug -9742c26 Fixing resource aliasing to not use global resource aliasing. +9742c26 Fixing resource aliasing to not use global resource aliasing. I'm not really sure why the 0.24.x-style code got merged in, since master's changes should be more recent. 1b517d2 Adding comments to Puppet::Util::Cacher 7a6d9b1 Removing obselete code from the file type. 1b512a9 Merged fsweetser's selinux patch against HEAD @@ -1180,7 +1040,7 @@ 0e7e16d Adding a FormatHandler module for managing format conversions. 93eeff5 Fixing the user ldap provider tests 00b7da3 Fixing the new-form version of #1382. -c542dc0 Fixing #1168 for REST -- all ssl classes downcase their names. +c542dc0 Fixing #1168 for REST -- all ssl classes downcase their names. This is a much cleaner fix than the xmlrpc version, thankfully. :) eaa6eab Fixing #1258 -- Removing a Rails idiom. eb5e422 Fixing #1256 -- CA tests now work with no ~/.puppet. 66c36f0 Fixing another failing test -- the new CA tests correctly clear the cache. @@ -1193,17 +1053,17 @@ 1cfb021 The CRL is now automatically used or ignored. 0365184 Removing obsolete tests 3303590 The master and client now successfully speak xmlrpc using the new system. -8fd68e3 Adding pidfile management and daemonization to the Server +8fd68e3 Adding pidfile management and daemonization to the Server class. dd4d868 Fixing the HttpPool module to get rid of an infinite loop. 57c7534 Adding REST terminuses for the SSL-related indirections. d78b4ba Adding autosigning to the new CA. a822ef9 Moving the CA Interface class to a separate file. 38e2dcf The master is now functionally serving REST and xmlrpc. 6e0d6dd The REST infrastructure now correctly the SSL certificates. -51ce674 Fixing the webrick integration tests to use the newly-functional +51ce674 Fixing the webrick integration tests to use the newly-functional SSL code. 62f1f5e The Certificate Authority now automatically creates a CRL when appropriate. e57436f The Settings class now clears the 'used' sections when a value is changed. -137e29f Moving some http configuration values to the main +137e29f Moving some http configuration values to the main defaults section, rather than the puppetd section. a3b8804 The http pool manager now uses new-style certificate management. e596bc5 Fixing some tests that were insufficiently mocking their configurations. 160f9d9 Fixing a critical problem in how CRLs were saved and moving SSL Store responsibilities to the SSL::Host class. @@ -1214,76 +1074,76 @@ 31b79fa Adding xmlrpc support to webrick. 7a876ed Fixing some whitespace 7267341 Adding configuration support for XMLRPC handlers. -8c9b04d I think I've now got the Webrick SSL support working. +8c9b04d I think I've now got the Webrick SSL support working. Now I just need to get xmlrpc working alongside REST in both mongrel and webrick. 83519f4 Interim commit, since I want to work but have no network available. -58fb416 Changing the File certificate terminus so that it +58fb416 Changing the File certificate terminus so that it saves to the :localcacert instead of :cacert. 79ca444 Renaming the 'ca_file' ssl terminus type to 'ca'. a116d10 Temporarily disabling the revoke/verify test in the CA. d87e018 Fixing how the CRL is used for certificate verification. 6c539c0 Fixing puppetca so it uses the :local ca setting. ebdbe48 Added an Interface class to the CA to model puppetca's usage. -934fbba Making the SSL::Host's destroy method a class method, +934fbba Making the SSL::Host's destroy method a class method, rather than an instance method. d4813f1 Adding the last functionality needed for puppetca to use the Indirector. 809fc77 Finishing the interface between the CA and the CRL. 16056a2 Adding inventory support to the new certificate authority. d498c4a Adding support within the inventory for real certs or Puppet cert wrappers. -67f9d69 Changing the Inventory class to rebuild when the +67f9d69 Changing the Inventory class to rebuild when the first cert is added, so it's easier to test. 7cca669 Adding a comment to the inventory class. 98db985 Adding an SSl::Inventory class for managing the ssl inventory. 92a7d76 All SSL terminus classes now force the CA information into the right place. fb56dea Switching the SSL::Host class to return Puppet instances. -f7e0990 Setting the expiration date of certificate objects to the expiry of the actual +f7e0990 Setting the expiration date of certificate objects to the expiry of the actual cert. 71db9b5 Adding integration tests for a lot of the SSL code. e5c4687 Moving the password file handling into the SSL::Key class. -d8bb81e Moving all of the ca-specific settings to the ca_file -cbe5221 Adding SSL::Host-level support for managing the terminus and +d8bb81e Moving all of the ca-specific settings to the ca_file terminus classes, rather than the normal :file classes. +cbe5221 Adding SSL::Host-level support for managing the terminus and cache classes. Also, defaulting to the :file terminus for all of the SSL classes. c5f0eff Fixing the CA so it actually automatically generates its certificate. 3d24b12 The certificate authority now uses a Host instance named 'ca'. daa8cd5 Changing all of the SSL terminus classes to treat CA files specially. -7d2c05e The 'destroy' method for the ssl_file terminus base class +7d2c05e The 'destroy' method for the ssl_file terminus base class now returns false on missing files, rather than failing. 7555af6 Marking a test as pending, because it's not ready yet. -c19c9d4 Removing all the cases where the ssl host specifies -054e4e4 Making the first pass at using requests instead of -6900f97 Adding a :to_text method that will convert the contained +c19c9d4 Removing all the cases where the ssl host specifies a terminus. Also, getting rid of some metaprogramming that wasn't really helping. +054e4e4 Making the first pass at using requests instead of specifying the terminus class. The individual ssl classes now work, but the ssl host class doesn't yet. +6900f97 Adding a :to_text method that will convert the contained thing to readable human text. 174b9c9 Actually signing the certificates in the CA. -546ac97 Adding the first attempt at managing the certificate -c98ad25 Adding a :search method to the ssl_file terminus type +546ac97 Adding the first attempt at managing the certificate revocation list. +c98ad25 Adding a :search method to the ssl_file terminus type and the SSL::Host class. d184b35 Fixing a failing test that had not been updated from previous coding -b9d6479 We have a basically functional CA -- it can sign -1efed03 Adding tests for the easy bits of the CertificateFactory. +b9d6479 We have a basically functional CA -- it can sign requests and return certificates. There's still plenty more work to do, but I'm probably not much more than a day away from redoing puppetca to use this code. +1efed03 Adding tests for the easy bits of the CertificateFactory. I probably am going to skip the tests for the rest, since the code is unlikely to ever change, and it's going to be a royal pain to test. ee07d0b Adding tests for the certificate serial numbers dc5c73b The certificate authority is now functional and tested. a776a12 refactoring the cert request test a bit -7641bd4 This is a first pass at the certificate authority. -0f46815 It looks like all of the new ssl classes for managing -00e35bc Adding he last of the indirection classes for the ssl -8347b06 The certificate and key are now correctly interacting +7641bd4 This is a first pass at the certificate authority. The tests are basically entirely absent still, but the structure is all there. +0f46815 It looks like all of the new ssl classes for managing keys, certificates, and requests now work, including talking to the certificate authority. Now we just need the authority itself, along with the necessary REST terminii. +00e35bc Adding he last of the indirection classes for the ssl classes, finally including the certificate requests. +8347b06 The certificate and key are now correctly interacting with the existing cert/key store. Certificate requests are not yet handled, nor are the ca-specific collections. 50f3c18 Removing obsolete indirection classes -ec5bdf3 The basics for the certificate and certificate request +ec5bdf3 The basics for the certificate and certificate request indirection terminii are done. I need to move most of the test code to a shared behaviour now. bb87464 Fixing a couple of broken tests. -b0811ad The new SSL classes basically work, but they're not +b0811ad The new SSL classes basically work, but they're not functionally connected to any kind of indirection. 3970818 Finished the certificate request wrapper class. -4ca6fd3 First stage of cert refactoring: Private -ef7d914 Oops; final fix on the integration test failures resulting +4ca6fd3 First stage of cert refactoring: Private keys kind of work. +ef7d914 Oops; final fix on the integration test failures resulting from my partial support for ssl in webrick. 0ca0ef6 Fixing whitespace problems. -4640a3d Fixing an integration test of the rest terminus; it was -d738f31 Adding the necessary tests for webrick to have logging and -b49fb68 Fixing the tests in test/ that were broken as -5e78151 Fixing tests that were failing as a result of the merge, -bee9aba Environments are now available as variables in manifests, -b225e86 Fixing #1017 -- environment-specific modulepath is no +4640a3d Fixing an integration test of the rest terminus; it was broken by my incomplete cert support in webrick. I just stubbed out the cert usage for now; once all the cert stuff is done we'll need to go back and unstub it. +d738f31 Adding the necessary tests for webrick to have logging and ssl. The tests can't be completed until the certificate work is all done. +b49fb68 Fixing the tests in test/ that were broken as a result of the move to no global resources. +5e78151 Fixing tests that were failing as a result of the merge, including removing some now-obsolete code and tests from the Settings class. +bee9aba Environments are now available as variables in manifests, and specs can be directly executed again. +b225e86 Fixing #1017 -- environment-specific modulepath is no longer ignored. 4ede432 Tidied the man page creation function and created "master" branch man pages f335dc3 Updated defaults.rb to fix foru error stopping man page creation - links are not as neat as before but puppet.conf.man file will create neatly now. c751058 Removed remaining elements of old_parse - closing Ticket #990 31e0850 Removed old configuration file behaviour and deprecation warning - closes ticket #990 4165eda More fixes to the testing. -cfda651 Another round of test-fixes toward eliminating global resource -488c437 Fixing automatic relationships. I was previously looking them +cfda651 Another round of test-fixes toward eliminating global resource references. This should have gotten rid of all of them, and now it's just a question of fixing a few hopefully unrelated failing tests. +488c437 Fixing automatic relationships. I was previously looking them up in the relationship graph, which only stores the vertices, not the resource table. d8991ab Updated install.rb to product puppet.conf.man page - updating ticket #198 5a0388f Disabled new man page creation support e5888af Added support for man page creation - requires rst2man.py and writer - closed ticket #198 5bef4a5 Another round of fixes toward making global resources work. -3cc3e0f Lots o' bug-fixes toward getting rid of global resources. +3cc3e0f Lots o' bug-fixes toward getting rid of global resources. We still have about 60 failing tests, but some of them are the failing directory service tests (probably 20 or so), and most are simple fixes to the tests themselves. b7b11bd Fixing a couple of failing tests aed51b4 Fixed puppet logcheck issues 7aa79e2 Revert "Fixed documentation for code option in defaults.rb" @@ -1298,6 +1158,30 @@ b38f538 Moving $PUPPET/spec/lib/autotest up to $PUPPET/autotest as something has changed and it can't be found otherwise. e1abfac moving autotest directory to make it possible to run autotest again +0.24.9 +====== +0dee418 Fixed typo in util.rb +df33cb0 Updated CHANGELOG +a22a088 Updated version to 0.24.9 +0aae57f Backport of tmpfile patch from 0.25.2 +9a26421 Brought in lutters parse_commands patch and integrated it into the type. This includes reworking the get and match commands as well. This change introduces a few small changes. These are: +916dd60 Fixed rspec gem at version 1.2.2 +57b37e5 Add @options to test run call, for compatibility with more recent rspec versions. +0863a79 Adding #2122 - you can specify the node to test with puppet-test +a43137c More RST fixes +843cc6e Fixed RST for functions +6160aaf In order for ReST formatting to work properly, newlines and indentation of doc strings must be retained. +d125937 Added rake ci:all task +c62c193 Updated to version 0.24.8 +aa00bde Fixing #1631 - adding /sbin and /usr/sbin to PATH +39deaf3 Fixed #2004 - ssh_authorized_key fails if no target is defined +dcf2bf2 Changelog entries for #1629 and #2004 +bbcda1d Fix Bug #1629 +69a0f7d Fix #1807 - make Puppet::Util::Package.versioncmp a module function +081021a Fix #1829 - Add puppet function versioncmp to compare versions +2b33f80 Fixed install.rb typo +5ab63cd Updated lib install permissions to 0644 + 0.24.8 ====== 02a503f Updated to version 0.24.8 @@ -1312,92 +1196,6 @@ 2c7e189 Fixes incorrect detail variable in OS X version check, re-patches ralsh to work with Facter values and adds error check for missing password hash files. 73a0757 Fix #1828 - Scope.number? wasn't strict enough and could produce wrong results -0.24.8rc1 -========= -84d6637 Fixed #2000 - No default specified for checksum -a3bb201 Fixing change printing when list properties are absent -67fc394 Fixed #2026 - Red Hat ignoring stop method -cf64827 Bring in the documentation changes from the master branch -01bc88c Added a force option to ensure the change is always applied, and call augeas twice to reduce the chance that data is lost -cedeb79 Backport the fix for #1835 -cf48ec0 First cut at the not running if augeas does not change any of the underlieing files -9d36b58 Bug 1948: Added patch by jab to support the correct ins syntax. Updated the test cases as well -61661b1 Fixing #1991 - ldap booleans get converted to booleans -d5850dc Refactored a method: extracted about five other methods -1c7c8fe dbfix - fix typo and close another possible inconsistency -c55ac3f Fix #2010 - add protection code for some storeconfig corruption -a790ee3 Further fix to #1910 -9577d3a Fixing #2013 - prefetching had a mismatch between type and title -719a8df Fixed to rake tests for reductivelabs build -ac87600 Fixed report reference page -0c16426 Fixing broken 0.24.x tests in test/. -23066c1 Fixing every failing test I can find on the build server. -ec56ddf This script fixes the most common issues with inconsistent -c052ff8 Make puppetd --waitforcert option behave as documented: -e2b4062 Adding a performance optimization to the FileCollection. -fa6494b Using the FileCollection where appropriate. -373d505 Adding a FileCollection and a lookup module for it. -0e46786 Fixed #1963 - Failing to read /proc/mounts for selinux kills file downloads -4170238 Fixed #2025 - gentoo service provider handle only default init level -8c010e0 Fixed #1910 - updated logcheck -7504b04 Updated useradd.rb managehome confine to include other RH-like distributions -f07d928 Use Puppet.debug instead of own debug flag -25a3f59 Fixing #558 - File checksums no longer refer to 'nosum' -d758f45 Fixing #1871 once and for all - contents are never printed -c0f4943 Minor fix to launchd tests -24d48e6 Fix #1972 - ActiveRecord fixes resulted in broken tests -446989b Fix spec test for launchd service provider to work with new service status method and add two new status tests. -3ef5849 Fixing a test I broke in commit:"897539e857b0da9145f15648b6aa2ef124ec1a19". -72bd378 Removing a no-longer-valid test. -682dd8b Fixing password validation to support symbols. -44f97aa Only backing up within parsedfile when managing files -04af7b4 Fixing a syntax error in the up2date provider -1070b3c Fixing a test broken by a log demotion -ab84756 Cleaned up variable names to be more sane, clarified error messages and fixed incorrect use of 'value' variable rather than 'member'. -7f41857 Provide dscl -url output support for OS X 10.4 clients using the directoryservice provider. -0bc3c07 Fix launchd service provider so it is backwards compatible with OS X 10.4 as well -2561c8e Updated Augeas type code -7d72186 Removed site from Puppet VIM syntax -1bc7404 Fixed #1831 - Added sprintf function -336b645 Fixed #1830 - Added regsubst function -2a85551 Bug 1948: Add logic and testing for the command parsing logic -2218611 Updated up2date and service confines to add support for Oracle EL and VM -39a8b28 Fixing #1964 - Facts get loaded from plugins -7cf085c Adding tests for Puppet::Indirector::Facts::Facter.loadfacts -70ea39a Adding a post-processor for Nagios names. -4dfa034 Revert "Refixing #1420 - _naginator_name is only used for services" -d5a193a Fixing #1541 - ParsedFile only backs up files once per transaction -53f15b9 Removing the apparently obsolete netinfo filetype. -4e89156 Migrated FileType tests to spec, and fleshed them out a bit. -cc4d658 Bug #1948: Added patch by jab to support the correct ins syntax. Updated the test cases as well -5e35166 Fixing #961 - closing the http connection after every xmlrpc call -af3f3ae Refactoring the XMLRPC::Client error-handling -f0ac3ae Fixed #1959 - Added column protection for environment schema migration -319822a Fixing #1869 - autoloaded files should never leak exceptions -6b0c1b9 Fixing #1543 - Nagios parse errors no longer kill Puppet -7fd5c7e Moving the transaction specs to the right path -efb5cc5 Refixing #1420 - _naginator_name is only used for services -32c2be9 Fixed #1884 - exported defines are collected by the exporting host -0e49159 Cleaning up the AST::Resource code a bit -b22d148 Fix #1691 - Realize fails with array of Resource References -6331bfc Fix #1682 - Resource titles are not flattened as they should -7e036eb Fix #1922 - Functions squash all arguments into a single hash -535fa89 Fixed #1538 - Yumrepo sets permissions wrongly on files in /etc/yum.repos.d -f7b04df Fixed #1936 - Added /* */ support to the vim file -671d73c Prefetching, and thus purging, Nagios resources now works -063871f Adding some basic tests for the Naginator provider base class -897539e Removing a redundant instance prefect call. -012efe3 Fixing #1912 - gid still works with no 'should' value. -a9f34af Fixing the Rakefile to use 'git format-patch'. -db05c00 Fixing #1920 - user passwords no longer allow ':' -aa219e7 Adding README.rst file -1d3f117 Added Reductive Labs build library -f01882d Change the way the tags and params are handled in rails -b7ab54c Add methods to return hash instead of objects to params and tags -5c64435 Rails serialization module to help serialize/unserialize some Puppet Objects -b27fccd Fixed #1852 - Correct behaviour when no SELinux bindings -7403330 Updated Red Hat spec file 0.24.7 - 0.24.7rc1 ========= 84d6637 Fixed #2000 - No default specified for checksum @@ -1418,7 +1216,7 @@ ac87600 Fixed report reference page 0c16426 Fixing broken 0.24.x tests in test/. 23066c1 Fixing every failing test I can find on the build server. -ec56ddf This script fixes the most common issues with inconsistent +ec56ddf This script fixes the most common issues with inconsistent storeconfigs database (including duplicate resources record, duplicate param_values records, dangling records...). c052ff8 Make puppetd --waitforcert option behave as documented: e2b4062 Adding a performance optimization to the FileCollection. fa6494b Using the FileCollection where appropriate. @@ -1470,7 +1268,7 @@ 7e036eb Fix #1922 - Functions squash all arguments into a single hash 535fa89 Fixed #1538 - Yumrepo sets permissions wrongly on files in /etc/yum.repos.d f7b04df Fixed #1936 - Added /* */ support to the vim file -671d73c Prefetching, and thus purging, Nagios resources now works +671d73c Prefetching, and thus purging, Nagios resources now works *only* if you use the default configuration file locations. 063871f Adding some basic tests for the Naginator provider base class 897539e Removing a redundant instance prefect call. 012efe3 Fixing #1912 - gid still works with no 'should' value. @@ -1483,6 +1281,9 @@ 5c64435 Rails serialization module to help serialize/unserialize some Puppet Objects b27fccd Fixed #1852 - Correct behaviour when no SELinux bindings 7403330 Updated Red Hat spec file 0.24.7 + +0.24.7 +====== 8befc18 Updated to version 0.24.7 cf19bd8 Not using a temporary file when locking files for writing. b966ea0 Modifying the corruption-checking test. @@ -1554,7 +1355,7 @@ 81a91a7 Documentation fix for daemontools provider 4f67a7c Fixed #1776 - Trivial fix for gentoo service provider 2764ab4 Rename migration so it's still applied -965c08d Slight denormalisation to store a host's environment as a first class +965c08d Slight denormalisation to store a host's environment as a first class object in the database Fixes: #1392 5742966 Fixing #1743 - defined types get catalogs too. 31ec3e6 Adjusted CI tasks exit codes 3421954 Fixing #1755 - handling fully qualified classes correctly. @@ -1573,7 +1374,7 @@ 27a750d Revert "Fixing #1755 - File modes (and other strange properties) will now display correctly" eb0d32a Fixing #1764 - a property's 'sync' method is never considered a no-op. e9f858a Refactoring the file/owner property to be simpler and cleaner. -ed4c405 Fixing #1755 - File modes (and other strange properties) will now display correctly +ed4c405 Fixing #1755 - File modes (and other strange properties) will now display correctly in ralsh and generated manifests. c65f2b5 Fixed #1668 - puppetca can't clean unsigned certs 1ad33cc Fix #1759 - Comparison operator was using string comparison for numbers c96d250 Fixed #1711 - fileserver test fails due to incorrect mocking @@ -1603,7 +1404,7 @@ e032034 Fix #1737 - ssh_authorized_keys should be able to parse options containing commas e33d087 Fix #1740 - Daemontools and Runit is not ReST compliant dfc0554 Fixed #1730 - Edited file/ensure.rb docs for clarity -6d7b5ef Fixes #1672 - unsafe crontab handling in Solaris +6d7b5ef Fixes #1672 - unsafe crontab handling in Solaris Signed-off-by: Martin Englund 083077d Fixing the augeas type tests to work when augeas is missing 0a3d34d Fixes #1714 - yumhelper handling with yum 2.2.x is broken 7b70e85 Fixed #1721 - puppet.conf documentation incorrectly lists signals that affect the daemons @@ -1664,14 +1465,14 @@ a5fe87f Fixing a file source test that was failing because missing sources is now a failure 53b7d42 Fixing the broken tests resulting from the fix for #1551. 5ec6b07 Adding warnings when example groups are skipped. -54abe70 Moving some test/ package tests to rspec integration tests +54abe70 Moving some test/ package tests to rspec integration tests and disabling a gem test that hangs forever for me. 85d3ae0 Cleanup selboolean and selmodule unit tests to pass on non-SELinux systems a562ce5 Add unit test coverage for Puppet::Util::SELinux and fix problems found by tests 2b4aa0c Fixed #1639 - uninitialized constant Puppet::Type::User::ProviderUseradd 4265825 Fix #1636 - part2 - correct some client errors. 9c31db9 Add failing test for plugin with file and recurse 2853447 Fix several small regressions in plugins mount -2153bae Fixing #1640 - file groups now no longer get set on every run +2153bae Fixing #1640 - file groups now no longer get set on every run (this was a regression caused by other work I did). 80e5c11 Incremented CHANGELOG to 0.24.6 996ac46 Fix scenario when SELinux support tools exist, but SELinux is disabled d803096 Add new set of unit tests for selmodule type @@ -1681,7 +1482,7 @@ 4df51ea New and improved tests for file type SELinux contexts 253d4df Fix regression when templatedir doesn't exist. c7a6ef2 Fix #1202 - Collection attribute matching doesn't parse arrays -3281f2b Fixed #1633 - Added support for --detailed-exits to bin/puppet +3281f2b Fixed #1633 - Added support for --detailed-exits to bin/puppet which causes puppet to produce different exit codes depending on whether there were changes or failures in the transaction. 0b1e60f Adding an array indexer method to Puppet::Util::Metric as requested in #1633. 765db30 Adding partial spec tests for Puppet::Util::Metric. fb14e91 Fixed #1473 - Rescue Timeout::Error in xmlrpc clients @@ -1690,17 +1491,17 @@ 5268487 Fixed documentation, typo and added CHANGELOG entry 990e8e3 Fix #1530: Correctly parse ssh type 1 keys 06edac4 Fixed additional environments tests -79bb1f2 Rspec Tests for #381. +79bb1f2 Rspec Tests for #381. Moved part of the old resource reference tests to rspec. 750e9ab Fix #381 - Allow multiple resource overrides or references 782181e Minor test fix for #1614 614326a Fixing #1098 - Multiline strings now correctly increment the line count 1c6d57e Doing some simple refactorings on Puppet::Log -a774443 Fixing #1089 - Log messages are now tagged with the log level, +a774443 Fixing #1089 - Log messages are now tagged with the log level, making it easier to match messages in the 'tagmail' report. db7f108 Adding rspec tests for the Puppet::Util::Log class. d2c8998 Fixed #981 - Removed 'Adding aliases' info message d098a90 Fix failing tests dependent on /etc/user_attr file existing 6bcfd9f Fixing #947 - pluginsync no longer fails poorly when no plugins exist -67136f1 Fixing the Node class to no longer validate environments +67136f1 Fixing the Node class to no longer validate environments since #1614 removed that validation. a4110a3 Add SELinux context reset after file writes in Puppet::Util::FileType 250239e Add new support for :selrange SELinux file property c831482 Add detected defaults for existing SELinux file properties @@ -1717,19 +1518,19 @@ e32256a Migrating the apt and dpkg tests to rspec. ddda80a Update change log with RBAC roles d1abb86 Add role support to user type and an implemention -2fba85a Some small clarifying refactors and change to objectadd to allow subclasses of +2fba85a Some small clarifying refactors and change to objectadd to allow subclasses of with a uid not need to be a single class us use modify 4a863c3 Adding user_attr util to parse attributes on solaris 93f952a Fixed #1586 - Specifying "fully qualified" package names in Gentoo 8620775 Fixed #791 - You should now be able to create and find a user/group in one transaction. 63ad845 Refactoring and adding tests to the file group property. -7da4152 Modified the group and zone resource types to no longer call -ee57964 Modified the behaviour of resource-level 'retrieve' -- it only +7da4152 Modified the group and zone resource types to no longer call 'currentpropvalues' as a means of setting all values to absent. There should be no behaviour change from this change. +ee57964 Modified the behaviour of resource-level 'retrieve' -- it only calls 'retrieve' on each property if the resource exists. 0fb4693 Updating changelog for #1622 2afc4f5 Adding tests for the user retrieve method 679fede Removing commented code from the user type from about 2005 2480654 The Netinfo and DirectoryService providers can now create user and group simultaneously. 4c998fe Fixing #1622 - The user type only looks up groups when necessary. -6bc56ae Aliasing the rspec 'should' method to 'must' +6bc56ae Aliasing the rspec 'should' method to 'must' so it does not conflict with the RAL 'should' method. b9c75cd Rewriting the user tests, in preparation for enhancing them 99de920 Fixed #1620 - Add 'sles' to Puppet confines when 'suse' is used 4cf9710 Add parser for arbitrary expressions @@ -1749,10 +1550,10 @@ 2da6d19 Fixed #1608 - Added ubuntu to defaultfor for apt provider aa629ec Fixed #1607 - Added ubuntu to defaultfor for Debian service provider 774c0f9 Fixed #1588 - Fixed puppetca --clean --all -98e79f8 Fixed #1472 -- defined, exported resources in the current compile now get expanded +98e79f8 Fixed #1472 -- defined, exported resources in the current compile now get expanded correctly. 0040bc8 Fixed #1045 - Multiple metaparams all get added to resources. 8d5ded0 Removing some code in Parameter that is unnecessary. -5fbdc49 Fixed #1595 - Internally, Property#retrieve is no longer called +5fbdc49 Fixed #1595 - Internally, Property#retrieve is no longer called when no 'should' value is available for a resource. c16a5ae Only apply splay the first run 27f0c7d fix failing hpux user specs 7a3a38f Add rspec unit test for the append operator @@ -1761,7 +1562,7 @@ 0905734 Allow a templatedir to be colon separated. 11b0848 Fixed #1500 - puppetrun host regression 3b1d6e2 Fixed #1579 and #1580 - errors in the Puppet RPM spec file -77f4fb6 Fixed #1521 -- ldap user and group are now used with the default connection +77f4fb6 Fixed #1521 -- ldap user and group are now used with the default connection when available. a1a670b Fixed #1572 -- file purging now fails if remote sources do not exist. dd4f654 Fixing #1576 - moving all of the Puppet::Type code back into type.rb. 923fd89 Fixed issues with file descriptors leaking into subprocesses @@ -1779,14 +1580,14 @@ 41dc1fa Runit service provider aae0793 Daemontools service provider 29ae879 Fixes tests broken by 95aa085 -b50e718 Fixed #1488 - Moved individual functions out of functions.rb into +b50e718 Fixed #1488 - Moved individual functions out of functions.rb into the lib/puppet/parser/functions directory. New functions should be created in this directory. 5fb5091 Fixed #1457 - case insensitive match for error ded94f7 Removed spec color option for buildbot 415663b Added simple rake task for running unit tests 557be9d Added spec Rake task 0d118a5 Fix leaking LoadedFile when adding templates to be watched 67387e2 Fixed #1506 - Removed storeconfig duplicate indexes -7accb89 id column is autogenerated by rails as a primary key, there is no need +7accb89 id column is autogenerated by rails as a primary key, there is no need to create an additional index on this column. This changeset contains the new schema and a migration. c5fb092 Removed reference to namespaces from --genconfig documentation 1729de1 Updates to ext/puppetlast to support multiple hosts b6609ee Fixed #1508 - Add HP-UX package provider. @@ -1807,9 +1608,9 @@ 0147570 Fixed #1457 - removed confine warning fecdfbc A working script to create an OS X pkg out of the Puppet repository 6a2e71d Fixed #1441 - Updated console colours -404450a Add testing for the changes to resolve redmine #1427, where Kernel methods shadow -03c76de Expose all puppet variables as instance member variables of the template wrapper. -13069ec Ensure that we consistently use either string #{} interpolation or String.% +404450a Add testing for the changes to resolve redmine #1427, where Kernel methods shadow variables that the puppet template should otherwise see. Specific changes: +03c76de Expose all puppet variables as instance member variables of the template wrapper. This helps resolve redmine #1427, by providing a safe mechanism to access variables. +13069ec Ensure that we consistently use either string #{} interpolation or String.% interpolation, not both, to avoid issues where a #{} interpolated value contains a % character. 469c5fe Feature #1476: Allow specification of --bindir --sbindir --sitelibdir --mandir --destdir in install.rb 2a3d195 Specs for yaml indirector .search - I'm still learning! c97389d Made puppetlast work on 0.24.5 by using the YAML indirector @@ -1835,10 +1636,10 @@ d9aa5ab Fixing a cert test to pass on Darwin. 686ba4d Revert "Merging fsweetser's selinux patch against 0.24.4" f16da42 Merging fsweetser's selinux patch against 0.24.4 -a47fed4 'Fix' broken tests related to missing source raising +a47fed4 'Fix' broken tests related to missing source raising Issue 1437 In two cases, I removed the assertion that caused the failure. In one case, I changed the assertion to expect an exception. 238b8d7 Fixing #1438 -- mongrel and module tests now pass. ebb219e Fixed all of the fileserving termini so they use indirection requests. -d8937ac You can now select the encoding format when transferring the catalog, +d8937ac You can now select the encoding format when transferring the catalog, with 'yaml' still being the default but 'marshal' being an option. This is because testing has shown drastic performance differences between the two, with up to 70% of compile time being spent in YAML code. Use the 'catalog_format' setting to choose your format, and the setting must be set on the client. a0fa09f Revert "Fixed #1201 - all external node attributes are converted to strings." 8f8ce60 Fixed #1431 - Provider confines must now specify similar tests in one call. 7fa7251 The mongrel-related tests now run without mongrel. @@ -1874,12 +1675,12 @@ 84b5665 Updated test/ral/type/sshkey.rb test 5ef8979 Removed debugging from lib/puppet/util/ldap/connection.rb 6124c69 Renaming the Puppet::PropertyChange class to Puppet::Transaction::Change. -ba12d30 Fixed #1232 - the rundir no longer specifies a user/group, +ba12d30 Fixed #1232 - the rundir no longer specifies a user/group, and there are now client- and server-specific yaml directories. be169da Removing all of the code related to the interface type. 04ecb74 Doing what I can to fix #1128, but just in preparation for removing 'interface'. 2279acd Adding changes to config print that were missed in fix for 1183 a87885a Fixing the "describe" in the redhat interface specs -bd3f8e3 Fixed 1240 - puppet will function more like puppetd if graphing +bd3f8e3 Fixed 1240 - puppet will function more like puppetd if graphing or reporting are enabled. 7a6ae29 Add a missing test for exercising the last untested line of lib/puppet/type/ssh_authorized_key.rb 731d0f2 Minor documentation updates for ssh_authorized_key type c825c99 Fixing the ldap node terminus to merge facts with the right name. @@ -1888,12 +1689,12 @@ 38540d5 Fixing the ldap node integration test so it cleans up e03c1be Fixing #1382 - existing uppercase certs, keys, et al will be renamed. 5156230 Use generate instead of autorequire in the ssh_authorized_key type based on Luke's comments -d3a8125 Fixed #1006 - puppetrun --class works again. I added the class +d3a8125 Fixed #1006 - puppetrun --class works again. I added the class membership testing to the Ldap node terminus, and added tests, c1e010f Fixing the Node::Ldap.search method to use an indirection request. 4d22a95 Switching the ldap terminus to use Util::Ldap::Connection. b47d4e1 Added a 'search' method to the ldap node terminus. a1d1abd Adding an 'instance' class method to ldap connections. -ee9d002 Fixed #1114 - Facts in plugin directories should now be autoloaded, +ee9d002 Fixed #1114 - Facts in plugin directories should now be autoloaded, as long as you're using Facter 1.5. f1d5903 Fixing #1388 - the package test no longer uses 'require'. 8c5c949 ssh_authorized_key: autorequire, default permissions and cleanup 5a283d6 Fixing #1374 - Using Puppet::Type.type() in tests @@ -1908,7 +1709,7 @@ aedfa2b Fixed #1369 - the init service provider now supports HP-UX. 422dea0 issue 1183 d3a4d9a Updated Rakefile fixes #1367 -5f600dd Fixing #1168 (for 0.24.x) -- automatically downcasing the fqdn. +5f600dd Fixing #1168 (for 0.24.x) -- automatically downcasing the fqdn. Also requiring that passed in certnames be downcased; the setting system isn't currently flexible enough to automatically downcase it for the user. ac7f596 Fixed #1201 - all external node attributes are converted to strings. 6658463 Updating the changelog for the changes to node lookups. 1f19453 Removing the Node.find_by_name method. @@ -1919,7 +1720,7 @@ 75c94e3 Removing an obsolete, unimplemented test 98e38a6 Adds support for keepconfig for the dpkg provider fixes #234 4d70449 Fix bug in test, add more specs and small refactor -86f8ff4 Removed the unless condition in query, because the issue is a stale cached +86f8ff4 Removed the unless condition in query, because the issue is a stale cached value and added comments that query will now always do so. 4539b1c Issue 1215 7b2c310 Adding another note about the save_object stub. d816614 Fixing #1362 -- I had previously removed a stub point needed for testing. @@ -1931,9 +1732,9 @@ 4b29a5e Fixing how the indirection tests for whether the request has node info. 6764af3 Change description of spec to make baby jesus happy 946081b Try again -bdc578a Applying the fixes recommended by David Schmitt to the inline documentation of +bdc578a Applying the fixes recommended by David Schmitt to the inline documentation of the ResourceTemplate class. 886c984 Updating the docs for ResourceTemplate. -29c840a Adding a class for using templates directly within resources +29c840a Adding a class for using templates directly within resources (i.e., client-side templates). This would really only be used for composite resources that pass the results of the template on to generated resources. 1205881 The mongrel and webrick REST handlers now extract certificate information. e8044f9 Adding to the indirection request support for authentication information. dbd9b40 Updated fix for ticket #1271 @@ -1968,7 +1769,7 @@ ee04129 Refactored tests based on feedback from Luke. d7f25ff Rewritten tests for Puppet::Util::Storage. c5da401 Add unit tests for Puppet::Util::Storage -8008bbc Modified the 'factpath' setting to automatically configure +8008bbc Modified the 'factpath' setting to automatically configure Facter to load facts there if a new enough version of Facter is used. a02c6bb Fixing a mock in the redhat interface test. 390db80 Updated puppetd documentation which fixes ticket #1227 2d6a914 Fix for latest method in rpm provider (fixes #1224) @@ -2014,9 +1815,9 @@ 0a5d8a6 Fixed #1195 - support for gentoo openrc 4599791 Pushed schema patch for #1193 eac14f6 Fixed #1189 and added support for --all to puppetca --clean -d9846fc Fixishing some pending tests, including filling in -cb617f2 Making the changes necessary to get the REST support -a6a397b The 'destroy' method in the indirection now returns +d9846fc Fixishing some pending tests, including filling in the connection information. +cb617f2 Making the changes necessary to get the REST support to work with the current state of the indirection work, including using a request object and an expiration date. +a6a397b The 'destroy' method in the indirection now returns the results of destroying, so they can return true or false. 04aba52 fill out specs for network_* methods; refactor lowest-level network hooks a0804ae adding rest_connection_details helper to Indirector::REST -- will need to be overridden to lookup the real connection details aed1375 make sure unit indirector specs are working with #save; fill out network_put pending specs @@ -2041,31 +1842,31 @@ c2f8c69 the indirector will not serve xmlrpc (this is the responsibility of the legacy networking code; it was a mistake to include stubbed support for it in the new code); removing 13c40e9 removing obsolete TODO comment 2cdd0f8 puppet-compliant indentation -b49fd49 Resources now return the 'should' value for properties from -4aaad26 Modified the 'master' handler to use the Catalog class to +b49fd49 Resources now return the 'should' value for properties from the [] accessor method (they previously threw an exception when this method was used with properties). This shouldn't have any affect functionally; it just makes the method equivalent to 'should' for properties, but it works for all attribute types now. +4aaad26 Modified the 'master' handler to use the Catalog class to compile node configurations, rather than using the Configuration handler, which was never used directly. I removed the Configuration handler as a result. 2925ad1 Fixed #1184 -- definitions now autoload correctly all of the time. -376628d Removed the code from the client that tries to avoid recompiling -3718b64 Fixing #1173 -- classes and definitions can now have the same -d91b6d8 Fixing #1173 -- classes and definitions can now have the same -738889b Fixing the expire method (it wasn't using a request -f285f1a Moved the request creation into the Indirection +376628d Removed the code from the client that tries to avoid recompiling the catalog. The client will now always recompile, assuming it can reach the server. It will still use the cached config if there's a failure. +3718b64 Fixing #1173 -- classes and definitions can now have the same name as a directory with no failures. +d91b6d8 Fixing #1173 -- classes and definitions can now have the same name as a directory with no failures. +738889b Fixing the expire method (it wasn't using a request internally), and fixing the Facts class so it auto-expires any associated cached nodes when facts are saved. +f285f1a Moved the request creation into the Indirection class instead of the Indirector module. Also, added an 'expire' method to the indirector, so there's an easy way to expire cached instances. d420701 Making the log messages around caching better. d82ac98 Fixing the executables to use the new indirection api. -7774d9c Ported the rest of the indirection terminuses over to +7774d9c Ported the rest of the indirection terminuses over to expecting requests instead of having a random interface. bf728d2 Intermediate commit. -644d6ba Fixing some tests that were failing because new base types -768315b Adding the ability for indirection requests to be created +644d6ba Fixing some tests that were failing because new base types were added to Naginator, but no new related resource types were added. +768315b Adding the ability for indirection requests to be created with instances instead of just keys. 38f0f48 Fixing an errant comment -69a321f Fixing the tests that were failing because of the use -f9881ed Adding a Request class to the Indirection layer. This +69a321f Fixing the tests that were failing because of the use of the indirection request object. +f9881ed Adding a Request class to the Indirection layer. This class is currently only used internally by the Indirection instances, but I expect that I will soon be pushing it to all of the terminus types. 4032a27 Fixing the integration tests related to the destroy fix. Yay. -0bd5799 Fixing one other test that was failing because of the change -941177a Changing how destroy works, just a bit -- it now accepts -c6729d1 Reworking the caching layer to use TTLs instead of versions +0bd5799 Fixing one other test that was failing because of the change to Indirection#destroy. +941177a Changing how destroy works, just a bit -- it now accepts the name of the instance to be destroyed, rather than the instance itself. +c6729d1 Reworking the caching layer to use TTLs instead of versions based on timestamps. This just modifies the indirection class itself, there is still some work to do to remove version code from other classes. 8e1e06f Removing unused code from the file_serving/metadata class. -1458123 Adding an envelope module to handle indirected instance +1458123 Adding an envelope module to handle indirected instance expiration. bd858df Changing the default environment to production. -80f8b80 Adding validation to the user type to confirm that the +80f8b80 Adding validation to the user type to confirm that the group list does not contain any commas. This seems to be a common problem. 92765ea Making a test executable 7295626 Used stubs to decouple our code behavior from the behavior of the underlying filesystem, as well as removing the need to sleep (which caused the tests to take a long time). 911c7fb Additional fix for emacs syntax for ticket #1160 @@ -2076,7 +1877,7 @@ 2036d22 Fixes debian service enabled/disable issue as detailed in #1161. 1c02749 Committed patch from #1160 335972e Pushed patch to fix #1174 -6f32e95 Adding the report reference back; I don't really know +6f32e95 Adding the report reference back; I don't really know why I removed it, since the information in it isn't anywhere else. f927b97 Updates to rrdgraph documentation e51d05c Better fix for #1020 4a39d64 Revert "Added updated fix for #1020" @@ -2084,7 +1885,7 @@ eae5cee Fixing a duplicate word in the mount docs 4f8df98 Added updated fix for #1020 aa830b9 Adding 0.24.4 header to the changelog -4c63b69 Add a bunch of directives, allows a full parse of stanford's huge nagios config +4c63b69 Add a bunch of directives, allows a full parse of stanford's huge nagios config Also reformatted a bit 9d30b26 Fixes #1148 - replaces #!/usr/bin/ruby with #!/usr/bin/env ruby. 874a02f Added check_puppet.rb Nagios check plugin (See #1162) 491a696 I think this will include the man pages in the build but overall the Rakefile needs a rewrite @@ -2096,20 +1897,20 @@ 3a8053a Updated to version 0.24.4 d3e4ed7 Updated to version 0.24.4 55a9009 Pass source to pkg_add via the PKG_PATH environment variable if -6a53519 Fixing #571 -- provider suitability is now checked at resource +6a53519 Fixing #571 -- provider suitability is now checked at resource evaluation time, rather than resource instantiation time. This means that you don't catch your "errors" as early, but it also means you should be able to realistically configure a whole host in one run. 528bbf1 Fixing a couple of tests. -017f673 Moved the configuration of the Node cache to the puppetmasterd +017f673 Moved the configuration of the Node cache to the puppetmasterd executable, since it otherwise causes caches to be used in all cases, which we don't want (e.g., bin/puppet was using them). bd3f6ec Disabled man page creation by default and updated CHANGELOG -4bfc4ef Modifying the way ensure is handled so that it supports -d93e1b4 Fixing #1138 -- the yamldir is automatically created by the -273c7ec Disabling http keep-alive as a means of preventing #1010. -6aa6fdb Applying patch by Ryan McBride to fix OpenBSD package +4bfc4ef Modifying the way ensure is handled so that it supports having it be a parameter. This is only useful if you want a composite resource that just generates other resources and passes the value on. +d93e1b4 Fixing #1138 -- the yamldir is automatically created by the server now that it's in the :puppetmasterd section rather than a separate :yaml section. +273c7ec Disabling http keep-alive as a means of preventing #1010. There is now a constant in Puppet::Network::HttpPool that will disable or enable this feature, but note that we determined that it can cause corruption, especially in file serving (but it's client-side corruption). +6aa6fdb Applying patch by Ryan McBride to fix OpenBSD package matching. The actual problem was caused by the fix to #1001. 5a31959 Added man pages and man page creation logic to install.rb e5b16b2 Ported #198 man page creation functionality to 0.24.x branch -18320b8 Found all instances of methods where split() is used without -f6325dc Found an array that leaked pretty quickly between reparsing +18320b8 Found all instances of methods where split() is used without any local variables and added a local variable -- see http://snurl.com/21zf8. My own testing showed that this caused memory growth to level off at a reasonable level. Note that the link above says the problem is only with class methods, but my own testing showed that it's any method that meets these criteria. This is not a functional change, but should hopefully be the last nail in the coffin of #1131. +f6325dc Found an array that leaked pretty quickly between reparsing files, thanks to work by Adam Jacob and Arjuna Christenson (the finding, not the leak). I'm going to act like this fixes #1131, at least for now, but I doubt it does, since that shows general memory growth over time, whereas the leak here should go away as soon as files are reparsed (because the parser is holding the reference to the leaking array). 25b81b3 Fixing a test I broke with my fix to #1147 -4f400d4 Fixed #1147: Cached nodes are correctly considered out of +4f400d4 Fixed #1147: Cached nodes are correctly considered out of date if the node facts have been updated (thus causing node facts to again be available in manifests, for those cases where they were not). 54bedb2 tweak the (already applied) patch in 388cf7c3df7ce26e953949ed6fe63d76cbbb3691 to resolve #1137; also, add tests which detect the problem. a240969 Applying patch by wyvern to fix #1142. e00065a * puppet/ext/emacs/puppet-mode.el (puppet-indent-line): Clean up the code somewhat after commit 738d275f41f3eaf015800021dd2dfe6c42a1ae79, as promised. @@ -2117,7 +1918,7 @@ d1d408c Fix bug mentioned in commit f814e23eab140ad01df4a4a3b187fcbf20da02be: 7514057 * ext/emacs/puppet-mode.el (puppet-comment-line-p, puppet-in-array): New helper functions. (puppet-indent-line): Rewrite to handle three more situations: indent elements in an array, indent single-line blocks, and ignore previous comment content when indenting non-comment lines. 40a389a * ext/emacs/puppet-mode.el: Untabify, in preparation for substantive changes. -0c45a5a Adding another commit for #1136 -- Consolidated +0c45a5a Adding another commit for #1136 -- Consolidated the setting of the loglevel and destination to just one call, rather than the multiple calls that remained. 4ce1d37 Fixed ports documentation error c75cc42 Added more detail about the requirement for ruby-libshadow for useradd password management 1dc6dc2 Final fix to #1136 - further changes to --test setting @@ -2125,15 +1926,15 @@ 2155fe1 Fix for ticket #1136 --verbose cancels out --debug 4cc18ed Applied patch in #1134 2795ba4 fixing another failing test -a40e9b7 Fixing some tests that only failed under certain -7d35ae8 Refactoring how the catalog creation handles errors. +a40e9b7 Fixing some tests that only failed under certain circumstances (mostly, when loaded with other files, or when loaded from rake or autotest rather than separately). +7d35ae8 Refactoring how the catalog creation handles errors. Previously, if there were an error creating a resource, the error would propagate leaving any previously created resources still in memory. 1b3c85b Removing extra debugging 2d90468 Fixing a unit test for node integration -e81fc58 Settings now (again?) do not use a section more than -fca467d Removing explicit requires of types and providers, -34129d9 Removing obsolete code from the fileserving handler. +e81fc58 Settings now (again?) do not use a section more than once, which should make the system a bit more efficient. +fca467d Removing explicit requires of types and providers, because they were conflicting with Puppet's autoloading. This is clearly a sign that our autoloading is silly, if Ruby's own loading easily makes it unhappy. +34129d9 Removing obsolete code from the fileserving handler. This was obsoleted in 0.24.2. f62eec8 updating resource references in the docs -d0554db Hopefully *finally* fixed the "already being managed" problem +d0554db Hopefully *finally* fixed the "already being managed" problem (#1036). The problem only cropped up if there was a failure when trying to manage the system -- this would cause the setting-based resources not to get cleaned up. 13c6de3 Adding a rake taks for updating the trac docs 0.24.3 @@ -2143,28 +1944,28 @@ 18ed28b Updating changelog for 0.24.3 ab72048 Removing a Settings.use that is unnecessary bba0b43 Downgrading the "Using cache" message from the indirection to debug -1dc0e24 Modified the ldap node terminus to also use the facts version -4a45a1d Caching node information in yaml (I figured caching in memory will -f3a304c Modifying the yaml terminus base class to use the timestamp +1dc0e24 Modified the ldap node terminus to also use the facts version as the version for a node, which should similarly encourage the use of the yaml cache. (Related to #1130) +4a45a1d Caching node information in yaml (I figured caching in memory will cause ever-larger memory growth), and changing the external node terminus to use the version of the facts as their version. This will usually result in the cached node information being used, instead of always hitting the external node app during file serving. Note that if the facts aren't changed by the client, then this will result in the cached node being used, but at this point, the client always updates its facts. (#1130) +f3a304c Modifying the yaml terminus base class to use the timestamp of the yaml file as the version of the object. 8b29368 Adding a filebucket test to puppet-test da77cb6 Adding a test for local compiling 405802e Using the indirected facts rather than master.getfacts, so no factsync is used 388cf7c Regression in :node_name functionality 872ced7 Flat file now does writing to a tempfile. -4956323 Fixing #1132 -- host names can now have dashes anywhere. -ecb873d Fixing #1118 -- downloading plugins and facts now ignores noop. +4956323 Fixing #1132 -- host names can now have dashes anywhere. (Patch by freiheit.) +ecb873d Fixing #1118 -- downloading plugins and facts now ignores noop. Note that this changes the behaviour a bit -- the resource's noop setting always beats the global setting (previously, whichever was true would win). e2370b3 Fixing the service-stop on debian, using the patch provided by DavidS e8029cc Fixing the "tidy" type to use an option hash for specifying its parent class c955f61 updating changelog for already-closed tickets eecc22c Cache the same type we check for, hopefully fixes #1116 f1216f8 Revert "Cache the same type we check for, hopefully fixes #1116" ca0b62a Cache the same type we check for, hopefully fixes #1116 -35214eb Fixing the rest of #1113: External node commands can specify -2261032 Partially fixing #1113: LDAP nodes now support environments, +35214eb Fixing the rest of #1113: External node commands can specify an environment and Puppet will now use it. +2261032 Partially fixing #1113: LDAP nodes now support environments, and the schema has been updated accordingly. 4c0f6c8 Fix for 1094 -647f5b4 Always duplicating resource defaults in the parser, so that +647f5b4 Always duplicating resource defaults in the parser, so that stacked metaparameter values do not result in all resources that receive a given default also getting those stacked values. ee8fac6 Changed name of method for clarity per code review -8192475 Ticket #1041 +8192475 Ticket #1041 The CA serial file was getting owned by root because it was using a different method to write to file 4c47656 Applies patches from #1111 and #1112 443db20 Fix tests depending on the Puppet[:localcert] file existing using stubs 8627139 Updating version number @@ -2178,52 +1979,52 @@ 6faed12 updating changelog for 0.24.2 ee88c58 Applying patch by DavidS to fix #1083. a7339ec Fixing a few tests -e008b02 Fixing #1110 -- transactions now always make sure -65b7267 Fixing the fact that resources that model defined resources +e008b02 Fixing #1110 -- transactions now always make sure their tags are arrays. +65b7267 Fixing the fact that resources that model defined resources were getting finished multiple times, which meant they got multiple copies of metaparams. 4c3fa78 Fixing a few more loading order issues. 857814a Fixing tests that did not work with Rails 2. -7ca0ad6 Fixing a test that changed the environment for all later tests, +7ca0ad6 Fixing a test that changed the environment for all later tests, thus breaking some of them. 9b07758 * Tweaks for puppetshow UI cleanup -0139889 * Add migration for "created_at" (hobo expects it) +0139889 * Add migration for "created_at" (hobo expects it) * Tweaks for puppetshow interface cleanup * Delete unused tagging lib and puppet_class model 43aea83 renaming ral/types to ral/type in the tests -879ee22 Fixing #1062 by moving the yamldir setting to its own yaml -fd1573f Fixed #1047 -- Puppet's parser no longer changes the order -9d6e926 Fixed #1063 -- the master correctly logs syntax errors when -abd688e Fixing #1092 by no longer using the resource reference to +879ee22 Fixing #1062 by moving the yamldir setting to its own yaml section. This should keep the yamldir from being created on clients. +fd1573f Fixed #1047 -- Puppet's parser no longer changes the order in which statements are evaluated, which means that case statements can now set variables that are used by other variables. +9d6e926 Fixed #1063 -- the master correctly logs syntax errors when reparsing during a single run. +abd688e Fixing #1092 by no longer using the resource reference to look resources up, which means there's no concern about not finding the resource, which is where the nil was coming from. We now just iterate over the vertices. 29aafb4 Fixing an integration test so it cleans up after itself 82b02b9 Fixing #1101 -- puppetrun works again. -dd17d4c Fixing #1093 -- 0.23.2 clients are again compatible +dd17d4c Fixing #1093 -- 0.23.2 clients are again compatible with 0.24.x servers. :ignore links is now equivalent to :manage links. c0b5352 testing automatic commit emails -614ab9f Adding a 'control' parameter to services, for those -bb8051b Removed the loglevels from the valid values for 'logoutput' +614ab9f Adding a 'control' parameter to services, for those service types that need a control variable to enable/disable. +bb8051b Removed the loglevels from the valid values for 'logoutput' in the Exec resource type -- the log levels are specified using the 'loglevel' parameter, not 'logoutput'. This never worked, or at least hasn't for ages, and now the docs are just correct. ff4f65a replacing tabs with spaces in the redhat interface provider f3db79e Fixing a typo in the mailalias resource type -4e55999 Removing the validation on package sources, since -42bfdf2 Fixing #1085, I think -- I was not returning a resource -1258512 Fixing #1084 -- the node catalog asks the individual +4e55999 Removing the validation on package sources, since some platforms (e.g., hpux) do not have a well-formed requirement for the source. +42bfdf2 Fixing #1085, I think -- I was not returning a resource if the class had already been evaluated, but this was only being run into in corner cases -- mostly where one class included another class, I assume. +1258512 Fixing #1084 -- the node catalog asks the individual resources whether they're isomorphic, and they in turn ask the resource types (or default to true for defined resource types). 9a33487 adding a comment to the namespaceauth.conf file 04892ee Adding an example namespaceauth.conf f0975df Trac #1038: not a fix, just an attempt at improving the situation. c8b320e Corrected #1040 fix - this should now be right - trace was after raise -07cd482 Making a couple of other small fixes, requiring -ff97059 Somewhat refactored fileserving so that it no longer caches +07cd482 Making a couple of other small fixes, requiring classes that were not being required in the right order. +ff97059 Somewhat refactored fileserving so that it no longer caches any objects, nor does it use Puppet's RAL resources. In the process, I fixed #894 (you can now copy links) and refactored other classes as necessary. Mostly it was fixing tests. 939c952 Fixes ticket #1080 f184228 Fixes ticket #1079 - added . support for tags -9b6e501 Fixing a test that was failing when a user-specific +9b6e501 Fixing a test that was failing when a user-specific fileserver.conf actually exists. 5d35bc5 Fixes #1078 and includes new test 7976015 Removing a test I never migrated from test/unit. -279a0c5 Fixing a test that was actually reading in keys +279a0c5 Fixing a test that was actually reading in keys from the filesystem and failed when those keys were unreadable. 098a69c updating checksum for #1010 fix b06767e Quashed commit of my fixes for #1010. -5e18b8d Hasstatus in the init service provider; it was just +5e18b8d Hasstatus in the init service provider; it was just doing a boolean check, rather than comparing to :true. 60f18c2 Fixed minor documentation error 39a6756 Fixed #1073 - moved show_diff and other logic post config parse f006e17 Fixed test for #1040 1f0ea5a Second attempt fix address ticket #1040 39f9818 Removing some extraneous debugging from a test. d82bfd8 Attempt to fix #1040 - catching errors in compilation -e830f28 Fixed #1018 -- resources now have their namevars added as -60dd569 Fixed #1037 -- remote unreadable files no longer have the +e830f28 Fixed #1018 -- resources now have their namevars added as aliases in the resource catalog, just like they were added in the resource classes. +60dd569 Fixed #1037 -- remote unreadable files no longer have the permission denied exceptions caught, thus forbidding them from being replaced with 'nil'. 2de4654 converting parser ast node specs from setup/teardown to before/after 9927efb converting parser ast host class specs from setup/teardown to before/after c86c1da converting node catalog specs from setup/teardown to before/after @@ -2246,8 +2047,8 @@ d04567a converting indirection specs away from setup/teardown to rspec compatible before/after usage aa14ce7 moving setup() methods to before :each, so that the tests will run with rspec, as opposed to just rake (which calls them directly with ruby, as opposed to any spec binary) f9f32c4 reordering spec binaries to prefer the local vendor/gems/rspec/bin/spec option -d11cd39 Fixing a failing test that resulted from a change -62d7616 Fixing the directory service provider's behaviour +d11cd39 Fixing a failing test that resulted from a change in how checksums are created. +62d7616 Fixing the directory service provider's behaviour when there's no value for a given attribute. f087df0 Fixed ticket #1072 - Debian directory updates 0eede76 Fixed Ticket 1009 - problem with plist xml parser. We do not need the plist parser for pkgdmg. 458cb23 Fixed ticket #1070 - puppetrun configuration parse problem @@ -2255,48 +2056,48 @@ 10d4d0e Fixed ticket #1065 - Solaris SMF manifests 8fa4120 Fixed ticket #1068 - Minor documentation fix 30128bd Really minor change to user creation in Leopard. -6013b25 Refactoring the incremental checksum generation -aebd303 Enhancing the stand-alone checksums utility module +6013b25 Refactoring the incremental checksum generation slightly based on the code in type/file/checksum.rb. +aebd303 Enhancing the stand-alone checksums utility module with the rest of the checksums we're likely to use, and adding tests, which I somehow missed when I wrote this file. df3fbc7 Fixed #1060 - Debian service removal and addition -5ef8a3e Changing portage to use Puppet::Error instead of Puppet::PackageError, +5ef8a3e Changing portage to use Puppet::Error instead of Puppet::PackageError, fixing #1059. c4f7c51 Fixing comment -- ticket #1027 instead of #1064 -8920557 Fixing #1064 -- providers et al are now autoloaded +8920557 Fixing #1064 -- providers et al are now autoloaded from modules even when Autoload#loadall is used. 4829711 removing "lib" deprecation notice from autoloader -f8afe13 Fixed #1043 -- autoloading now searches the plugins directory -fe02591 Fixed #1003 -- Applying DavidS's patch to fix searching for +f8afe13 Fixed #1043 -- autoloading now searches the plugins directory in each module, in addition to the lib directory. The 'lib' directory is also deprecated, but supported for now to give people a chance to convert. +fe02591 Fixed #1003 -- Applying DavidS's patch to fix searching for tags in sql. 9b1bfc1 Fixed #992 -- Puppet is now compatible with gems 1.0.1. -0cfa1d2 Fixed #968 again, this time with tests -- parseonly works, -8367fdf Renaming the 'pfile' and 'pfilebucket' files to plain -a42c3ae Fixed #1021 -- the problem was that my method of determining +0cfa1d2 Fixed #968 again, this time with tests -- parseonly works, including not compiling the configurations, and also storeconfigs is no longer required during parse-testing. +8367fdf Renaming the 'pfile' and 'pfilebucket' files to plain 'file' and 'filebucket'. This should have been done years ago. +a42c3ae Fixed #1021 -- the problem was that my method of determining the in-degree sometimes resulted in a lower number than the number of in-edges. d406353 Removing the last vestiges of GRATR from the PGraph class -068b61e Removing obsolete references (they're in the indirection +068b61e Removing obsolete references (they're in the indirection reference), and adding error handling to puppetdoc. 98dbfa2 Loading the mocha gem from the puppettest.rb file. -12fa0fa Fixing the Rakefile so all tests run in one task instead -cb5def4 'rake' within the spec dir works now, anyway, which is +12fa0fa Fixing the Rakefile so all tests run in one task instead of multiple. +cb5def4 'rake' within the spec dir works now, anyway, which is a good start. Autotest still doesn't work, though. eb74033 Fixing the puppet_rspec autotest plugin to use the modern interface 1b90f7f Trying to upgrade rspec, but not having much luck. -bcb9b56 Copying over Rick's work from the master branch supporting autotest and +bcb9b56 Copying over Rick's work from the master branch supporting autotest and cleaning up the rspec support. 3af6827 Adding an inflection util class. -7e45553 Fixed #997 -- virtual defined types are no longer evaluated. -c8da318 Moving the ast node tests to rspec (which I could have -8b2fae0 Removing the last remaining vestiges of GRATR -- -cf21ade Switching the Node catalog to use the Tagging module +7e45553 Fixed #997 -- virtual defined types are no longer evaluated. NOTE: This introduces a behaviour change, in that you previously could realize a resource within a virtual defined resource, and now you must realize the entire defined resource, rather than just the contained resource. +c8da318 Moving the ast node tests to rspec (which I could have *sworn* I did this weekend). In the process, I fixed a couple of bugs related to differentiating between nodes and classes, and then cleaned up quite a few error messages. +8b2fae0 Removing the last remaining vestiges of GRATR -- removing the bangs from 'add_vertex!' and 'add_edge!'. +cf21ade Switching the Node catalog to use the Tagging module instead of its own tag methods. 744cd45 Added a 'tagged?' method to the Tagging module. -d21416b Switching the Node Catalog to using a separate method -fd0c5cb Changing the name of the Compile class to Compiler, -5ebaa89 Refactoring the interface between the Compile class -e247b56 Changing some methods in the Compile class to -6a4cf6c Fixed #1030 - class and definition evaluation has been significantly -3b740ff Converting the Compile class to use a Node::Catalog instance -194e730 Moving all of the tests for Puppet::Parser::Compile to -fb4bdc0 More AST refactoring -- each of the code wrapping classes -5a0e34b Refactoring the AST classes just a bit. I realized that +d21416b Switching the Node Catalog to using a separate method for validating that a given resource is unique within the catalog. This no longer allows any duplication, even with Execs. +fd0c5cb Changing the name of the Compile class to Compiler, since it's stupid to have a class named after a verb. +5ebaa89 Refactoring the interface between the Compile class and the AST::Node class to match that to the definitions and AST classes. +e247b56 Changing some methods in the Compile class to be more internally consistent (switched store_resource to add_resource, and store_override to add_override). +6a4cf6c Fixed #1030 - class and definition evaluation has been significantly refactored, fixing this problem and making the whole interplay between the classes, definitions, and nodes, and the Compile class much cleaner. +3b740ff Converting the Compile class to use a Node::Catalog instance as its resource container, instead of having its own behaviour around resource uniqueness. +194e730 Moving all of the tests for Puppet::Parser::Compile to rspec, so I can refactor the class to more heavily rely on a Node::Catalog instead of doing its own resource container management. +fb4bdc0 More AST refactoring -- each of the code wrapping classes just returns a resource from its evaluate() method, and all of the work is done in the evaluate_code method. This makes the code cleaner, because it means 1) evaluate() has the same prototype as all of the other AST classes, 2) evaluate() is no longer called indirectly through the Parser Resource class, and 3) the classes themselves are responsible for creating the resources, rather than it being done in the Compile class. +5a0e34b Refactoring the AST classes just a bit. I realized that all of the evaluate() methods only ever accepted a scope, and sometimes one other option, so I switched them all to use named arguments instead of a hash. 82720d5 Removing some obsolete code from the AST base class dbaffae Ceasing autoloading ast files; loading them manually instead 7c500da Stubbing Facter during the snippet tests, so they are faster and work with no network 084d0fb Adding more information to dependencies that do not resolve -b293763 Applying patch by Jay to fix #989 -- missing crl files are -2931723 Fixing the Settings class so that it correctly handles +b293763 Applying patch by Jay to fix #989 -- missing crl files are correctly ignored, and you now use 'false' instead of 'none' to explicitly ignore them. +2931723 Fixing the Settings class so that it correctly handles file values that are false. f7b0ca9 Fixed #1052 - fixed gentoo service management b3f67ec Fix ticket 974. My original "fix" wasn't. This actually fixes the problem by using a regular expression that matches only up to the first square bracket. 8f0d87d Added :env parameter for backwards-compatibility, with warning about deprecation. :env parameter sets new :environment parameter. Changed instances of :env to :environment for consistency with other types. Added tests for new parameters. This cimmit fixes ticket 1007. @@ -2305,29 +2106,29 @@ b8036a9 Updating the docs for the cron type 28a8577 Added hostname test for hosts type 16df87c Updated fix for ticket #151 and added a test -ed0c745 Fixing #1017 -- environment-specific modulepath is no -ade9f3c Store a resource before adding relations to it otherwise activerecord will +ed0c745 Fixing #1017 -- environment-specific modulepath is no longer ignored. (Cherry-picked from master.) +ade9f3c Store a resource before adding relations to it otherwise activerecord will complain. This fixes #933 047ec54 Fixed tickt #1034 - doco typo -6ff9423 Significantly refactoring the lexer, including adding Token and TokenList +6ff9423 Significantly refactoring the lexer, including adding Token and TokenList classes for managing how the tokens work. 11799b3 Fixed #1001 348aa3e Fixed #1028 - examples incorrect for 0.24.x 974fcdb Removed womble-specific Debian build section 321b8fd Fixed #1006 - changed ldapnodes to node_terminus ee6ddc9 Removing tons of unnecessary calls to "nil?" from the lexer. -7a4935f Fixing a couple of tests, one related to recent tagging changes +7a4935f Fixing a couple of tests, one related to recent tagging changes and one that somehow slipped through when I removed the GRATR code. 9a290bb Second attempt to fix ticket #151 - host type now validates IP addresses and hostnames/FQDNs 4a7fcfc Revert "Fixes ticket #151 - host type now validates IP addresses and hostnames/FQDNs - the regex for the latter is quite complex but I have found it bullet-proof in the past" b561ae6 Fix bug #997, only evaluate non-virtual definitions 1ccc9c3 Fixes ticket #151 - host type now validates IP addresses and hostnames/FQDNs - the regex for the latter is quite complex but I have found it bullet-proof in the past d7a89b4 Fixed #1019 - made libshadow available for non-Linux users -8a649ff I think I've finally fixed #959, by having the Settings +8a649ff I think I've finally fixed #959, by having the Settings class skip any resources that are already in memory. 52eba77 Fixing #794 -- consolidating the gentoo configuration files. -f43be56 Removing the line that marked fink as the default package -f98be4a Fixing #976 -- both the full name of qualified classes and -2cbab2c Fixing #1008 -- Puppet no longer throws an exception -f5674cd Fixing #995 -- puppetd no longer dies at startup if the -7a9aae8 Wrapping the Resolv call in the mongrel server so if it -9161ae8 Applying a fix for #998 -- I used a patch equivalent to +f43be56 Removing the line that marked fink as the default package manager on darwin. +f98be4a Fixing #976 -- both the full name of qualified classes and the class parts are now added as tags. I've also created a Tagging module that we should push throughout the rest of the system that uses tags. +2cbab2c Fixing #1008 -- Puppet no longer throws an exception when you've pointed a file at a source that doesn't exist and you specify 'ensure'. +f5674cd Fixing #995 -- puppetd no longer dies at startup if the server is not running. +7a9aae8 Wrapping the Resolv call in the mongrel server so if it fails it doesn't kill the server. +9161ae8 Applying a fix for #998 -- I used a patch equivalent to bartv's, although I could not use his commit because it was against the 'master' branch instead of 0.24.x. 046a326 Fixing #977 -- rundir is again set to 1777. 4618140 Updating docs for ssh. 7ee4746 Adding a parse test to puppet-test. @@ -2336,20 +2137,20 @@ 1ff9d65 Updated documentation for builtin cron type; added information about range and step syntaxes. f15696c Updated tagmail documentation fixing ticket #996 e3d4ea8 Fixes ticket #993 - tagmail with smtpserver specified does not add To/From/Subject header -40addcd Fixing #982 -- I have completely removed the GRATR graph library -927dff4 Fixing #971 -- classes can once again be included multiple -117926c Fixing the unit tests for nagios_maker; I could swear I'd already -a7bca7e Removing the requirement in the parsed mount provider +40addcd Fixing #982 -- I have completely removed the GRATR graph library from the system, and implemented my own topsort method. +927dff4 Fixing #971 -- classes can once again be included multiple times. +117926c Fixing the unit tests for nagios_maker; I could swear I'd already done this but I must not have committed it. +a7bca7e Removing the requirement in the parsed mount provider that the fstab file exist. 1bdf3f8 Fixed #984 - Added Debian to reponsefile doco b1f13af Fixed #980 - minor wiki formatting error in nagios_maker.rb 2f9c13b Fixed ticket #979 - code configuration option doco 039dc8d Fixed ticket #979 - pkgdmg.rb documentation 1154c42 Fixed ticket #978 - logcheck/puppet -33e319a Added builtin support for all Nagios resource types. +33e319a Added builtin support for all Nagios resource types. I use Naginator to parse and generate the files, with ParsedFile to handle record management and the like. 68cde4f Removing the one-off naginator provider for nagios_command. -348f257 Adding the metaprogramming to create the Nagios types -4e8bc40 Fixing the inability to manage '/' directly. It was a result -9b1d036 Adding the first round of Nagios code. There are no +348f257 Adding the metaprogramming to create the Nagios types and Naginator providers. This is basically all of the code that's necessary to create all of the needed Nagios types. +4e8bc40 Fixing the inability to manage '/' directly. It was a result of stripping extra and trailing slashes. +9b1d036 Adding the first round of Nagios code. There are no tests here, but at least a single Nagios type is functional. Now I need to do some metaprogramming so this works for all nagios types, and add tests for the whole thing. 20367c6 Updated for 0.24.1 20d430d Adding 0.24.1 tag to the changelog. @@ -2358,60 +2159,60 @@ 4fa6546 Updated to version 0.24.1 d17fb7a Updated to version 0.24.1 40439da Updating an exception message a bit. -e2fc425 Attempting to fix #952 -- catching any exceptions thrown -c59ff62 Further fixes toward #965. Turned out that the previous fix -4d28b10 Updating the failure when the CRL is missing, so it's -e4446b6 Fixing parseonly with a modified version of jay's -bc0616e Updating filetype detection for vim, and changing -927cb24 Fixing #967 -- default resources no longer conflict with -c998a25 Adding a --print option to puppetca that just prints the full-text version of a -9c32c9c Removing the ability to disable http-keep alive, -553b2ad Entirely refactoring http keep-alive. There's now -92b0ebc Fixing #967 -- relationships now work when running 0.23.x clients -1ada24d Fixing some tests that were failing with the recent ruby that has +e2fc425 Attempting to fix #952 -- catching any exceptions thrown during a run. +c59ff62 Further fixes toward #965. Turned out that the previous fix caused other problems. +4d28b10 Updating the failure when the CRL is missing, so it's clear how to solve the problem. +e4446b6 Fixing parseonly with a modified version of jay's patch from #968. +bc0616e Updating filetype detection for vim, and changing the filestructure for vim files. (#900 and #963) +927cb24 Fixing #967 -- default resources no longer conflict with managed resources. +c998a25 Adding a --print option to puppetca that just prints the full-text version of a certificate, and --verify, which uses the external openssl command to verify the cert against the CA cert (I could not find an option to the builtin Ruby libraries to do this). +9c32c9c Removing the ability to disable http-keep alive, since it didn't work and is now unnecessary. +553b2ad Entirely refactoring http keep-alive. There's now a central module responsible for managing the http pool (Puppet::Network::HttpPool), and it also handles setting certificate information. This gets rid of what were otherwise long chains of method calls, and it makes the code paths much clearer. +92b0ebc Fixing #967 -- relationships now work when running 0.23.x clients against 0.24.0 servers. +1ada24d Fixing some tests that were failing with the recent ruby that has ssl issues. c22a584 Uninstalling packages through 'ensure => absent' works again for the rpm and yum providers. 8f5989a Updated for 0.24.0-2 cc2d532 Updated for 0.24.0 -933b1df Fixing #961 -- closing existing, open connections when -e0dab9a Updating changelog to reflect the fact that we no +933b1df Fixing #961 -- closing existing, open connections when a new connection is requested, and closing all connections at the end of each run. +e0dab9a Updating changelog to reflect the fact that we no longer warn about explicit plugin mounts. 4d3a368 Remove the warning about an explicit plugins mount. -178093f Fixing the Rakefile to include the yumhelper.py file in +178093f Fixing the Rakefile to include the yumhelper.py file in the file list. 0.24.0 ====== 6b02bd5 Updated to version 0.24.0 e92f1cc Updated to version 0.24.0 22daebe Adding changelog update for misspiggy/0.24.0 -e0f5444 Fixing the webrick test to provide a correct host -106f319 Changing the statefile to only being managed by clients, -4ebb8d0 Hopefully finally fixing #959. Loading the stored cache -690e287 This should be the last fix for exported resources. +e0f5444 Fixing the webrick test to provide a correct host name so the stupid ssl checks pass during the test. +106f319 Changing the statefile to only being managed by clients, not by puppetmasterd. +4ebb8d0 Hopefully finally fixing #959. Loading the stored cache resulted in the resource duplication, based on how the settings are used, so I added a test to only use those settings if the directories do not exist. +690e287 This should be the last fix for exported resources. Hosts were keeping the export bit on all resources, even when they'd collected another host's resources, which caused a duplicate copy that was still exported. f1169ee Not using the main section when running the store report, since it is unneeded and can cause conflicts within puppetmasterd ce5cab1 Removing extraneous debugging from the schedule resource type. cb0c4ee Renaming 'configuration' to 'catalog', fixing #954. -7ac3bd7 Renaming the 'null' terminus type to 'plain', as -a21ee00 Copying the fact-loading code from the network client to +7ac3bd7 Renaming the 'null' terminus type to 'plain', as requested in #960. +a21ee00 Copying the fact-loading code from the network client to the Facter terminus until I have a better solution. This problem was discovered becomes of #958. 1bbaf18 Applying patch by whaymond to fix #955. -d9200a0 Adding what is hopefully the last commit for #896. Here's the -74db777 Removing the 'addpath' commands from the freebsd service -b19a0c9 Removing the recently-commited paludis provider, -02b64ab Applying patch by josb in #884 to provide pattern +d9200a0 Adding what is hopefully the last commit for #896. Here's the changelog: +74db777 Removing the 'addpath' commands from the freebsd service provider, since it's no longer needed or even valid. +b19a0c9 Removing the recently-commited paludis provider, because it breaks autoloading as indicated in #956. +02b64ab Applying patch by josb in #884 to provide pattern matching in the tidy type. 584127c Applying patch by raj in #881. -4ee5ab8 Applying patch for portage package support from thansen -ed642ac Replacing freebsd service provider with the one -117f005 Adding paludis package support as provided by KillerFox -3248c93 Fixing #937 -- I had not ported the dot methods at all, +4ee5ab8 Applying patch for portage package support from thansen in #895. +ed642ac Replacing freebsd service provider with the one provided by raj in #880. +117f005 Adding paludis package support as provided by KillerFox in #741. +3248c93 Fixing #937 -- I had not ported the dot methods at all, and I had to make a few small changes to make them work. a8bf74b Fixing #946. b70f00a Fixing some further failing tests resulting from the fix for -862d1f7 Adding an Indirection reference, along with the work +862d1f7 Adding an Indirection reference, along with the work necessary to support it. da77e4a Updating the changelog with external node info. -f127d04 Fixing #951 -- external nodes work again, but you have to -7a4ae08 Fixing the rest of #948. My previous work was sufficient, -3790ce1 Fixing part of #948 -- per-setting hooks are now called -b852c2f Fixing #941 -- calling pkg_info instead of info -ae33e57 Fixing #923 (again). The host storage method was not +f127d04 Fixing #951 -- external nodes work again, but you have to set the 'node_terminus' setting to 'exec'. +7a4ae08 Fixing the rest of #948. My previous work was sufficient, except that I was not passing the interpolated value in to the hook, which meant the libdir was set to something like $vardir/lib. +3790ce1 Fixing part of #948 -- per-setting hooks are now called when the configuration file is parsed. The bug is still there, but I'm getting closer. +b852c2f Fixing #941 -- calling pkg_info instead of info in the openbsd package provider. +ae33e57 Fixing #923 (again). The host storage method was not correctly searching for the host, so it was creating a new host on each run, which is what was causing the conflict. 9ad7d1a Adding basic unit tests for type/user by DavidS from #948. -038b9c8 Fixing #923. Resources that are collected on the local +038b9c8 Fixing #923. Resources that are collected on the local host are no longer marked as not exported. 5886d37 Applying patch by whaymond_home to further fix part of #896. 072b03e simplify PluginsMount a012849 Updated tests for http_enable_post_connection_check configuration setting. @@ -2422,39 +2223,39 @@ 88304cc Renaming @model to @resource in a provider 75647ee Fixing a couple of tests that were failing on a different platform or with a different version of ruby 811fefa Fixing #892 -- filesystem mounts are no longer remounted. -dedc56a Fixing #527 (rewrote service tests), #766 (services only restart when they +dedc56a Fixing #527 (rewrote service tests), #766 (services only restart when they are running), and #918 (service tests fail when hddtemp is not installed). 421b3fc Another backward compatibility patch, this time helping with a new server and old client bbf8a8b Making a few changes to the transportable class to enhance backward compatibility -11ae473 Theoretically, this patch is to fix #917 (which it does), but -8127397 Fixing puppetca so it passes its tests, duh. Apparently -2282046 Adding a top-level ResourceReference class that everything -c6d1746 Fixing the first half of #917 -- the ResourcReference +11ae473 Theoretically, this patch is to fix #917 (which it does), but there were enough problems fixing it that I decided something more drastic needed to be done. +8127397 Fixing puppetca so it passes its tests, duh. Apparently wyvern's patch broke things a bit and I was stupid enough not to run the tess right before accepting. +2282046 Adding a top-level ResourceReference class that everything else can use to canonize how we refer to resources. Finally. +c6d1746 Fixing the first half of #917 -- the ResourcReference AST code now correctly finds the resource. It's getting lost in the configuration translation, though, so I need to fix that, too. 6c1d8d3 Applying fix to xmlrpc client tests by Matt Palmer 6b2c0d8 Fixing the error message as requested in #893. 1b2142b Applying patches from #823 by wyvern c7cd7ec Fixing the markup on the pkgdmg provider so it is a bit better -1e6ba6f Fixing #781, from what I can tell. I'm leaving it with -5d30ea9 Fixing #810 -- I catch the error and prefix it with something -4e52ffc Fixing #796 -- the fileserver can now start with no -168fa5f Fixing the asuser method in Puppet::Util::SUIDManager -0ef6b95 Fixing #931 by keeping track in configurations of -a38b415 Fixing #927 -- rewriting the test to actually test what it's -7ff8ea5 Fixing the persistent and periodic schedule test failures -18b4c3a Fixing #924 -- clearing the configuration cache before and -2cb1199 Fixing the breakage that I caused when I added the 'declared_feature?' -2d19ee2 Fixing #920 -- I have replaced the existing mount test with an -c3dde68 Fixing #919 -- installed packages used for testing are just ignored, +1e6ba6f Fixing #781, from what I can tell. I'm leaving it with no tests for now, since it's a very small chunk of code and it's *insanely* difficult to test this kind problem. +5d30ea9 Fixing #810 -- I catch the error and prefix it with something a bit more useful. +4e52ffc Fixing #796 -- the fileserver can now start with no configuration file (it creates both default mount points if it does) and puppetmasterd no longer requires the configuration file to exist. +168fa5f Fixing the asuser method in Puppet::Util::SUIDManager so that it correctly just yields if you're not root. It also no longer tries to set :uid or :gid; just :euid and :egid, and it once again sets :egid before it sets :euid, which is important because you usually can't change your group after you've changed your user id. +0ef6b95 Fixing #931 by keeping track in configurations of what transportable resources get converted to, so different names don't throw it off. +a38b415 Fixing #927 -- rewriting the test to actually test what it's supposed to be doing and to skip the whole network connect thing. +7ff8ea5 Fixing the persistent and periodic schedule test failures by rewriting the schedule tests entirely. +18b4c3a Fixing #924 -- clearing the configuration cache before and after the test. +2cb1199 Fixing the breakage that I caused when I added the 'declared_feature?' method to provider features. +2d19ee2 Fixing #920 -- I have replaced the existing mount test with an rspec version. It's not perfect, in that it only tests the :ensure state, but that's where 90% of the behaviour is. +c3dde68 Fixing #919 -- installed packages used for testing are just ignored, rather than throwing a failure. 47890f9 Fixing a test that was erroneously testing for the wrong feature 12ebbe2 Rewriting the tests for the package resource type, fixing #930. -fc7f1b4 Fixing #921, mostly by just deleting the existing test. I had +fc7f1b4 Fixing #921, mostly by just deleting the existing test. I had already migrated all of the tests into rspec but forgot about these tests -- they were only in the rails/ subdir because people kept not running the parser/ tests after modifying the Rails code. 9311bdd Applying patch by trombik from #756. -b575d15 Integrating Matt Palmer's patch to provide a 'plugins' +b575d15 Integrating Matt Palmer's patch to provide a 'plugins' mount, fixing #891. The patch was ported to the current code by David Schmitt, I applied the rest of Matt's patches, and I then fixed all of the code so that the tests passed. 36c947e Fix #896 - Always disable DNS checking of certificate when making https connections. -3fb8e2e Applying the rest of Matt Palmer's patches -7eb09ab Implementing the test for setting the Rails -676efa7 Incorporating patch 20071030034736-6856b-6004090b3968cdbf7d366a03ee1c44e2160a3fe0.patch +3fb8e2e Applying the rest of Matt Palmer's patches related to providing a plugin mount. +7eb09ab Implementing the test for setting the Rails log level. +676efa7 Incorporating patch 20071030034736-6856b-6004090b3968cdbf7d366a03ee1c44e2160a3fe0.patch from womble, and rewriting and significantly enhancing the unit tests for the Puppet::Parser::Collector class; it should have full coverage now. There are no integration tests for it, so there's still no guarantee that it works at all, but hey, we're a lot better off than we were. 7f1b2d6 change up rails specs again with Luke's help -8de1412 Integrating most of Matt Palmer's from +8de1412 Integrating most of Matt Palmer's from http://theshed.hezmatt.org/mattshacks/puppet/_patches/puppet-0.23.2/. a88891a Fixed #906 - Augmented Cert DN regexp check to work with Pound and Apache. c19d08a mock all use of Puppet[] in Puppet::Rails.database_arguments e69e0c3 fix spacing @@ -2478,47 +2279,47 @@ 035fa38 Adding patch 20070905004837-6856b-2e7b8d8595ee0883537620c46424a4bf6174dc6a.patch from womble -- Add an attr_accessor for @http#ca_file, since older versions of libopenssl-ruby only provides ca_file=, not ca_file 63b205a Adding patch 20070831053637-6856b-dd0fddab681485ce7cea0b57336d0c48fa33f7f8.patch from womble; updates changelog 72c0e7b Adding the debian directory via patch 20070831052721-6856b-b90bb56a4ed37ea420f10352a0a366068cddc7e4.patch from womble -7efe24f Fixing #882 -- I just added a quick hook to the -56aad69 Patching a bit for #804 by making the maximum much higher UID +7efe24f Fixing #882 -- I just added a quick hook to the Master handler again; we need a better long-term solution, though. +56aad69 Patching a bit for #804 by making the maximum much higher UID and making it tunable, but it has not gone away yet. a525ab5 Fixing a couple of tests that were failing because of the environment changes. 6d74ddd Accepting a modified form of the patch from #885 by immerda. -b745f04 Fixing #886 -- the problem was the I had changed the base -dbe70a1 Added calls to endgrent/endpwent in util/posix.rb to -7f504b0 Applying patch from #896 by whaymond_home, adding more +b745f04 Fixing #886 -- the problem was the I had changed the base class for Parameter, which apparently lost the 'nodoc' method for that class. +dbe70a1 Added calls to endgrent/endpwent in util/posix.rb to fix #791. +7f504b0 Applying patch from #896 by whaymond_home, adding more certname aliases. 1cb40ec Obviating targets in interfaces; they now just generate a warning. -eee9f5e Adding more tests to the redhat interface provider. It no -1a4e4fb Rewriting the sunos interface provider to manually parse and +eee9f5e Adding more tests to the redhat interface provider. It no longer uses the :target parameter (which I'll be removing in the next commit). +1a4e4fb Rewriting the sunos interface provider to manually parse and generate, rather than using ParsedFile. This should fix #777, and has from what I can tell. 8cbe8bd Adding unit tests for the sunos interface provider. 3d2e1a5 Adding some unit tests for the interface type before i go messing around with it -cca613d Fixing the first part of #787. Not all collections were -96b3cde Applying patch from #834, apparently fixing a problem +cca613d Fixing the first part of #787. Not all collections were being evaluated on the first pass because they were being deleted from the collections list during evaluation, which caused some to get skipped. This commit fixes that problem, which helps in the trivial cases where the collections are in the same scope. I expect it's still broken for more complicated usages. +96b3cde Applying patch from #834, apparently fixing a problem with bringing up alias interfaces. 9472eef Removing the bootproto and broadcast attributes from the redhat interface provider, since they are not needed a7a46af fixing the path to the spec helper in the exec test -3d31dc8 Fixing #762. The main problem was that I accepted the patch +3d31dc8 Fixing #762. The main problem was that I accepted the patch in #744 which broke the templates. In the process, I also added test code for the redhat interface provider and rewrote how parsing worked to make it more testable. 8ecdfc2 Moving the exec test into the types/ directory 94e63ad Fixing the last failing test relating to the environment changes 7fe5bfc Fixing the exec spec so it works when non-root and is a bit cleaner -8cc07ad Using the Environment class to determine the default environment, -53008e5 The Puppet settings instance now validates environments when -9e5fc76 Fixing #911 and #912 -- there's a default environment (development) +8cc07ad Using the Environment class to determine the default environment, rather than plenty of different places having the logic of how to determine the default environment. +53008e5 The Puppet settings instance now validates environments when you set an environment. +9e5fc76 Fixing #911 and #912 -- there's a default environment (development) and you have to specify the valid environments for your site. cc88441 Removing the manual ssldir setting by David in 59626cb3907d36e4fd762277daa76f523faf0908 -1bf3999 Fixing a failing test from my fix for #446 -- I had changed -3f0b250 Fixing a few test suites that passed when run as -4bd7b6f Fixing #896 by applying DerekW's patches, with slight -8ad2732 Fixing #446. I ended up largely not using porridge's patch, +1bf3999 Fixing a failing test from my fix for #446 -- I had changed the behaviour of Resource#override_parameter unintentionally. I've corrected the comments so it's clear why the original behaviour was there. +3f0b250 Fixing a few test suites that passed when run as part of the suite, but failed when run individually. The problem was that I changed lib/puppettest/support/utils to have a separate module and I didn't test the individual files. +4bd7b6f Fixing #896 by applying DerekW's patches, with slight modifications to fit coding style. +8ad2732 Fixing #446. I ended up largely not using porridge's patch, but only because the code (and my coding style, to some extent) has changed so much in the last few months. Also, added specs. 1b78f57 Add Exec{ logoutput=> on_failure } -2b14f62 Reverting the changes I'd made toward removing the global +2b14f62 Reverting the changes I'd made toward removing the global resources. These are commits: 9cf477b Applying fix by Jeff McCune from #905 -edc4b1d Fixing a SimpleGraph unit test so it doesn't depend +edc4b1d Fixing a SimpleGraph unit test so it doesn't depend on hashing. c19835c Fixed most failing tests, but there are still over thirty failing. 4afbaa6 fix #903: add patch from hrvojehr 32d9afc tests for #903: fail when no logoutput is generated on failure -9290cc8 Modifying how default resources are created; they are now -ffb4c2d This commit is the first run at removing all global -b65fb83 Fixing a parser test -- really, just removing tests -72510bf Fixing #800 by refactoring how configurations are retrieved -dd7caa7 Moving some compile tests to the spec/ directory, and -47a2605 Changing the 'main' class to no longer be lazy-evaluated. +9290cc8 Modifying how default resources are created; they are now added to the configuration by the master client, rather than by the creating types. +ffb4c2d This commit is the first run at removing all global references to resources. It deprecates the class-level [] and []= methods, used for so long to provide closure behaviour but now unnecessary with the node configuration's ability to function as a resource container. +b65fb83 Fixing a parser test -- really, just removing tests that belong with the AST classes rather than in the parser. +72510bf Fixing #800 by refactoring how configurations are retrieved from the server. The real problem was getting all of the validation done before any caching, which required a good bit more refactoring than I expected. +dd7caa7 Moving some compile tests to the spec/ directory, and switching the node scope to no longer be lazy evaluation, just like I switched 'main'. When I made all of these classes and nodes lazy evaluated, I should have decoupled my real goal (using resources to evaluate them) from the idea of lazy-evaluating them, and this basically does that. +47a2605 Changing the 'main' class to no longer be lazy-evaluated. It was getting evaluated after node classes, which caused even stranger ordering issues. a4e8f1c Adding a memory terminus for facts, which is really only used for testing 3851415 fix dependency on $HOME, which causes massive failures when running without environment 59626cb fix failing CA test, when testing with incomplete setup (no ssldir, no DNS) @@ -2530,50 +2331,50 @@ 61ef289 fix #815: add :main to all use() for :reporting and :metrics 418bc21 remove obsolete runners variable a535cbb Commenting out the time debugging I was using -3f583dc Adding unit tests for the module that handles the -8f04446 Fixing the 'mount' tests so that they no longer -ba19989 Switching the class resource evaluation to only happen -cf75168 Classes once again get evaluated immediately when the +3f583dc Adding unit tests for the module that handles the logic around mounting and unmounting. This includes a fix for bug #761, which required a different regex for Solaris. +8f04446 Fixing the 'mount' tests so that they no longer modify the local system and they run fine as non-root users. +ba19989 Switching the class resource evaluation to only happen when using :include, not (for example) when evaluating node classes. +cf75168 Classes once again get evaluated immediately when the 'include' function is used, instead of being lazy-evaluated. 4441052 fix #891: create a plugins mount which collects all modules' plugins/ subdirs -dfe774f Switching the base class for the Relationship class. +dfe774f Switching the base class for the Relationship class. It was previously using the GRATR::Edge class, which had wonky overrides that dramatically slowed down sorting (its hash mechanism hashed the source and target so that edges with the same source/target got the same hash, which we actually don't want any more). 4194526 fix #760: property_fix has to be called after creating a symlink b250416 fix #731: add exported=true to collect_exported 1ffcce0 Splitting the puppetd tests into two tests. It is still not a very good test, but I do not know of a good way to test this, really. -065a1d0 Switching the graph base class from GRATR::Digraph -3f21e93 Adding a new graphing base class, because the GRATR stuff -ef99495 Caching the 'parent' value, which resulted in -826efe8 The configurations should now be functional again -- +065a1d0 Switching the graph base class from GRATR::Digraph to Puppet::SimpleGraph, which should dramatically enhance performance. It should be largely functionally equivalent, with the only difference being that edges are no longer deduplicated. +3f21e93 Adding a new graphing base class, because the GRATR stuff is just too slow. This class has just about no iteration, and vertex deletation is dramatically (as in, 1000x) faster). Here are the results of some very simplistic graph operations: +ef99495 Caching the 'parent' value, which resulted in a drastic performance increase. +826efe8 The configurations should now be functional again -- file recursion was previously not working, because the relationship graph was setting itself as a resource's primary configuration, which caused it to try creating its own relationship graph. db293cf Fixing a bit of indentation and commenting in the xmlrpc/client file 956daa5 This won't be perfect by any stretch, but put in a moderately reasonable autotest config file. -c7b36b7 One significant step closer to getting autotest running properly on the Puppet specs. +c7b36b7 One significant step closer to getting autotest running properly on the Puppet specs. Created a spec/lib/monkey_patches/ directory for holding patches to RSpec functionality. Extraced 'confine' and 'runnable?' support from the local copy of RSpec (spec/lib/spec/) and now load them from the monkey_patches/ directory. Fixed a bad include in one of the specs. Made it possible for the gem-installed spec binary (which autotest calls) to be used with Puppet. Imported the Autotest::Rspec class, created a PuppetRspec autotest class, added a discovery.rb file for autotest to pick these up. 6585835 Adding patch from #879 by tim -d03f68e Changing the test/ classes so that they work from the main -c0a07ac File serving should work now, both recursive and +d03f68e Changing the test/ classes so that they work from the main test/ dir or from their own working dir, like the specs do. This was just a question of changing how their libraries are loaded. +c0a07ac File serving should work now, both recursive and single files, across modules, local file system, and the traditional file server. 54fc80d Exceptions on requests are now captured, exceptions are serialized, and exception text is passed back via REST. e7bfe0b Finish serializing successful results (via calls to to_yaml, etc.) for REST handlers. Refactor request building in REST handler specs. d28a904 REST handlers now properly returning 200 status on success. 1746751 Adding post- hooks for :find and :search in the indirection class. 09f9c3c Adding the calls to the authorization hooks in the Indirection. -b874751 Renaming the FileServing TerminusSelector module to IndirectionHooks, -de5d91e Renaming the :local termini for metadata and content -7fa99b0 Link handling is now in the file serving classes. -688fcdf Adding searchability to the fileserving termini, using the -393a3e8 Adding a Fileset class for managing sets of files. This -b2b8f75 Adding authorization hooks to the file_server and -8f827ff Renaming the 'mounts' terminus to 'file_server', and renaming -08099b7 File serving now works. I've tested a couple of ways to +b874751 Renaming the FileServing TerminusSelector module to IndirectionHooks, because I'm going to add some hooks for transforming returned objects. +de5d91e Renaming the :local termini for metadata and content to :file. +7fa99b0 Link handling is now in the file serving classes. This was done by putting all of the functionality in the Content and Metadata class (actually, in a new base class for them). +688fcdf Adding searchability to the fileserving termini, using the new Fileset class. +393a3e8 Adding a Fileset class for managing sets of files. This is the new server-side for file recursion, and I'll next be hooking it to the fileserving 'search' methods. This is basically a mechanism for abstracting that search functionality into a single class. +b2b8f75 Adding authorization hooks to the file_server and module_files indirection terminus types. Both hooks use the fileserver configuration, but the module_files hook only uses the 'modules' mount. +8f827ff Renaming the 'mounts' terminus to 'file_server', and renaming tests accordingly. +08099b7 File serving now works. I've tested a couple of ways to use it, and added integration tests at the most important hook points. 264331b Partial work done for ssl certificates. -ec39672 Adding this test stub that's been sitting -fc60751 I've now split the file-serving termini into two separate types (in -64c6700 Fixing all of the classes that I just renamed, and adding -56b83fe Renaming the file serving indirection termini to match -33d7dc0 I'm working on making file serving work in the indirector now, so I -8156185 Renaming the file_serving/{content,metadata} indirections -2718b63 This is the first mostly functional commit of the +ec39672 Adding this test stub that's been sitting around in my repository for a while. +fc60751 I've now split the file-serving termini into two separate types (in addition to Rest): A local terminus that just uses direct file paths, and a mounts terminus that uses the file server to figure out what the path should be. +64c6700 Fixing all of the classes that I just renamed, and adding the TerminusSelector module to the File Metadata indirection. +56b83fe Renaming the file serving indirection termini to match the standards I set in the TerminusSelector. +33d7dc0 I'm working on making file serving work in the indirector now, so I added two abilities to the indirections: Models can specify a module to extend the indirection instance with, and indirections will use a :select_terminus method, if it's available, to select the terminus to use for finding. (It's currently only used for finding, not destroying or saving.) +8156185 Renaming the file_serving/{content,metadata} indirections so that they make more sense in the REST API, and creating stub tests for the indirection termini. Now it's on to create the rest of the tests for them. +2718b63 This is the first mostly functional commit of the new file serving structure. The next step is to hook it up to the indirection so we can start writing integration tests to see if we can actually serve up files. e1dd5dd Adding spec stubs for authorization in the indirection e69a50a Fix test which is conditional on mongrel installation. 8bf5196 Oops, forgot this file in my last commit. -d0bd48c Adding the first pass at modifying file serving +d0bd48c Adding the first pass at modifying file serving to work with indirection. I've split the fileserver handler into four pieces: Mount (which so far I've just copied wholesale), Configuration (responsible for reading the configuration file and determining what's allowed), Metadata (retrieves information about the files), and Content (retrieves the actual file content). d2b891f More specs, fleshing out the returns from REST e5921c5 getting more fine-grained with the response specs -- the target is always moving. 705f76f Argument passing now supported on {webrick,mongrel}+REST. @@ -2597,16 +2398,16 @@ e56406f Implementing listening state tracking for webrick and mongrel. ec71e05 More unit specs for mongrel and webrick; more code to make them work, yo. 31384fe Pushing functionality down to webrick/mongrel classes now; cleanup in the base server / http server classes + specs. -694f98b Fixing failing tests, including making the debian service -29feac0 Translating the report handler to an indirected model. -74d77f7 Adding version handling through most of the indirection work. +694f98b Fixing failing tests, including making the debian service provider test work on non-Debian platforms. +29feac0 Translating the report handler to an indirected model. I've provided backward compatibility with the old handler. +74d77f7 Adding version handling through most of the indirection work. This counts as the first commit where configuration compiling actually uses the caching correctly according to the application model. e90191a more stuff for the interim commit 10039b9 interim checkin of network stuffs -512096a Fixing some small spec failures resulting from test fixes. +512096a Fixing some small spec failures resulting from test fixes. The problem was in how TransObjects were converted to RAL resources. (Committed while flying over Arkansas.) d24c1cc All tests should now pass again. ec58355 Fixed #819. Applied patch provided by matsuu. 7ac7872 Fixed #822. Applied patch provided by DavidS. -fc9c850 Adding support for versions and freshness-checking +fc9c850 Adding support for versions and freshness-checking to the indirection layers. This should hopefully enable the different application models we need in our different executables. 1befcc4 Homing in on a clean separation of concerns for a low-coupling, high-cohesion "server" model that will handle REST and/or XMLRPC on webrick and/or mongrel. 5c32c8e Somewhat better documentation of the :absent field feature in fileparsing. d055cbc Make it apparent that absent fields in a record have a value of :absent, which is different from what appears in a line. @@ -2614,78 +2415,78 @@ a7d220b Moving the webrick/mongrel "servers" over to HTTPServer module instead of Server. Using Server as the master class for client connections. Server (former RESTServer) will instantiate the appropriate subclass based upon Puppet configurator setting. There are now tests broken in the network section which I can't seem to figure out yet. Not a happy place to be. cdaad28 Fixing error thrown when the end of the file is encountered unexpectedly 7d7e428 Removing obsolete comment -f084d83 Another round of test-fixing around the changes I made -9c58c47 Adding a :code setting for specifying code to run +f084d83 Another round of test-fixing around the changes I made to the configuration system. 'puppet' itself still works, even with -e, but I expect that puppetd and puppetmasterd are broken, and there are still quite a few broken tests because the default fact store can't write but that's the default behaviour for a networked configuration master. +9c58c47 Adding a :code setting for specifying code to run instead of a manifest, and removing all of the ambiguity around whether an interpreter gets its own file specified or uses the central setting. d35cd94 Making "null" the default node source, so nodes are at least created easily -0e336bf This commit is focused on getting the 'puppet' executable -1fa5912 Adding the integration tests to the Rakefile for spec, -a93db87 Adding another test to the ldap node source -- we make +0e336bf This commit is focused on getting the 'puppet' executable to work. As a result, it involves a lot of integration-level testing, and a lot of small design changes to make the code actually work. +1fa5912 Adding the integration tests to the Rakefile for spec, fixing the integration tests, and extending the Classmethods for the indirector so that indirected classes can set the terminus class and cache class. +a93db87 Adding another test to the ldap node source -- we make sure we throw an appropriate exception if a parent is specified but we cannot find it. 9984a35 Fixing some terminology so some ldap tests are easier to read. -6acde71 Switching the indirection from using settings for configuration -8ba3a70 Fixed #838. Applied patch provided by DavidS to add more robust +6acde71 Switching the indirection from using settings for configuration to requiring explicit configuration. This means that if you as an application developer want to use a different indirection terminus then you have to specify it; something like: +8ba3a70 Fixed #838. Applied patch provided by DavidS to add more robust update functionality to the dpkg provider. f41c843 Fixed #837. Added freebsd service provider by trombik. 533ce4b Fixed #855, but I didn't add any tests. -19ad238 Fixed #827. Applied a form of the patch provided by porridge and +19ad238 Fixed #827. Applied a form of the patch provided by porridge and wrote a test. 29accba Minor tweaks. 2412199 Allow for multiple REST servers to be active; some terminology changes in spec; fleshing out more behavior, implementing. 102ad23 Added .listening to REST server, handle listen states and transitions. 187d910 Spec'd a reset() method for clearing out known routes. Uses the unregister method so that any hooks there will be run. Probably a violation of YAGNI, but I'm willing to suffer it :-) fd841b3 Updating first portion of the Network RESTServer spec with example code, getting the added examples to pass. -9236179 Attempting to reproduce and fix #829 by applying patch by Paul. I could not -e5c623e Fixing tests for the Configuration object, since I -938f051 Fixing #817, mostly using the patch by DavidS. I could +9236179 Attempting to reproduce and fix #829 by applying patch by Paul. I could not get a test to show the exception, nor could I figure out how the coding bug could have actually had an impact, but it's an innocent-enough fix, so I'm fine applying it. +e5c623e Fixing tests for the Configuration object, since I added the any_failed? test to Transactions. +938f051 Fixing #817, mostly using the patch by DavidS. I could not directly use the patch because I have refactored too much. fd11603 Removing the Id tags from all of the files -bb3b3ce I finally tracked down the problem that was causing providers -782bc4d Fixing the yaml path so that it is correctly +bb3b3ce I finally tracked down the problem that was causing providers to sometimes suddenly disappear and thus tests to fail -- Kernel.require was not loading the normal ruby path (e.g., 'puppet/type/cron'), so if someone else loaded that then it would replace the in-memory type with a new one, but that new one couldn't load its own providers, because the Kernel would ignore the providers, thinking they were already loaded. +782bc4d Fixing the yaml path so that it is correctly created for puppetmasterd. 7c8fc8b Fixed #854. d4afe39 Fixing #813 -- empty configurations again work. -5d50ca7 Fixing #814 -- when files are missing, the exceptions should +5d50ca7 Fixing #814 -- when files are missing, the exceptions should now be more reasonable. 1be1db9 Updated CHANGELOG. -0b8893b Fixed #832. Added the '--no-daemonize' option to puppetd and puppetmasterd. -b45a7ca Adding more behaviours to the Puppet::Module spec, +0b8893b Fixed #832. Added the '--no-daemonize' option to puppetd and puppetmasterd. The default behavior of 'verbose' and 'debug' no longer cause puppetd and puppetmasterd to not daemonize. +b45a7ca Adding more behaviours to the Puppet::Module spec, and fixing some bugs in the process. 3f90ddb Interpreting "hidden" class from spec drafts as a REST Controller. This name, functionality, and/or location in the tree is subject to change, but it's down now somewhere so we can move forward on it. 861c21d Added partial spec for the serving of REST information, as well as some client-side REST terminus behavior. 8722e43 Use external helper script to talk to yum; should avoid any more trouble with "yum list". Fixes trac #836 1174d99 Fixed a failing test where we presumed that non-string Fact values would have type preserved across a P::N::Client.master.facts call, which is not true. 7fe18e3 Fixed a test which was secretly sneaking off and pulling certs from ~ if they were there: Added set_mygroup method, removed duplicate setme method. Included PuppetTest in the XMLRPC servlect test. -fa643e6 Adding more indirection termini, mostly focused on caching -938b918 Adding cache support to indirection. If you have +fa643e6 Adding more indirection termini, mostly focused on caching information in yaml. +938b918 Adding cache support to indirection. If you have a '_cache' setting, then the indirection will use the value there as the name of the cache. 06ad6a3 Updated the configuration doc to more clearly explain where puppet.conf is expected to be by default. c8d02bd Fixing ralsh to use a configuration instead of a component ffaa8ce Demoting the "file does not exist" log to debug from notice c3c3e51 Fixing a small problem with the mailman type f8ab62b Renamed princs to principals in the k5login type. 6079348 Added k5login type written by Digant Kasundra. This is for ticket #759. -2e33061 I changed the Terminus class to switch camelcase +2e33061 I changed the Terminus class to switch camelcase to underscore-separated words, e.g., FactStore becomes fact_store. d6fd60c Removing obsolete fact stores and node sources. The functionality has been moved into the indirector. -cdc8ea6 Taking a first stab at moving configuration compiling -c40da33 Adding a "memory" node terminus, which will -1e7c648 Fixing the spec for the checksum terminus to match -048464f Adding my first integration test, verifying that -84146d0 Adding the first version of checksum support, which will -3a18348 Renaming the 'Puppet::Util::Config' class to -e552c83 Adding the base file terminus. This will, at the least, -86dde63 All tests now pass in this configuration branch, which means -60cd6a7 The structure for handling resource generation is now -a666995 Adding the last tests for the ldap node terminus. I managed -ebe7290 All indirections are working, and they have all +cdc8ea6 Taking a first stab at moving configuration compiling into the indirection system. There are still quite a few unanswered questions, the two most notable being embodied in unimplemented tests in the Configuration Code terminus. +c40da33 Adding a "memory" node terminus, which will be used by 'puppet' and the Cfengine 'module_puppet', since they need to set up the node specially with classes and other weird things. +1e7c648 Fixing the spec for the checksum terminus to match the changed design in the previous commit. +048464f Adding my first integration test, verifying that checksum interaction behaves as I expect when interacting with the file terminus. +84146d0 Adding the first version of checksum support, which will acquire the behaviour of FileBuckets. +3a18348 Renaming the 'Puppet::Util::Config' class to 'Puppet::Util::Settings'. This is to clear up confusion caused by the fact that we now have a 'Configuration' class to model host configurations, or any set of resources as a "configuration". +e552c83 Adding the base file terminus. This will, at the least, be used as the back end for filebuckets and the certificate authority. +86dde63 All tests now pass in this configuration branch, which means it's time to merge it back into the indirection branch. +60cd6a7 The structure for handling resource generation is now in place, which means I'm over the hump in developing this branch. +a666995 Adding the last tests for the ldap node terminus. I managed to forget the tests around the main find() method. +ebe7290 All indirections are working, and they have all been migrated over to the new organization. Where we would have previously had an 'ldap' node terminus at puppet/indirector/node/ldap.rb, we would not have it at puppet/indirector/ldap/node.rb, and it would be a subclass of puppet/indirector/ldap.rb. b9dc6cb It looks like the new indirection setup is complete. -02275f0 Adding automatic association between terminus subclasses and -da0555d Adding the first top-level terminus (yaml). It works -0a48e5f Moving the Puppet::Indirector::Terminus class into its -7e2ff4b Adding a couple more tests to the indirector, talking about -7740cd4 The indirector specs now all pass. I think I need -4e8b671 The unit tests for the newly-resurrected indirection class -8212f88 Fixing all existing spec tests so that they now +02275f0 Adding automatic association between terminus subclasses and the indirection they're working with. It looks like I'll be moving terminus registration to the indirection rather than the top-level Indirector. +da0555d Adding the first top-level terminus (yaml). It works and is tested, so now it is time to migrate the Facts YAML Terminus to use the / file structure instead of /. +0a48e5f Moving the Puppet::Indirector::Terminus class into its own file and adding a spec for it. +7e2ff4b Adding a couple more tests to the indirector, talking about terminus registration. I am about to change how loading is handled, so that individual termini are declared as normal Ruby classes. +7740cd4 The indirector specs now all pass. I think I need to add a few more specs, though. +4e8b671 The unit tests for the newly-resurrected indirection class now work; all we need do is fix the indirector module tests. +8212f88 Fixing all existing spec tests so that they now pass given the redesign that Rick implemented. This was mostly a question of fixing the method names and the mocks. 944cd0e Whitespace and comment commit. -46d6906 An intermediate commit so I can start working on a different +46d6906 An intermediate commit so I can start working on a different branch. The file recursion code actually works for the first time in a painful while, but there are still some quirks and design issues to resolve, particularly around creating implicit resources that then fail (i.e., the behaviour of the create_implicit_resource method in Configuration). e90a51f More spec and indirector updates. 129cce8 Finally, some progress. Closing the loops and delegating registered class calls out to the actual Terminus. a6c4041 Reworking the Indirector code. Continuing to fight the classgen and instance_loader "utilities". -9fa2628 This is basically another intermediate commit. I feel like +9fa2628 This is basically another intermediate commit. I feel like I've gone too far down the rabbit hole to turn back now, but the code is clearly getting more centralized around the Configuration class, which is the goal. 19e0493 Updates to indirection stuffs. Making a better spec and migrating to it. b3c8cdb Configurations now set a "configuration" instance variable in resources that are inside a configuration, so the resources can interact with the configuration to get things like relationships. -f17f19d The whole system now uses Configuration objects instead of +f17f19d The whole system now uses Configuration objects instead of ever converting the Transportable objects into a tree of components and then converting that into a graph. This is a significant step, and drastically simplifies the model of how to use a configuration. The old code might have looked something like this: f014d73 Partial fix for #772. The SIGHUP now produces a EOPNOTSUPP instead of NameError. 3ccf483 Removing the completely obsolete passwd2puppet and the obsolete component.rb 3632926 Moving the resource container behaviour to the Configuration object, rather than the base PGraph class. I expect I will just do away with PGraph, but for now, I am at least going to keep configuration-related code in that class. @@ -2752,7 +2553,7 @@ 4eb87ed A round of bugfixing. Many more tests now pass -- I think we are largely down to tests that (yay!) fail in trunk. 2a4e101 All language tests now pass. I expect there are other failures elsewhere, but I want to commit this before delving into them. My method for fixing the tests was to do as little as possible, keeping the tests as bad or as good as they were before I started. Mostly this was about changing references to the interpreter into references to the parser (since that is where the new* methods are now for ast containers) and then dealing with the new config object and its relationship to scopes. 6467c21 The first pass where at least all of the snippet tests pass. I have unfortunately had to stop being so assiduous in my rewriting of tests, but I am in too much of a time crunch to do this "right". The basic structure is definitely in place, though, and from here it is a question of making the rest of the tests work and hopefully writing some sufficient new tests, rather than making the code itself work. -a846ea9 The new parser configuration object works now, +a846ea9 The new parser configuration object works now, but the rest of the compiling process is hosed (although the parser itself should still be fine). 282ec89 Fixing the spec library so it correctly can see its version 1527f4a Adding node caching, so that node sources are not spammed during file serving and such a953954 Keeping the node names in the node object, so that they are available to the interpreter @@ -2762,7 +2563,7 @@ aabad8e Adding the necessary name/ip fields to the node methods 65559af Adding a "none" node source, which will be the default node source and will just return an empty node. 2ff15c0 Added shortname support to config.rb and refactored addargs -90a9d09 Finalizing the node handler. It now correctly uses the different node sources +90a9d09 Finalizing the node handler. It now correctly uses the different node sources and knows how to retrieve data from those sources. Now I just need to fix the language stuff to use this handler instead of the existing node stuff. ec50484 Fixing documentation string on the file "ensure" property to remove the confusing mention of "exists" 58e3855 Added optional per-module lib directory. aab419b An intermediate commit in the work towards adding multi-environment support. @@ -2920,7 +2721,7 @@ ====== f588d47 Adding release tag REL_0_23_0 8844fca Changing the paths to match laeg, instead of culain. -d79a788 Modified the fileserver to cache file information, so that +d79a788 Modified the fileserver to cache file information, so that each file isn't being read on every connection. Also, added londo's patch from #678 to avoid reading entire files into memory. 944e1f4 More updates to puppet-test 4bb0228 Updating puppet-test with clearer options around describe and retrieve fd15de7 Removing extra debugging from the interpreter @@ -2977,14 +2778,14 @@ 9bc236b Adding indexes for the rails tables 7c53aab Removing the indexes migration, since the indexes are now in the main db schema ef2698c Updating ralsh with more functionality: You can now perform work on the command line, with commands like "sudo ralsh file /etc/passwd ensure=absent". This makes ralsh a bit more interactive. -cb5bccc Added to_s to the values to ensure the check versus the database will be +cb5bccc Added to_s to the values to ensure the check versus the database will be consistent and booleans and references will check correctly. d78a7a5 documentation fix 3a2f3d5 Fixing mongrel test so it does not try to load the mongrel server class on machines without mongrel 6aa5d76 Applying patch from #666 by Rainhead and monachus -ea190c1 Changed the host to "eager fetch" all the resources and their associated -3003aad Added the teardown of the database back to the tests. +ea190c1 Changed the host to "eager fetch" all the resources and their associated tables. Also removed some unecessary lines from resource.rb that were causng it to re-read information it already loaded from the db. +3003aad Added the teardown of the database back to the tests. 4442a31 Revert unintentional change. -68e37a9 Major rework of the rails feature. Changed the relationship between +68e37a9 Major rework of the rails feature. Changed the relationship between host and facts (now many-to-many with fact_name through fact_values). Also changed the relationship between resource and params (similarly many-to-many with param_names through param_values). c26f678 Fixing #550 -- I had to list pass and dump as optional fields. f0b5090 Fixing #112 - mounts now default to 0 for dump and pass d396fd5 Fixing #637 -- defined resources can now correctly be virtual or exported @@ -2998,9 +2799,9 @@ bf82d51 Fixing the "Server is not a class" problem with mongrel 992636a Applying patches from Valentin Vidic to fix open file discriptor and open port problems 1867d0e Fixing the few test failures that resulted from the changes to provider listing -c35d07b Significantly reworked the type => provider interface with respect to +c35d07b Significantly reworked the type => provider interface with respect to listing existing provider instances. The class method on both class heirarchies has been renamed to 'instances', to start. Providers are now expected to return provider instances, instead of creating resources, and the resource's 'instances' method is expected to find the matching resource, if any, and set the resource's provider appropriately. This *significantly* reduces the reliance on effectively global state (resource references in the resource classes). This global state will go away soon. a7b057d Adding a "source" attribute to providers, so eventually types will be able to avoid duplication during listing by only listing one provider for each source (e.g., dpkg and aptitude should not both be listed). -0cfd28e this is a spurious commit to test the trac site +0cfd28e this is a spurious commit to test the trac site e8aef1e Change pi to list properties instead of states f2c524d Add protect and priority properties; patch provided by Matt Hyclak 0a2b438 Fix trac #601: wrong location for client pidfile @@ -3142,12 +2943,12 @@ f1f4c42 Adding patch by apowers from #545. df0cd95 Adding init script by apowerrs from #546. 9828b25 Fixing fileserver doc links -f8a0e99 Adding the functionality requested in http://mail.madstop.com/pipermail/puppet-users/2007-April/002398.html . +f8a0e99 Adding the functionality requested in http://mail.madstop.com/pipermail/puppet-users/2007-April/002398.html . You can now retrieve qualified variables by specifying the full class path. 9946249 Only caching the configuration when it has been successfully turned into Puppet objects b6d0d27 Adding a --version argument to puppetca da4d252 Changing the test package for debian b8b14d3 Forgot to change Puppet::Util::SUIDManager#run_and_capture arguments to execute -efe9a83 Fix for #565: Final merge of changes from source:branches/execute-refactor into source:trunk +efe9a83 Fix for #565: Final merge of changes from source:branches/execute-refactor into source:trunk Generated with svn merge -r 2378:HEAD https://reductivelabs.com/svn/puppet/branches/execute-refactor trunk 8ab2722 Hah! Finally fixing the problem where mount tests would fail when run as part of the whole suite. The real problem was that I was changing the filetype of the provider without setting it to change back after the test, but the key change that made it straightforward to fix this problem was that my test loader was not exiting with a non-zero code when there was a failure, which mean that the ./test script never thought anything failed. I fixed the former, then fixed the test script to work fine with -n method_name stuff, and quickly found the problem. *whew* f9d89b5 Changing the date that certs are valid to start one day before the cert is created, so clocks that are off by a little bit can still be used. 4615e3a Fixing Client.read_cert so that it automatically adds the certificate information to the driver when the certificate is correctly read. This makes sure the Net::Http instance has the cert all set up. @@ -3243,26 +3044,26 @@ 86c63ce Fixing cron support (I hope). It now uses providers, and seems to work, at least on my os x box. ba23a5a Adding spec libs, so we can use them some day 8ea6ada Clarifying that the ruby RRD support is provided by a binary library -df4595e Significantly reworking the internals of the fileparsing code. It now +df4595e Significantly reworking the internals of the fileparsing code. It now passes around an instance of a FileRecord, rather than just a hash, which I think makes it much easier to understand. b05ae2a Don't blow up when PUPPETLIB isn't set -0fa3c43 Search manifests first within modules, and if no module is found, search in -38975de Introduces a new implicit 'modules' fileserver module, whose allow/deny can -ebcb6b6 The template function now tries to first find a template within a module -ba6257c The basic plumbing for modules: a modulepath config parameter, and a new +0fa3c43 Search manifests first within modules, and if no module is found, search in the directory the current manifest is in. +38975de Introduces a new implicit 'modules' fileserver module, whose allow/deny can be set from the fileserver.conf, but whose path is ignored and can therefore not be used directly in puppet:// URL's. +ebcb6b6 The template function now tries to first find a template within a module (if the template path looks like it belongs to a module) and only when that fails looks for it in templatedir +ba6257c The basic plumbing for modules: a modulepath config parameter, and a new class Puppet::Module that will contain the module-related functionality. The modulepath can be extended by setting the environment variable PUPPETLIB 10d6891 Adding support for a prefetch hook on individual providers, rather than only supporting it for the whole class. 4fa8008 Fixing a few of the log messages so file content changes always include the md5 sum 6ad8998 Adding a bit more testing to the config stuff 3489bd8 One last try at getting the config and mode stuff working. The tests were passing because "mode" is a valid config option in the tests, but not in the real configuration. So, now the Config class correctly only tries to set the meta params if they are valid options, otherwise they get skipped. b36f9c9 Fixing the config path to use Puppet[:name] rather than Puppet.name 6b92c04 Oops, forgot a file in the commit -f59cade Fixing a bug related to link recursion that caused link directories +f59cade Fixing a bug related to link recursion that caused link directories to always be considered out of sync. b6df336 Looks like [2265] was not a complete solution -- it resulted in failures when the config set modes via integers. Everything is working now, and tested more completely. 0925fb0 Adding some more testing on the @should values for :groups on users, and fixing a bug that often made :groups think it was out of sync. 333842b Putting the final touches on #144, most of which I had provided in the mongrel work. fa253b5 Fixing #489. I was unnecessarily converting to octal in config.rb 69338da Adding some changelog info for the next release, which is still a ways away, probably. 205bbb9 Flushing out the ability to have a stand-alone CA server, specified using ca_server and ca_port. This is just a final unit test, since the code was done and lutter fixed the rest in [2261]. -185a003 Fixing #531 and #414. This includes pretty much a complete redesign +185a003 Fixing #531 and #414. This includes pretty much a complete redesign of the AuthStore class, with (hopefully) all of the edge cases removed, the code is now much cleaner, the tests are (I think) complete, and everything is just generally better. fde8b28 Fix typo in default config and add simple test to check default config sanity 7e41d43 Turning a failure into an error when, for some reason, pfiles do not have paths set. 46d344b Merging the webserver_portability branch from version 2182 to version 2258. @@ -3299,7 +3100,7 @@ fa02d67 Fixing #472. Apparently this has been broken since I did the parser redesign. I had to fix the scope trees so that subclass scopes are subscopes of the parent scopes, which used to be the case but was far more complicated. d145aae Fixing #505, #508, and #513. 774415b Allow 'key=' to be the only thing on a line (livna uses this) -4d02823 I believe this fixes the issues in ticket #469 +4d02823 I believe this fixes the issues in ticket #469 My testing on mysql shows connections being reaped. 7a9e28a Applying patch from #495. 6fbd5fd Removing extraneous debugging 90b1058 Fixing a problem in collecting exported resources. Virtual resources worked fine, but exported resources resulted in an essentially infinite loop. @@ -3314,7 +3115,7 @@ 964c805 Trying to fix problem of locks lying around 2418e4a Adding hook to update timestamp when a report is run 0aa3b66 Change Puppet.name to Puppet.execname so rails 1.2 won't freak out. -6555dad Update relationships +6555dad Update relationships Remove dynamic class generation for now. Include the fact class 328e576 Revamping collections to get what is hopefully more reasonable behaviour when they are used in combination with defined resource types. You should now be able to combine them in just about any way and get "correct" behaviour, which in this case means that you can have virtual definitions or definitions wrapping virtual resources and the resources will still all get realized. 69d4bfe This works for me. Probably not the most universal fix. 9de665c Apparently using "gem" requires an environment we don't have. @@ -3352,7 +3153,7 @@ 69a07b1 The resolve functionality in "test" is almost working... 42d15fe Adding note about removing mounts netinfo provider 2c79bbf Oops, that last commit seems to have broken the rakefile. Works again. -3836201 Trying to get the functionality I had in previous tests. Mostly I want +3836201 Trying to get the functionality I had in previous tests. Mostly I want to be able to load many files but run just a couple of methods, which test/unit supports via -n, selectively enabling -d. I now can do this with the Rakefile, using 'TESTOPTS="-n -d" rake , although I find that a bit kludgy (certainly more so than 'rake -n -d '). fd2982f Fixing executable tests to take new rundir into account a62fd3e Filenames for test must _end_ with '.rb' 12bf816 Fix to make running tests work in ruby 1.8.5 @@ -3504,7 +3305,7 @@ e252505 Add a Puppet::Util::Pidlock class, for use by locks and PID files c1035cc Add system library directories directly in puppettest.rb, so you don't have to do it by hand in every single underlying directory; also change the debug check slightly so that we actually put debug stuff only when we really want it a333539 Applying patch by rainhead from #392. -7e62bb0 Add updated_at for all tables +7e62bb0 Add updated_at for all tables make sure it's removed from the resource hash that gets returned 6d8b3f3 Removing debugging da3e9d4 Hopefully fixing tagging problem 280f0b4 Still trying to track down the tagging problem @@ -3566,7 +3367,7 @@ 0dac4ec Changing some of the error output. This gets rid of the duplicated information that occurred when definitions or nodes were duplicately defined, and it tightens the error output a bit. 0f78282 Adding unit test for #364. It passes on OS X. dc96f98 Adding some selectability to host creation for testing. Using find_or_create_by results in lots of saves instead of one big one at the end, which causes initial saving to be much slower. To switch between them, just modify the value of "create" at the top of Host.store. -6b5d001 I like to checkin one-liners a lot. I'm cool. +6b5d001 I like to checkin one-liners a lot. I'm cool. set the type when we create the object, might be a bit faster 7173c1f Don't use find_or_create_by_title since titles aren't unique. e28c604 Remove old files, don't require pp anymore 3d070f7 These are the same versions from changeset 1837 @@ -3704,7 +3505,7 @@ 5ddbc36 Fixing sbindir path, thus fixing #302. 29ff4f3 Switching from calling "up" on the migration directly to using the "migrate" method. It is still not checking versions or allowing external forcing of migration, but it is a start. b4ebe76 Rewriting nearly all of the tests for the tidy type, and redoing the internals of the testing. -9e5ea8c Fixing the test scripts so that the library path +9e5ea8c Fixing the test scripts so that the library path is modified in ruby instead of in the env line 72688e3 Fixing gennode; it was not actually adding the class code to the generated node. 816c5ce Adding a ruby header to all of the tests so that they can now be executed as normal ruby scripts. Using multiple commits because I am having some svn problems. 1d56ca6 Adding a ruby header to all of the tests so that they can now be executed as normal ruby scripts. Using multiple commits because I am having some svn problems. @@ -3751,7 +3552,7 @@ 0716c83 Expanded documentation for rrdgraph report. 675495c Many, many, many performance improvements in the compiler (I hope). I did not change functionality anywhere, but I did some profiling and significantly reduced the runtime of many methods, and especially focused on some key methods that run many times. ab0141a More specific configuration and argument documentation. -c7a7381 Documented signals the puppet daemons accept +c7a7381 Documented signals the puppet daemons accept Documented host type to make it clear ipv6 is supported aea6eaf adding id tag to reports 8f058a0 Fixing the rrdgraph report so that it creates a separate rrd directory for each host b892093 Fixing weird case where the default node is in one node source and the real node is in a different one @@ -3790,13 +3591,13 @@ 008a138 Expanded documentation of command-line arguments for the puppet executables. f2ac4dc Updating changelog for 0.19.3, and merging the version changes over. 68016a9 ! rename file because rake_test_loader is dumb. -287b18c + New assertion: assert_uid_gid will check that the UID and GID have been changed to the proper values. This uses a fork and a FIFO to achieve it's checking. +287b18c + New assertion: assert_uid_gid will check that the UID and GID have been changed to the proper values. This uses a fork and a FIFO to achieve it's checking. ! nonrootuser and nonrootgroup now only return users/groups that are less than 255, due to the "Darwin debacle" ! many, many, many fixes for suidmanager. This is rather embarassing. 55f2873 Merging the fix to server/master.rb 3aac2e1 Some small housekeeping things that I saw while doing other bug hunting 48082a1 adding note about the irc channel 515f3cc Harded-coded pathname to OSX's ssh_known_hosts as a work-around until the ssh pathnames are user-configurable. 7b5604b Adding some test reports -6f11dee + Puppet::SUIDManager - This replaces all calls to the built-in ruby 'Process' library for uid/gid/euid/egid operations, including (not surprisingly) Puppet::Util#asuser and a method to run commands and capture output. This is due to many inconsistencies (through bugfixes) between ruby versions in the 1.8.x branch. This is included in the core puppet library and can be used by all puppet types and providers. +6f11dee + Puppet::SUIDManager - This replaces all calls to the built-in ruby 'Process' library for uid/gid/euid/egid operations, including (not surprisingly) Puppet::Util#asuser and a method to run commands and capture output. This is due to many inconsistencies (through bugfixes) between ruby versions in the 1.8.x branch. This is included in the core puppet library and can be used by all puppet types and providers. ! Modified Puppet::Util#uid to check (and warn) if passed a nil value. ! Changes to use Puppet::SUIDManager instead of Process and relevant Puppet::Util calls. ! Removed Puppet::Util#asuser. 320ac38 Updating CHANGELOG for 0.19.2 8f9dcb5 Updated to version 0.19.2 595d5ba Updated to version 0.19.2 @@ -3811,7 +3612,7 @@ 0.19.2 ====== ddb4c47 Adding release tag REL_0_19_2 -164c18f As requested by Christian Warden, triggering an object now results in +164c18f As requested by Christian Warden, triggering an object now results in an event, which can result in further triggers. 98004b2 Adding some error handling for when a non-existent report is asked for, and adding a bit more testing. a1e27bc Adding trace information to autoload.rb 0bd3055 Switching Autoload#loadall from using "load" to using "require", so it will not reload already-loaded files. Also updating the checksum docs a bit. @@ -3832,13 +3633,13 @@ c99843a Fixing #288. 2b27289 Fixing #293, I think. The problem was that the groups state was not correctly passing strings in all cases, which caused some very strange problems internally. 0870c5c Fixed a minor typo -dc8fb0a Fixing #292 (A bug in tagmail that causes any tag other than 'all' to fail) +dc8fb0a Fixing #292 (A bug in tagmail that causes any tag other than 'all' to fail) and #277 (tagmail report missing To: header). afed9a1 adding an extra make target for debugging, rather than defaulting to always creating the debug file e88bf77 Rake::TestTasks were running the test suite inadvertantly against the installed tree instead of the development tree due to a botched "libs" setting. bc15e04 Fixing provider commands and Util#execute so they always include the command output when possible, as mentioned on the list f0a9345 Regenerating docs, and correcting some markup mistakes 62917fc Small update to the fileserver tests; it was apparently not making some test dirs correctly -3891f48 Converting to using the Rakefile for testing. The old 'test' script is +3891f48 Converting to using the Rakefile for testing. The old 'test' script is now deprecated, and I'll send an email to the dev list and update the docs to reflect that. dcab464 Reworking test/lib structure a bit, and renaming all of the files so that their file names match their module names abe1d3c Fix trac #282 (Change URL to configref, mention --genconfig) 7030aca Small modification so i can make more changes @@ -3869,7 +3670,7 @@ 26bf373 Applying patch in #160. e46d007 Fixing #262. I somehow lost the line that only added a given user's jobs to each tab. 0af8ad7 Removing a test in the parser that is no longer necessary because of how imports work now, and fixing a snippet not to interfere with a local fact -5669d1b This commit adds two important features (but which probably were not +5669d1b This commit adds two important features (but which probably were not worth the priority I suddenly placed on them). fbdd6c4 Specifically rescuing Exception, since apparently the default does not rescue LoadErrors and everything else 349bddd collecting output from blastlist, for later use 4cd37ad Merged test framework into trunk - still not ready until tests are converted to use it. @@ -3927,8 +3728,8 @@ 655881c Ports now work with a provider daa79e2 Intermediate commit; ports are not working yet b657850 Fixing SSHKey support. -270f444 Beginning the process of moving parsedtypes to a provider. Each parsed -b9b3384 This is the initial commit of the changes to sync and retrieve. The +270f444 Beginning the process of moving parsedtypes to a provider. Each parsed type will have a parsedfile provider, which will be responsible for all of the file parsing and generation. This should allow us to create a useful DSL for file handling, but it also *drastically* simplifies these types. +b9b3384 This is the initial commit of the changes to sync and retrieve. The structure itself is now in place, and a few of the types (the most complicated ones -- file, user, group, plus exec since it was my easy first test) have been converted. 3733034 Renaming parsedfile to loadedfile, which makes much more sense and reduces some naming conflicts a887993 Adding Gentoo support from #224. c626796 Adding eat-last-line support in ERB @@ -4391,7 +4192,7 @@ 4d75041 Adding a "tag" metaparam 201aa02 Adding simple benchmarking, and using it in a few of the more obvious places. Also, fixed a bug in Scope#gennode. 0507486 Fixing #117. If only one value was provided, then it was not placed in an array, yet AST::Selector expected an array. The grammar needs to have some abstraction added or something, because I seem to have encountered this bug for every ast type that supports arrays internally. -ae4b12e Revamp the yumrepo type to deal with repositories defined anywhere in yum's +ae4b12e Revamp the yumrepo type to deal with repositories defined anywhere in yum's config files. Adds a generic module Puppet::IniConfig for parsing ini-style files 8df6e84 another small mount fix; this time, for stupid os x 88dd992 committing version changes d10a638 Committing an important fix to mounts; since i am sure no one has downloaded 0.15.3, i am just going to rerelease 0.15.3 with this fix in it @@ -4449,8 +4250,8 @@ c7ae839 Manifests can now specify node names with fully qualified domain names, too. 9b1e8d5 Accept a single file as a test to run in addition to a directory bdc819b Remove unused should method; add more yum parameters to the type -a9fdf9d Disbale running puppetmaster as puppet until we've sorted out which files -1365103 New yumrepo type for basic management of the yum configuration of +a9fdf9d Disbale running puppetmaster as puppet until we've sorted out which files need what ownership (there's trouble with /etc/puppet/ssl right now when puppetmaster runs as non-root) +1365103 New yumrepo type for basic management of the yum configuration of one repo. 6d4e46c Adding os x group management support 791e4da Committing support for group membership management. Currently only works on Linuxes and other OSes that use "useradd" that support -G. 932fd03 commiting package test fix that i thought i committed ages ago @@ -4556,7 +4357,7 @@ 56116c2 Fixing bug #73; node names now appear only once in the path c894eb2 Fixing bug #75, providing support for unnecessary end commas. 020499c Removing all of the autoname code -8c821c0 Mostly, this is a refactoring commit. There is one significant new feature, +8c821c0 Mostly, this is a refactoring commit. There is one significant new feature, though: overrides now only work within a class heirarchy, which is to say that a subclass can override an element in a base class, but a child scope cannot otherwise override an element in a base scope. 37c10d1 Switching setclass to use object_ids instead of class names, and adding some comments. c5d8680 Fixing scopes and AST so that definitions and classes are looked for in the scopes, instead of in a global list ee818a9 Adding some debugging to list the states being changed when in debug mode diff -Nru puppet-0.25.1/conf/gentoo/conf.d/puppetmaster puppet-0.25.4/conf/gentoo/conf.d/puppetmaster --- puppet-0.25.1/conf/gentoo/conf.d/puppetmaster 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/conf/gentoo/conf.d/puppetmaster 2010-01-29 21:32:27.000000000 +0000 @@ -9,4 +9,4 @@ #PUPPETMASTER_LOG="syslog" # You may specify other parameters to the puppetmaster here -#PUPPETMASTER_EXTRA_OPTS="--noca" +#PUPPETMASTER_EXTRA_OPTS="--no-ca" diff -Nru puppet-0.25.1/conf/osx/createpackage.sh puppet-0.25.4/conf/osx/createpackage.sh --- puppet-0.25.1/conf/osx/createpackage.sh 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/conf/osx/createpackage.sh 2010-01-29 21:32:27.000000000 +0000 @@ -54,6 +54,17 @@ chown -R root:admin "${pkgroot}" } +function install_docs() { + echo "Installing docs to ${pkgroot}" + docdir="${pkgroot}/usr/share/doc/puppet" + mkdir -p "${docdir}" + for docfile in CHANGELOG CHANGELOG.old COPYING LICENSE README README.queueing README.rst; do + install -m 0644 "${puppet_root}/${docfile}" "${docdir}" + done + chown -R root:wheel "${docdir}" + chmod 0755 "${docdir}" +} + function get_puppet_version() { puppet_version=$(RUBYLIB="${pkgroot}/${SITELIBDIR}:${RUBYLIB}" ruby -e "require 'puppet'; puts Puppet.version") } @@ -156,6 +167,7 @@ fi install_puppet + install_docs get_puppet_version if [ ! "${puppet_version}" ]; then diff -Nru puppet-0.25.1/conf/osx/preflight puppet-0.25.4/conf/osx/preflight --- puppet-0.25.1/conf/osx/preflight 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/conf/osx/preflight 2010-01-29 21:32:27.000000000 +0000 @@ -11,6 +11,10 @@ /bin/rm -Rf "${3}{SITELIBDIR}/puppet" /bin/rm -Rf "${3}{SITELIBDIR}/puppet.rb" +# remove old doc files + +/bin/rm -Rf "${3}/usr/share/doc/puppet" + # In puppet 0.24.x these executables lived in bindir, but in 0.25.x they # have been moved to sbindir. This cleans out old ones before installing. /bin/rm -Rf "${3}{BINDIR}/puppetca" diff -Nru puppet-0.25.1/conf/redhat/puppet.spec puppet-0.25.4/conf/redhat/puppet.spec --- puppet-0.25.1/conf/redhat/puppet.spec 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/conf/redhat/puppet.spec 2010-01-29 21:32:27.000000000 +0000 @@ -5,7 +5,7 @@ %define confdir conf/redhat Name: puppet -Version: 0.25.1 +Version: 0.25.2 Release: 1%{?dist} Summary: A network tool for managing many disparate systems License: GPLv2+ @@ -82,6 +82,9 @@ find examples/ -type f -empty | xargs rm find examples/ -type f | xargs chmod a-x +# puppet-queue.conf is more of an example, used for stompserver +mv conf/puppet-queue.conf examples/etc/puppet/ + %install rm -rf %{buildroot} ruby install.rb --destdir=%{buildroot} --quick --no-rdoc @@ -96,6 +99,7 @@ install -Dp -m0755 %{confdir}/server.init %{buildroot}%{_initrddir}/puppetmaster install -Dp -m0644 %{confdir}/fileserver.conf %{buildroot}%{_sysconfdir}/puppet/fileserver.conf install -Dp -m0644 %{confdir}/puppet.conf %{buildroot}%{_sysconfdir}/puppet/puppet.conf +install -Dp -m0644 conf/auth.conf %{buildroot}%{_sysconfdir}/puppet/auth.conf install -Dp -m0644 %{confdir}/logrotate %{buildroot}%{_sysconfdir}/logrotate.d/puppet # We need something for these ghosted files, otherwise rpmbuild @@ -123,7 +127,7 @@ %files %defattr(-, root, root, 0755) -%doc CHANGELOG COPYING LICENSE README examples +%doc CHANGELOG COPYING LICENSE README README.queueing examples %{_bindir}/pi %{_bindir}/puppet %{_bindir}/ralsh @@ -136,6 +140,7 @@ %dir %{_sysconfdir}/puppet %config(noreplace) %{_sysconfdir}/sysconfig/puppet %config(noreplace) %{_sysconfdir}/puppet/puppet.conf +%config(noreplace) %{_sysconfdir}/puppet/auth.conf %ghost %config(noreplace,missingok) %{_sysconfdir}/puppet/puppetca.conf %ghost %config(noreplace,missingok) %{_sysconfdir}/puppet/puppetd.conf %config(noreplace) %{_sysconfdir}/logrotate.d/puppet @@ -169,6 +174,7 @@ %{_mandir}/man8/filebucket.8.gz %{_mandir}/man8/puppetmasterd.8.gz %{_mandir}/man8/puppetrun.8.gz +%{_mandir}/man8/puppetqd.8.gz # Fixed uid/gid were assigned in bz 472073 (Fedora), 471918 (RHEL-5), # and 471919 (RHEL-4) @@ -214,6 +220,10 @@ rm -rf %{buildroot} %changelog +* Fri Jan 01 2010 Todd Zullinger - 0.25.2-1 +- Update to 0.25.2 +- Install auth.conf, puppetqd manpage, and queuing examples/docs + * Tue Oct 20 2009 Todd Zullinger - 0.25.1-1 - Update to 0.25.1 - Include the pi program and man page (R.I.Pienaar) diff -Nru puppet-0.25.1/conf/redhat/server.init puppet-0.25.4/conf/redhat/server.init --- puppet-0.25.1/conf/redhat/server.init 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/conf/redhat/server.init 2010-01-29 21:32:27.000000000 +0000 @@ -13,6 +13,7 @@ export PATH lockfile=/var/lock/subsys/puppetmaster +pidfile=/var/run/puppet/puppetmasterd.pid # Source function library. . /etc/rc.d/init.d/functions diff -Nru puppet-0.25.1/conf/redhat/server.sysconfig puppet-0.25.4/conf/redhat/server.sysconfig --- puppet-0.25.1/conf/redhat/server.sysconfig 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/conf/redhat/server.sysconfig 2010-01-29 21:32:27.000000000 +0000 @@ -28,4 +28,4 @@ #PUPPETMASTER_PORTS=( 18140 18141 18142 18143 ) # You may specify other parameters to the puppetmaster here -#PUPPETMASTER_EXTRA_OPTS=--noca +#PUPPETMASTER_EXTRA_OPTS=--no-ca diff -Nru puppet-0.25.1/debian/changelog puppet-0.25.4/debian/changelog --- puppet-0.25.1/debian/changelog 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/changelog 2010-02-12 16:48:13.000000000 +0000 @@ -1,3 +1,40 @@ +puppet (0.25.4-1ubuntu1) lucid; urgency=low + + * Merge from debian testing. Remaining changes: + - debian/rules: + + Don't start puppet when first installing puppet. + - debian/puppet.conf, lib/puppet/defaults.rb: + + Move templates to /etc/puppet. + - lib/puppet/defaults.rb: + + Fix /var/lib/puppet/state ownership. + + Change owner/group to "service". (LP #509625) + - debian/control: + + Move puppetmaster's Recommends to Suggests. + + Created puppet-testsuite as a seperate package. + Allow the users to run puppet's testsuite. + - tests/Rakefile: Fix rakefile so that the testsuite can actually be + run. + + -- Soren Hansen Fri, 12 Feb 2010 17:31:26 +0100 + +puppet (0.25.4-1) unstable; urgency=low + + [Nigel Kersten ] + * New upstream version 0.25.4 + + [ Micah Anderson ] + * Fix debian/rules typo in install of puppet-mode-init.el + * Fix which package puppet-mode-init.el gets installed into + * Add Suggests for vim-puppet and puppet-el on binary packages + + [ Stig Sandbeck Mathisen ] + * Update debian/copyright + * debian/{puppet,puppetmaster}.init: Add status argument, fix pid file + locations (Closes: #545975) + * Refactoring: Add binary packages for puppet-common, puppet-el, vim-puppet + + -- Stig Sandbeck Mathisen Mon, 01 Feb 2010 12:31:58 +0100 + puppet (0.25.1-3ubuntu2) lucid; urgency=low * lib/puppet/defaults.rb: Change owner/group to "service". diff -Nru puppet-0.25.1/debian/control puppet-0.25.4/debian/control --- puppet-0.25.1/debian/control 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/control 2010-02-12 16:48:13.000000000 +0000 @@ -1,20 +1,21 @@ Source: puppet Section: admin Priority: optional -XSBC-Original-Maintainer: Puppet Package Maintainers Maintainer: Ubuntu Developers -Uploaders: Thom May , Micah Anderson , Andrew Pollock , Nigel Kersten , Stig Sandbeck Mathisen +XSBC-Original-Maintainer: Puppet Package Maintainers +Uploaders: Micah Anderson , Andrew Pollock , Nigel Kersten , Stig Sandbeck Mathisen Build-Depends-Indep: ruby (>= 1.8.1), libopenssl-ruby, facter (>= 1.5) Build-Depends: debhelper (>= 5), openssl -Standards-Version: 3.8.3 +Standards-Version: 3.8.4 Vcs-Git: git://git.debian.org/git/pkg-puppet/puppet.git Vcs-Browser: http://git.debian.org/?p=pkg-puppet/puppet.git Homepage: http://reductivelabs.com/trac/puppet Package: puppet Architecture: all -Depends: ruby1.8, libxmlrpc-ruby, libopenssl-ruby, libshadow-ruby1.8, adduser, facter, lsb-base +Depends: ${misc:Depends}, ruby1.8, libxmlrpc-ruby, libopenssl-ruby, libshadow-ruby1.8, adduser, facter, lsb-base, puppet-common (= ${source:Version}) Recommends: rdoc, libaugeas-ruby1.8 +Suggests: puppet-el, vim-puppet Description: centralised configuration management for networks Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the @@ -29,9 +30,9 @@ Package: puppetmaster Architecture: all -Depends: ruby1.8, puppet (= ${source:Version}), facter, lsb-base +Depends: ${misc:Depends}, ruby1.8, puppet-common (= ${source:Version}), facter, lsb-base Conflicts: puppet (<< 0.24.7-1) -Suggests: rails (>= 1.2.3-2), rdoc, libldap-ruby1.8, apache2 | nginx, mongrel +Suggests: rails (>= 1.2.3-2), rdoc, libldap-ruby1.8, apache2 | nginx, mongrel, puppet-el, vim-puppet Description: centralised configuration management control daemon Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the @@ -46,14 +47,49 @@ . This package contains the manifest server, 'puppetmaster'. +Package: puppet-common +Architecture: all +Depends: ${misc:Depends}, ruby1.8, libxmlrpc-ruby, libopenssl-ruby, libshadow-ruby1.8, adduser +Conflicts: puppet (<< ${source:Version}), puppetmaster (<< ${source:Version}) +Description: common files for puppet and puppetmaster + Puppet lets you centrally manage every important aspect of your system + using a cross-platform specification language that manages all the + separate elements normally aggregated in different files, like users, + cron jobs, and hosts, along with obviously discrete elements like + packages, services, and files. + . + Puppet's simple declarative specification language provides powerful + classing abilities for drawing out the similarities between hosts while + allowing them to be as specific as necessary, and it handles dependency + and prerequisite relationships between objects clearly and explicitly. + . + This package contains the files common to the 'puppet' and + 'puppetmaster' packages. + +Package: vim-puppet +Architecture: all +Depends: ${misc:Depends} +Recommends: vim-addon-manager +Conflicts: puppet (<< ${source:Version}) +Description: Vim syntax highlighting for puppet manifests + The vim-puppet package provides filetype detection and syntax highlighting for + puppet manifests (files ending with ".pp"). + +Package: puppet-el +Architecture: all +Depends: ${misc:Depends}, emacsen-common +Conflicts: puppet (<< ${source:Version}) +Description: Emacs syntax highlighting for puppet manifests + The puppet-el package provides syntax highlighting for puppet manifests + Package: puppet-testsuite Architecture: all Depends: ruby1.8, puppet (= ${source:Version}), facter, lsb-base, rails (>= 1.2.3-2), rdoc, libldap-ruby1.8, mongrel Description: centralized configuration management control for networks - Puppet lets you centrally manage ervery important aspect of your system + Puppet lets you centrally manage every important aspect of your system using a cross-platform specification language that manages all the seperate elements normally aggregated in different files, like users, cron jobs, and hosts, along with obviously discrete elements like packages, services, and files. . - Theis package contains testsuite for puppet. + This package contains the testsuite for puppet. diff -Nru puppet-0.25.1/debian/copyright puppet-0.25.4/debian/copyright --- puppet-0.25.1/debian/copyright 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/copyright 2010-02-12 16:48:13.000000000 +0000 @@ -1,18 +1,363 @@ -This package was debianized by Jamie Wilkinson on -Thu, 27 Apr 2006 10:18:04 +1000. +Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 +Name: Puppet +Maintainer: + Andrew Pollock , + Micah Anderson , + Nigel Kersten , + Stig Sandbeck Mathisen +Source: git://github.com/reductivelabs/puppet.git, + http://reductivelabs.com/trac/puppet/wiki/DownloadingPuppet -It was downloaded from http://reductivelabs.com/downloads/puppet +Copyright: 2005-2010 Reductive Labs, LLC +License: GPL-2+ -Puppet - Automating Configuration Management. -Copyright (C) 2005 Reductive Labs LLC +Files: debian/* +Copyright: + Andrew Pollock , + Jamie Wilkinson , + Matthew Palmer , + Micah Anderson , + Nigel Kersten , + Stig Sandbeck Mathisen , + Thom May +License: GPL-2 -License: +Files: install.rb +Copyright: Austin Ziegler +License: GPL-2+ -From: -http://reductivelabs.com/trac/puppet/wiki/FrequentlyAskedQuestions#what-license-is-puppet-released-under +Files: conf/gentoo/init.d/puppet* +Copyright: Gentoo Foundation +License: GPL-2 -Puppet is open source and is released under the GNU Public License. +Files: lib/puppet/util/rdoc/generators/template/puppet/puppet.rb +Copyright: The FaerieMUD Consortium. +License: CC-BY-1.0 + This work is licensed under the Creative Commons Attribution License. To view + a copy of this license, visit http://creativecommons.org/licenses/by/1.0/ or + send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California + 94305, USA. -On Debian systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. +Files: conf/osx/createpackage.sh +Copyright: Google Inc. +License: Apache + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + . + http://www.apache.org/licenses/LICENSE-2.0 + . + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License + . + On Debian systems, the full text of the Apache License can be found at + "/usr/share/common-licenses/Apache-2.0" +Files: lib/puppet/external/event-loop/* +Copyright: Daniel Brockman +License: GPL-2+ + +Files: lib/puppet/external/nagios/parser.rb +Copyright: Minero Aoki +License: other + This program is free software. + You can distribute/modify this program under the same terms of ruby. + . + As a special exception, when this code is copied by Racc + into a Racc output file, you may use that output file + without restriction. + +Files: lib/puppet/network/http_server/mongrel.rb +Copyright: Manuel Holtgrewe, Luke Kanies +License: MIT + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Files: lib/puppet/provider/augeas/augeas.rb, lib/puppet/type/augeas.rb +Copyright: Red Hat Inc. +License: GPL-2+ + +Files: lib/puppet/provider/mcx/mcxcontent.rb +Copyright: Jeff McCune +License: GPL-2+ + +Files: lib/puppet/type/mcx.rb, spec/unit/type/mcx.rb +Copyright: Jeffrey J McCune. +License: GPL-2+ + +Files: lib/puppet/provider/nameservice/directoryservice.rb +Copyright: Jeff McCune +License: GPL-2 + +Files: lib/puppet/provider/package/pkgdmg.rb +Copyright: Jeff McCune Jeff McCune +License: GPL-2 + +Files: test/ral/providers/service/debian.rb +Copyright: David Schmitt +License: missing + +Files: examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +Copyright: David Schmitt +License: BSD + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the Author nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + . + On Debian systems, the full text of the 3-clause BSD license can be found in + the file "/usr/share/common-licenses/BSD". + +License: GPL-2 + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation (version 2 of the License) + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston MA 02110-1301 USA + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + "/usr/share/common-licenses/GPL-2". + +License: GPL-2+ + This program is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; + either version 2 of the License, or (at your option) any + later version. + . + This file is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty + of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + . + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + . + On Debian systems, the full text of the GNU General Public + License version 2 can be found in the file + "/usr/share/common-licenses/GPL-2". + +License: CC-BY-1.0 + THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE + COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY + COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS + AUTHORIZED UNDER THIS LICENSE IS PROHIBITED. + . + BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE + BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS YOU THE RIGHTS + CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND + CONDITIONS. + . + 1. Definitions + . + "Collective Work" means a work, such as a periodical issue, anthology or + encyclopedia, in which the Work in its entirety in unmodified form, along with + a number of other contributions, constituting separate and independent works in + themselves, are assembled into a collective whole. A work that constitutes a + Collective Work will not be considered a Derivative Work (as defined below) for + the purposes of this License. "Derivative Work" means a work based upon the + Work or upon the Work and other pre-existing works, such as a translation, + musical arrangement, dramatization, fictionalization, motion picture version, + sound recording, art reproduction, abridgment, condensation, or any other form + in which the Work may be recast, transformed, or adapted, except that a work + that constitutes a Collective Work will not be considered a Derivative Work for + the purpose of this License. + . + "Licensor" means the individual or entity that offers the Work under the terms + of this License. "Original Author" means the individual or entity who created + the Work. + . + "Work" means the copyrightable work of authorship offered under the terms of + this License. "You" means an individual or entity exercising rights under this + License who has not previously violated the terms of this License with respect + to the Work, or who has received express permission from the Licensor to + exercise rights under this License despite a previous violation. + . + 2. Fair Use Rights. Nothing in this license is intended to reduce, limit, or + restrict any rights arising from fair use, first sale or other limitations on + the exclusive rights of the copyright owner under copyright law or other + applicable laws. + . + 3. License Grant. Subject to the terms and conditions of this License, Licensor + hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the + duration of the applicable copyright) license to exercise the rights in the + Work as stated below: + . + a. to reproduce the Work, to incorporate the Work into one or more Collective + Works, and to reproduce the Work as incorporated in the Collective Works; + . + b. to create and reproduce Derivative Works; + . + c. to distribute copies or phonorecords of, display publicly, perform publicly, + and perform publicly by means of a digital audio transmission the Work + including as incorporated in Collective Works; + . + d. to distribute copies or phonorecords of, display publicly, perform publicly, + and perform publicly by means of a digital audio transmission Derivative Works; + . + The above rights may be exercised in all media and formats whether now known or + hereafter devised. The above rights include the right to make such + modifications as are technically necessary to exercise the rights in other + media and formats. All rights not expressly granted by Licensor are hereby + reserved. + . + 4. Restrictions. + . + The license granted in Section 3 above is expressly made subject to and limited + by the following restrictions: + . + a. You may distribute, publicly display, publicly perform, or publicly + digitally perform the Work only under the terms of this License, and You must + include a copy of, or the Uniform Resource Identifier for, this License with + every copy or phonorecord of the Work You distribute, publicly display, + publicly perform, or publicly digitally perform. You may not offer or impose + any terms on the Work that alter or restrict the terms of this License or the + recipients' exercise of the rights granted hereunder. You may not sublicense + the Work. You must keep intact all notices that refer to this License and to + the disclaimer of warranties. You may not distribute, publicly display, + publicly perform, or publicly digitally perform the Work with any technological + measures that control access or use of the Work in a manner inconsistent with + the terms of this License Agreement. The above applies to the Work as + incorporated in a Collective Work, but this does not require the Collective + Work apart from the Work itself to be made subject to the terms of this + License. If You create a Collective Work, upon notice from any Licensor You + must, to the extent practicable, remove from the Collective Work any reference + to such Licensor or the Original Author, as requested. If You create a + Derivative Work, upon notice from any Licensor You must, to the extent + practicable, remove from the Derivative Work any reference to such Licensor or + the Original Author, as requested. + . + b. If you distribute, publicly display, publicly perform, or publicly digitally + perform the Work or any Derivative Works or Collective Works, You must keep + intact all copyright notices for the Work and give the Original Author credit + reasonable to the medium or means You are utilizing by conveying the name (or + pseudonym if applicable) of the Original Author if supplied; the title of the + Work if supplied; in the case of a Derivative Work, a credit identifying the + use of the Work in the Derivative Work (e.g., "French translation of the Work + by Original Author," or "Screenplay based on original Work by Original + Author"). Such credit may be implemented in any reasonable manner; provided, + however, that in the case of a Derivative Work or Collective Work, at a minimum + such credit will appear where any other comparable authorship credit appears + and in a manner at least as prominent as such other comparable authorship + credit. + . + 5. Representations, Warranties and Disclaimer + . + a. By offering the Work for public release under this License, Licensor + represents and warrants that, to the best of Licensor's knowledge after + reasonable inquiry: + . + i. Licensor has secured all rights in the Work necessary to grant the license + rights hereunder and to permit the lawful exercise of the rights granted + hereunder without You having any obligation to pay any royalties, compulsory + license fees, residuals or any other payments; + . + ii. The Work does not infringe the copyright, trademark, publicity rights, common + law rights or any other right of any third party or constitute defamation, + invasion of privacy or other tortious injury to any third party. + . + b. EXCEPT AS EXPRESSLY STATED IN THIS LICENSE OR OTHERWISE AGREED IN WRITING OR + REQUIRED BY APPLICABLE LAW, THE WORK IS LICENSED ON AN "AS IS" BASIS, WITHOUT + WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT + LIMITATION, ANY WARRANTIES REGARDING THE CONTENTS OR ACCURACY OF THE WORK. + . + 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, + AND EXCEPT FOR DAMAGES ARISING FROM LIABILITY TO A THIRD PARTY RESULTING FROM + BREACH OF THE WARRANTIES IN SECTION 5, IN NO EVENT WILL LICENSOR BE LIABLE TO + YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR + EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF + LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + . + 7. Termination + . + a. This License and the rights granted hereunder will terminate automatically + upon any breach by You of the terms of this License. Individuals or entities + who have received Derivative Works or Collective Works from You under this + License, however, will not have their licenses terminated provided such + individuals or entities remain in full compliance with those licenses. Sections + 1, 2, 5, 6, 7, and 8 will survive any termination of this License. + . + b. Subject to the above terms and conditions, the license granted here is + perpetual (for the duration of the applicable copyright in the Work). + Notwithstanding the above, Licensor reserves the right to release the Work + under different license terms or to stop distributing the Work at any time; + provided, however that any such election will not serve to withdraw this + License (or any other license that has been, or is required to be, granted + under the terms of this License), and this License will continue in full force + and effect unless terminated as stated above. + . + 8. Miscellaneous + . + Each time You distribute or publicly digitally perform the Work or a Collective + Work, the Licensor offers to the recipient a license to the Work on the same + terms and conditions as the license granted to You under this License. + . + Each time You distribute or publicly digitally perform a Derivative Work, + Licensor offers to the recipient a license to the original Work on the same + terms and conditions as the license granted to You under this License. + . + If any provision of this License is invalid or unenforceable under applicable + law, it shall not affect the validity or enforceability of the remainder of the + terms of this License, and without further action by the parties to this + agreement, such provision shall be reformed to the minimum extent necessary to + make such provision valid and enforceable. + . + No term or provision of this License shall be deemed waived and no breach + consented to unless such waiver or consent shall be in writing and signed by + the party to be charged with such waiver or consent. + . + This License constitutes the entire agreement between the parties with respect + to the Work licensed here. There are no understandings, agreements or + representations with respect to the Work not specified here. Licensor shall not + be bound by any additional provisions that may appear in any communication from + You. This License may not be modified without the mutual written agreement of + the Licensor and You. diff -Nru puppet-0.25.1/debian/puppet-common.dirs puppet-0.25.4/debian/puppet-common.dirs --- puppet-0.25.1/debian/puppet-common.dirs 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/puppet-common.dirs 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,4 @@ +etc/puppet/manifests +usr/lib/ruby/1.8 +var/lib/puppet +var/log/puppet diff -Nru puppet-0.25.1/debian/puppet-common.install puppet-0.25.4/debian/puppet-common.install --- puppet-0.25.1/debian/puppet-common.install 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/puppet-common.install 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,2 @@ +debian/puppet.conf etc/puppet +debian/tmp/usr/lib/ruby/1.8/* usr/lib/ruby/1.8 diff -Nru puppet-0.25.1/debian/puppet.dirs puppet-0.25.4/debian/puppet.dirs --- puppet-0.25.1/debian/puppet.dirs 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/puppet.dirs 2010-02-12 16:48:13.000000000 +0000 @@ -1,7 +1 @@ usr/sbin -usr/lib/ruby/1.8 -var/log/puppet -etc/puppet/files -usr/share/vim/addons/ftdetect -usr/share/vim/addons/syntax -var/lib/puppet diff -Nru puppet-0.25.1/debian/puppet-el.dirs puppet-0.25.4/debian/puppet-el.dirs --- puppet-0.25.1/debian/puppet-el.dirs 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/puppet-el.dirs 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1 @@ +usr/share/emacs/site-lisp diff -Nru puppet-0.25.1/debian/puppet-el.emacsen-install puppet-0.25.4/debian/puppet-el.emacsen-install --- puppet-0.25.1/debian/puppet-el.emacsen-install 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/puppet-el.emacsen-install 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,25 @@ +#!/bin/sh +# +# emacsen install script for the Debian GNU/Linux puppet-el package + +FLAVOR=$1 +PACKAGE=puppet-el + +ELDIR=/usr/share/emacs/site-lisp/ +ELCDIR=/usr/share/${FLAVOR}/site-lisp/${PACKAGE} +ELFILE="puppet-mode.el" +FLAGS="-batch -no-site-file -l path.el -f batch-byte-compile" + +if [ ${FLAVOR} != emacs ]; then + echo install/${PACKAGE}: Byte-compiling for ${FLAVOR} + + install -m 755 -d ${ELCDIR} + cd ${ELDIR} + cp ${ELFILE} ${ELCDIR} + cd ${ELCDIR} + cat << EOF > path.el +(setq load-path (cons "." load-path) byte-compile-warnings nil) +EOF + ${FLAVOR} ${FLAGS} ${ELFILE} + rm -f ${ELFILE} path.el +fi diff -Nru puppet-0.25.1/debian/puppet-el.emacsen-remove puppet-0.25.4/debian/puppet-el.emacsen-remove --- puppet-0.25.1/debian/puppet-el.emacsen-remove 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/puppet-el.emacsen-remove 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +FLAVOR=$1 +PACKAGE=puppet-el +ELCFILE=puppet-mode.elc + +if [ ${FLAVOR} != emacs ]; then + echo remove/${PACKAGE}: Purging byte-compiled files for ${FLAVOR} + rm -f /usr/share/${FLAVOR}/site-lisp/${ELCFILE} +fi diff -Nru puppet-0.25.1/debian/puppet-el.emacsen.startup puppet-0.25.4/debian/puppet-el.emacsen.startup --- puppet-0.25.1/debian/puppet-el.emacsen.startup 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/puppet-el.emacsen.startup 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,9 @@ +;; -*-emacs-lisp-*- +;; +;; Emacs startup file for the Debian GNU/Linux puppet-el package + +(autoload 'puppet-mode "puppet-mode" "Major mode for editing puppet manifests") + +(add-to-list 'auto-mode-alist '("\\.pp$" . puppet-mode)) + + diff -Nru puppet-0.25.1/debian/puppet-el.install puppet-0.25.4/debian/puppet-el.install --- puppet-0.25.1/debian/puppet-el.install 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/puppet-el.install 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1 @@ +ext/emacs/puppet-mode.el usr/share/emacs/site-lisp diff -Nru puppet-0.25.1/debian/puppet.init puppet-0.25.4/debian/puppet.init --- puppet-0.25.1/debian/puppet.init 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/puppet.init 2010-02-12 16:48:13.000000000 +0000 @@ -13,7 +13,7 @@ DAEMON_OPTS="" NAME=puppetd DESC="puppet configuration management tool" -PIDFILE="/var/run/${NAME}.pid" +PIDFILE="/var/run/puppet/${NAME}.pid" test -x $DAEMON || exit 0 @@ -47,6 +47,10 @@ start-stop-daemon --stop --quiet --pidfile $PIDFILE } +status_puppet() { + status_of_proc -p "${PIDFILE}" "${DAEMON}" "${NAME}" +} + case "$1" in start) log_begin_msg "Starting $DESC" @@ -63,6 +67,9 @@ reload_puppet log_end_msg 0 ;; + status) + status_puppet + ;; restart|force-reload) log_begin_msg "Restarting $DESC" stop_puppet @@ -71,7 +78,7 @@ log_end_msg 0 ;; *) - echo "Usage: $0 {start|stop|restart|force-reload|reload}" >&2 + echo "Usage: $0 {start|stop|status|restart|force-reload|reload}" >&2 exit 1 ;; esac diff -Nru puppet-0.25.1/debian/puppet.install puppet-0.25.4/debian/puppet.install --- puppet-0.25.1/debian/puppet.install 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/puppet.install 2010-02-12 16:48:13.000000000 +0000 @@ -1,7 +1,5 @@ -debian/puppet.conf etc/puppet debian/tmp/usr/bin/filebucket usr/bin debian/tmp/usr/bin/puppet usr/bin debian/tmp/usr/bin/puppetdoc usr/bin debian/tmp/usr/sbin/puppetd usr/sbin debian/tmp/usr/bin/ralsh usr/bin -debian/tmp/usr/lib/ruby/1.8/* usr/lib/ruby/1.8 diff -Nru puppet-0.25.1/debian/puppetmaster.dirs puppet-0.25.4/debian/puppetmaster.dirs --- puppet-0.25.1/debian/puppetmaster.dirs 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/puppetmaster.dirs 2010-02-12 16:48:13.000000000 +0000 @@ -1 +1 @@ -etc/puppet/manifests +usr/sbin diff -Nru puppet-0.25.1/debian/puppetmaster.init puppet-0.25.4/debian/puppetmaster.init --- puppet-0.25.1/debian/puppetmaster.init 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/puppetmaster.init 2010-02-12 16:48:13.000000000 +0000 @@ -41,13 +41,13 @@ NUMSTART=0 STARTPORT=$PORT while [ $NUMSTART -lt $PUPPETMASTERS ]; do - start-stop-daemon --start --quiet --pidfile=/var/run/${NAME}-${STARTPORT}.pid \ - --startas $DAEMON -- $DAEMON_OPTS --masterport=$STARTPORT --pidfile=/var/run/${NAME}-${STARTPORT}.pid + start-stop-daemon --start --quiet --pidfile=/var/run/puppet/${NAME}-${STARTPORT}.pid \ + --startas $DAEMON -- $DAEMON_OPTS --masterport=$STARTPORT --pidfile=/var/run/puppet/${NAME}-${STARTPORT}.pid STARTPORT=$(($STARTPORT + 1)) NUMSTART=$(($NUMSTART + 1)) done else - start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \ + start-stop-daemon --start --quiet --pidfile /var/run/puppet/${NAME}.pid \ --startas $DAEMON -- $DAEMON_OPTS --masterport=$PORT fi else @@ -62,16 +62,38 @@ NUMSTART=0 STOPPORT=$PORT while [ $NUMSTART -lt $PUPPETMASTERS ]; do - start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}-${STOPPORT}.pid - rm /var/run/${NAME}-${STOPPORT}.pid + start-stop-daemon --stop --quiet --pidfile /var/run/puppet/${NAME}-${STOPPORT}.pid + rm -f /var/run/puppet/${NAME}-${STOPPORT}.pid STOPPORT=$(($STOPPORT + 1)) NUMSTART=$(($NUMSTART + 1)) done else - start-stop-daemon --stop --quiet --pidfile /var/run/${NAME}.pid + start-stop-daemon --stop --quiet --pidfile /var/run/puppet/${NAME}.pid fi } +status_puppetmaster() { + if is_true "$START" ; then + if [ "$SERVERTYPE" = "mongrel" ] + then + NUMSTART=0 + STARTPORT=$PORT + while [ $NUMSTART -lt $PUPPETMASTERS ]; do + status_of_proc -p "/var/run/puppet/${NAME}-${STARTPORT}.pid" \ + "${DAEMON}" "${NAME}-${STARTPORT}" + STARTPORT=$(($STARTPORT + 1)) + NUMSTART=$(($NUMSTART + 1)) + done + else + status_of_proc -p "/var/run/puppet/${NAME}.pid" "${DAEMON}" "${NAME}" + fi + else + echo "" + echo "puppetmaster not configured to start" + fi +} + + case "$1" in start) log_begin_msg "Starting $DESC" @@ -86,6 +108,9 @@ reload) # Do nothing, as Puppetmaster rechecks its config automatically ;; + status) + status_puppetmaster + ;; restart|force-reload) log_begin_msg "Restarting $DESC" stop_puppetmaster @@ -94,7 +119,7 @@ log_end_msg 0 ;; *) - echo "Usage: $0 {start|stop|restart|force-reload}" >&2 + echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2 exit 1 ;; esac diff -Nru puppet-0.25.1/debian/puppet.NEWS puppet-0.25.4/debian/puppet.NEWS --- puppet-0.25.1/debian/puppet.NEWS 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/puppet.NEWS 2010-02-12 16:48:13.000000000 +0000 @@ -1,3 +1,13 @@ +puppet (0.25.4-1) unstable; urgency=low + + In this packaging version we add a "puppet-common" package, on which the + packages "puppet" and "puppetmaster" depend. + + The editor syntax highlighting code previously in the "puppet" package has + been moved to the packages "puppet-el" and "vim-puppet". + + -- Stig Sandbeck Mathisen Tue, 19 Jan 2010 13:09:36 +0000 + puppet (0.25.1-3) unstable; urgency=low The default setting for puppet starting on boot has been changed from true diff -Nru puppet-0.25.1/debian/rules puppet-0.25.4/debian/rules --- puppet-0.25.1/debian/rules 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/debian/rules 2010-02-12 16:48:13.000000000 +0000 @@ -35,6 +35,7 @@ dh_testdir dh_testroot rm -f build-stamp configure-stamp + rm -f debian/puppet-common.logcheck.ignore.server dh_clean install: build @@ -55,15 +56,15 @@ # Vim auto-syntax-highlighting stuff $(INSTALL) -m0644 ext/vim/syntax/puppet.vim \ - $(CURDIR)/debian/puppet/usr/share/vim/addons/syntax/ + $(CURDIR)/debian/vim-puppet/usr/share/vim/addons/syntax/ $(INSTALL) -m0644 ext/vim/ftdetect/puppet.vim \ - $(CURDIR)/debian/puppet/usr/share/vim/addons/ftdetect/ + $(CURDIR)/debian/vim-puppet/usr/share/vim/addons/ftdetect/ + $(INSTALL) -m0644 debian/vim-puppet.yaml \ + $(CURDIR)/debian/vim-puppet/usr/share/vim/registry/ # Emacs mode - $(INSTALL) -m0644 ext/emacs/puppet-mode-init.el \ - $(CURDIR)/debian/puppet/etc/emacs/site-start.d/50puppet-mode-init.el $(INSTALL) -m0644 ext/emacs/puppet-mode.el \ - $(CURDIR)/debian/puppet/usr/share/emacs/site-lisp/puppet-mode.el + $(CURDIR)/debian/puppet-el/usr/share/emacs/site-lisp/puppet-mode.el dh_installexamples examples/* @@ -71,9 +72,7 @@ # Logcheck rules. Gee I wish you could specify a file to source # in dh_installlogcheck. - ln ext/logcheck/puppet debian/puppet.logcheck.ignore.server - dh_installlogcheck - rm debian/puppet.logcheck.ignore.server + ln ext/logcheck/puppet debian/puppet-common.logcheck.ignore.server # Build architecture-dependent files here. binary-arch: build install @@ -85,6 +84,8 @@ dh_install -i dh_installchangelogs -i CHANGELOG dh_installdocs -i + dh_installemacsen + dh_installlogcheck dh_installman dh_installinit -ppuppetmaster dh_installinit -ppuppet --no-start --error-handler=true -- defaults 21 diff -Nru puppet-0.25.1/debian/vim-puppet.dirs puppet-0.25.4/debian/vim-puppet.dirs --- puppet-0.25.1/debian/vim-puppet.dirs 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/vim-puppet.dirs 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,3 @@ +usr/share/vim/registry +usr/share/vim/addons/syntax +usr/share/vim/addons/ftdetect diff -Nru puppet-0.25.1/debian/vim-puppet.README.Debian puppet-0.25.4/debian/vim-puppet.README.Debian --- puppet-0.25.1/debian/vim-puppet.README.Debian 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/vim-puppet.README.Debian 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,13 @@ +Dear user, this package provides the vim addon puppet, but it is not enabled +per default. + +If you want to enable it for your user account just execute + + vim-addons install puppet + +Similarly, to enable it for all users of this system just execute (as root): + + vim-addons -w install puppet + +vim-addons is provided by the vim-addon-manager package, have a look at its +manpage for more information. diff -Nru puppet-0.25.1/debian/vim-puppet.yaml puppet-0.25.4/debian/vim-puppet.yaml --- puppet-0.25.1/debian/vim-puppet.yaml 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/debian/vim-puppet.yaml 2010-02-12 16:48:13.000000000 +0000 @@ -0,0 +1,5 @@ +addon: puppet +description: "Syntax highlighting for puppet" +files: + - ftdetect/puppet.vim + - syntax/puppet.vim diff -Nru puppet-0.25.1/ext/bin/sleeper puppet-0.25.4/ext/bin/sleeper --- puppet-0.25.1/ext/bin/sleeper 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/ext/bin/sleeper 1970-01-01 01:00:00.000000000 +0100 @@ -1,67 +0,0 @@ -#!/usr/bin/env ruby -w - -### -# sleep indefinitely as a debug - -require 'getoptlong' - -#----------------------------------------------------------------- -def daemonize - outfile = "/tmp/sleeperout" - if pid = fork() - Process.detach(pid) - sleep 1 - # verify that we didn't have any problems starting the daemon - if FileTest.exists?(outfile) - $stderr.puts "Sleeper failed: %s" % File.read(outfile) - File.unlink(outfile) - exit(14) - else - exit(0) - end - end - Process.setsid - Dir.chdir("/") - begin - $stdin.reopen "/dev/null" - $stdout.reopen "/dev/null", "a" - $stderr.reopen $stdin - rescue => detail - File.open(outfile, "w") { |f| - f.puts detail - } - exit(12) - end -end -#----------------------------------------------------------------- - -debug = false - -result = GetoptLong.new( - [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--help", "-h", GetoptLong::NO_ARGUMENT ] -) - -result.each { |opt,arg| - case opt - when "--help" - puts "There is no help yet" - exit - when "--debug" - debug = true - else - raise "Invalid option '#{opt}'" - end -} - -trap(:INT) { - exit -} - -unless debug - daemonize() -end - -# Sleep for no more than two minutes -sleep 120 -exit diff -Nru puppet-0.25.1/ext/ldap/puppet.schema puppet-0.25.4/ext/ldap/puppet.schema --- puppet-0.25.1/ext/ldap/puppet.schema 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/ext/ldap/puppet.schema 2010-01-29 21:32:27.000000000 +0000 @@ -1,28 +1,24 @@ -# These OIDs are all fake. No guarantees there won't be conflicts. -# -# $Id$ - -attributetype ( 1.1.3.10 NAME 'puppetclass' +attributetype ( 1.3.6.1.4.1.34380.1.1.3.10 NAME 'puppetClass' DESC 'Puppet Node Class' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) -attributetype ( 1.1.3.9 NAME 'parentnode' +attributetype ( 1.3.6.1.4.1.34380.1.1.3.9 NAME 'parentNode' DESC 'Puppet Parent Node' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE ) -attributetype ( 1.1.3.11 NAME 'environment' +attributetype ( 1.3.6.1.4.1.34380.1.1.3.11 NAME 'environment' DESC 'Puppet Node Environment' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) -attributetype ( 1.1.3.12 NAME 'puppetvar' +attributetype ( 1.3.6.1.4.1.34380.1.1.3.12 NAME 'puppetVar' DESC 'A variable setting for puppet' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 ) -objectclass ( 1.1.1.2 NAME 'puppetClient' SUP top AUXILIARY +objectclass ( 1.3.6.1.4.1.34380.1.1.1.2 NAME 'puppetClient' SUP top AUXILIARY DESC 'Puppet Client objectclass' MAY ( puppetclass $ parentnode $ environment $ puppetvar )) diff -Nru puppet-0.25.1/ext/module_puppet puppet-0.25.4/ext/module_puppet --- puppet-0.25.1/ext/module_puppet 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/ext/module_puppet 1970-01-01 01:00:00.000000000 +0100 @@ -1,209 +0,0 @@ -#!/usr/bin/env ruby - -# -# = Synopsis -# -# Run a +puppet+ script as a cfengine module. -# -# = Usage -# -# puppet_module [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose] -# [-l|--logdest ] -# -# = Description -# -# This is the standalone puppet execution script; use it to execute -# individual scripts that you write. If you need to execute site-wide -# scripts, use +puppetd+ and +puppetmasterd+. -# -# = Options -# -# Note that any configuration parameter that's valid in the configuration file -# is also a valid long argument. For example, 'ssldir' is a valid configuration -# parameter, so you can specify '--ssldir ' as an argument. -# -# See the configuration file for the full list of acceptable parameters. -# -# debug:: -# Enable full debugging. -# -# help:: -# Print this help message -# -# logdest:: -# Where to send messages. Choose between syslog, the console, and a log file. -# Defaults to sending messages to the console. -# -# verbose:: -# Print extra information. -# -# = Author -# -# Luke Kanies -# -# = Copyright -# -# Copyright (c) 2005 Reductive Labs, LLC -# Licensed under the GNU Public License - -require 'puppet' -require 'puppet/network/handler' -require 'puppet/network/client' -require 'getoptlong' - -options = [ - [ "--debug", "-d", GetoptLong::NO_ARGUMENT ], - [ "--help", "-h", GetoptLong::NO_ARGUMENT ], - [ "--logdest", "-l", GetoptLong::REQUIRED_ARGUMENT ], - [ "--verbose", "-v", GetoptLong::NO_ARGUMENT ], - [ "--use-nodes", GetoptLong::NO_ARGUMENT ], - [ "--version", "-V", GetoptLong::NO_ARGUMENT ] -] - -# Add all of the config parameters as valid options. -Puppet.settings.addargs(options) - -result = GetoptLong.new(*options) - -debug = false -verbose = false -noop = false -logfile = false -parseonly = false - -master = { - :Local => true -} - -setdest = false - -begin - result.each { |opt,arg| - case opt - when "--version" - puts "%s" % Puppet.version - exit - when "--help" - if Puppet.features.usage? - RDoc::usage && exit - else - puts "No help available unless you have RDoc::usage installed" - exit - end - when "--use-nodes" - master[:UseNodes] = true - when "--verbose" - Puppet::Util::Log.level = :info - Puppet::Util::Log.newdestination(:console) - verbose = true - when "--debug" - Puppet::Util::Log.level = :debug - Puppet::Util::Log.newdestination(:console) - debug = true - when "--logdest" - begin - Puppet::Util::Log.newdestination arg - setdest=true - rescue => detail - $stderr.puts detail.to_s - end - else - Puppet.settings.handlearg(opt, arg) - end - } -rescue GetoptLong::InvalidOption => detail - $stderr.puts "Try '#{$0} --help'" - if Puppet.features.usage? - RDoc::usage(1,'usage') - end - exit(1) -end - -# Now parse the config -if Puppet[:config] and File.exists? Puppet[:config] - Puppet.settings.parse(Puppet[:config]) -end - -client = nil -server = nil - -[:INT, :TERM].each do |signal| - trap(signal) do - Puppet.notice "Caught #{signal}; shutting down" - [client, server].each { |obj| - if obj - obj.shutdown - end - } - end -end - -if Puppet.settings.print_configs? - exit(Puppet.settings.print_configs ? 0 : 1) -end - -unless ARGV.length > 0 - $stderr.puts "You must pass a script to parse" - exit(14) -end - -unless setdest - Puppet::Util::Log.newdestination(:syslog) -end - -Puppet[:manifest] = ARGV.shift - -unless ENV.include?("CFALLCLASSES") - $stderr.puts "Cfengine classes must be passed to the module" - exit(15) -end - -# Collect our facts. -Puppet::Node::Facts.terminus_class = :facter -facts = Puppet::Node::Facts.find("me") -facts.name = facts.values["hostname"] - -# Create our Node -node = Puppet::Node.new(facts.name) - -# Merge in the facts. -node.merge(facts.values) - -classes = ENV["CFALLCLASSES"].split(":") - -if classes.empty? - $stderr.puts "Could not find any cfengine classes" - exit(16) -end - -node.classes = classes - -begin - # Compile our configuration - catalog = Puppet::Resource::Catalog.find(node.name, :use_node => node) -rescue => detail - if Puppet[:trace] - puts detail.backtrace - end - if detail.is_a?(XMLRPC::FaultException) - $stderr.puts detail.message - else - $stderr.puts detail - end - exit(1) -end - -if parseonly - exit(0) -end - -begin - # Translate it to a RAL configuration - catalog = catalog.to_ral - - # And apply it - catalog.apply -rescue => detail - Puppet.err detail - exit(1) -end diff -Nru puppet-0.25.1/ext/puppetlast puppet-0.25.4/ext/puppetlast --- puppet-0.25.1/ext/puppetlast 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/ext/puppetlast 2010-02-12 16:48:13.000000000 +0000 @@ -4,6 +4,7 @@ # AJ "Fujin" Christensen # require 'puppet' +require 'time' Puppet[:config] = "/etc/puppet/puppet.conf" Puppet.parse_config @@ -11,5 +12,5 @@ Puppet::Node::Facts.terminus_class = :yaml Puppet::Node::Facts.search("*").sort { |a,b| a.name <=> b.name }.each do |node| - puts "#{node.name} #{node.expired? ? 'cached expired, ' : ''}checked in #{((Time.now - node.values[:_timestamp]) / 60).floor} minutes ago" + puts "#{node.name} #{node.expired? ? 'cached expired, ' : ''}checked in #{((Time.now - Time.parse(node.values[:_timestamp].to_s)) / 60).floor} minutes ago" end diff -Nru puppet-0.25.1/ext/rack/README puppet-0.25.4/ext/rack/README --- puppet-0.25.1/ext/rack/README 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/ext/rack/README 2010-01-29 21:32:27.000000000 +0000 @@ -43,7 +43,7 @@ got set up. Requirements: - Passenger version 2.2.2 or newer*** + Passenger version 2.2.2 or 2.2.5 or newer*** Rack version 1.0.0 Apache 2.x SSL Module loaded @@ -68,6 +68,6 @@ *** Important note about Passenger versions: 2.2.2 is known to work. 2.2.3-2.2.4 are known to *NOT* work. - 2.2.5 (when it is released) is expected to work properly again. + 2.2.5 works again when used with Puppet 0.25.2+. Passenger installation doc: http://www.modrails.com/install.html diff -Nru puppet-0.25.1/ext/regexp_nodes/classes/databases puppet-0.25.4/ext/regexp_nodes/classes/databases --- puppet-0.25.1/ext/regexp_nodes/classes/databases 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/ext/regexp_nodes/classes/databases 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,2 @@ +db\d{2} +mysql diff -Nru puppet-0.25.1/ext/regexp_nodes/classes/webservers puppet-0.25.4/ext/regexp_nodes/classes/webservers --- puppet-0.25.1/ext/regexp_nodes/classes/webservers 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/ext/regexp_nodes/classes/webservers 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,2 @@ +^(web|www) +leterel diff -Nru puppet-0.25.1/ext/regexp_nodes/parameters/environment/prod puppet-0.25.4/ext/regexp_nodes/parameters/environment/prod --- puppet-0.25.1/ext/regexp_nodes/parameters/environment/prod 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/ext/regexp_nodes/parameters/environment/prod 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1 @@ +\d{3}$ diff -Nru puppet-0.25.1/ext/regexp_nodes/parameters/environment/qa puppet-0.25.4/ext/regexp_nodes/parameters/environment/qa --- puppet-0.25.1/ext/regexp_nodes/parameters/environment/qa 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/ext/regexp_nodes/parameters/environment/qa 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,3 @@ +^qa- +^qa2- +^qa3- diff -Nru puppet-0.25.1/ext/regexp_nodes/regexp_nodes.rb puppet-0.25.4/ext/regexp_nodes/regexp_nodes.rb --- puppet-0.25.1/ext/regexp_nodes/regexp_nodes.rb 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/ext/regexp_nodes/regexp_nodes.rb 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,215 @@ +#!/usr/bin/env ruby + +# = Synopsis +# This is an external node classifier script, after +# http://reductivelabs.com/trac/puppet/wiki/ExternalNodes +# +# = Usage +# regexp_nodes.rb +# +# = Description +# This classifier implements filesystem autoloading: It looks through classes +# and parameters subdirectories, looping through each file it finds there - the +# contents are a regexp-per-line which, if they match the hostname passed us as +# ARGV[0], will cause a class or parameter named the same thing as the file to +# be set. +# +# = Examples +# In the distribution there are two subdirectories test_classes/ and +# test_parameters, which are passed as parameters to MyExternalNode.new. +# test_classes/database will set the 'database' class for any hostnames +# matching %r{db\d{2}} (that is, 'db' followed by two digits) or with 'mysql' +# anywhere in the hostname. Similarly, hosts beginning with 'www' or 'web' +# or the hostname 'leterel' (my workstation) will be assigned the 'webserver' +# class. +# +# Under test_parameters/ there is one subdirectory 'environment' which +# sets the a parameter called 'environment' to the value 'prod' for production +# hosts (whose hostnames always end with three numbers for us), 'qa' for +# anything that starts with 'qa-' 'qa2-' or 'qa3-', and 'sandbox' for any +# development machines which are, naturally, named after Autechre songs. +# +# +# = Author +# Eric Sorenson + + +# we need yaml or there's not much point in going on +require 'yaml' + +# Sets are like arrays but automatically de-duplicate elements +require 'set' + +# set up some nice logging +require 'logger' +# XXX flip this for production vs local sandbox +# $LOG = Logger.new("/var/puppet/log/extnodes.log") +# $LOG.level = Logger::FATAL +$LOG = Logger.new($stderr) +$LOG.level = Logger::DEBUG + +# paths for files we use will be relative to this directory +# XXX flip this for production vs local sandbox +# WORKINGDIR = "/var/puppet/bin" +WORKINGDIR = Dir.pwd + +# This class holds all the methods for creating and accessing the properties +# of an external node. There are really only two public methods: initialize() +# and a special version of to_yaml() + +class ExternalNode + # Make these instance variables get/set-able with eponymous methods + attr_accessor :classes, :parameters, :hostname + + # initialize() takes three arguments: + # hostname:: usually passed in via ARGV[0] but it could be anything + # classdir:: directory under WORKINGDIR to look for files named after + # classes + # parameterdir:: directory under WORKINGDIR to look for directories to set + # parameters + def initialize(hostname, classdir = 'classes/', parameterdir = 'parameters/') + # instance variables that contain the lists of classes and parameters + @hostname + @classes = Set.new ["baseclass"] + @parameters = Hash.new("unknown") # sets a default value of "unknown" + + self.parse_argv(hostname) + self.match_classes(WORKINGDIR + "/" + classdir) + self.match_parameters(WORKINGDIR + "/" + parameterdir) + end + + # private method called by initialize() which sanity-checks our hostname. + # good candidate for overriding in a subclass if you need different checks + def parse_argv(hostname) + if hostname =~ /^([-\w]+?)\.([-\w\.]+)/ # non-greedy up to the first . is hostname + @hostname = $1 + elsif hostname =~ /^([-\w]+)$/ # sometimes puppet's @name is just a name + @hostname = hostname + else + $LOG.fatal("didn't receive parsable hostname, got: [#{hostname}]") + exit(1) + end + end + + # to_yaml massages a copy of the object and outputs clean yaml so we don't + # feed weird things back to puppet []< + def to_yaml + classes = self.classes.to_a + if self.parameters.empty? # otherwise to_yaml prints "parameters: {}" + parameters = nil + else + parameters = self.parameters + end + ({ 'classes' => classes, 'parameters' => parameters}).to_yaml + end + + # Private method that expects an absolute path to a file and a string to + # match - it returns true if the string was matched by any of the lines in + # the file + def matched_in_patternfile?(filepath, matchthis) + + patternlist = [] + + begin + open(filepath).each { |l| + pattern = %r{#{l.chomp!}} + patternlist << pattern + $LOG.debug("appending [#{pattern}] to patternlist for [#{filepath}]") + } + rescue Exception + $LOG.fatal("Problem reading #{filepath}: #{$!}") + exit(1) + end + + $LOG.debug("list of patterns for #{filepath}: #{patternlist}") + + if matchthis =~ Regexp.union(patternlist) + $LOG.debug("matched #{$~.to_s} in #{matchthis}, returning true") + return true + + else # hostname didn't match anything in patternlist + $LOG.debug("#{matchthis} unmatched, returning false") + return nil + end + + end # def + + # private method - takes a path to look for files, iterates through all + # readable, regular files it finds, and matches this instance's @hostname + # against each line; if any match, the class will be set for this node. + def match_classes(fullpath) + Dir.foreach(fullpath) do |patternfile| + filepath = "#{fullpath}/#{patternfile}" + next unless File.file?(filepath) and + File.readable?(filepath) + $LOG.debug("Attempting to match [#{@hostname}] in [#{filepath}]") + if matched_in_patternfile?(filepath,@hostname) + @classes << patternfile.to_s + $LOG.debug("Appended #{patternfile.to_s} to classes instance variable") + end # if + end # Dir.foreach + end # def + + # Parameters are handled slightly differently; we make another level of + # directories to get the parameter name, then use the names of the files + # contained in there for the values of those parameters. + # + # ex: cat /var/puppet/bin/parameters/environment/production + # ^prodweb + # would set parameters["environment"] = "production" for prodweb001 + def match_parameters(fullpath) + Dir.foreach(fullpath) do |parametername| + + filepath = "#{fullpath}/#{parametername}" + next if File.basename(filepath) =~ /^\./ # skip over dotfiles + + next unless File.directory?(filepath) and + File.readable?(filepath) # skip over non-directories + + $LOG.debug "Considering contents of #{filepath}" + + Dir.foreach("#{filepath}") do |patternfile| + secondlevel = "#{filepath}/#{patternfile}" + $LOG.debug "Found parameters patternfile at #{secondlevel}" + next unless File.file?(secondlevel) and + File.readable?(secondlevel) + $LOG.debug("Attempting to match [#{@hostname}] in [#{secondlevel}]") + if matched_in_patternfile?(secondlevel, @hostname) + @parameters[ parametername.to_s ] = patternfile.to_s + $LOG.debug("Set @parameters[#{parametername.to_s}] = #{patternfile.to_s}") + end # if + end # Dir.foreach #{filepath} + end # Dir.foreach #{fullpath} + end # def + +end # Class + +# Logic for local hacks that don't fit neatly into the autoloading model can +# happen as we initialize a subclass +class MyExternalNode < ExternalNode + + def initialize(hostname, classdir = 'classes/', parameterdir = 'parameters/') + + super + + # Set "hostclass" parameter based on hostname, + # stripped of leading environment prefix and numeric suffix + if @hostname =~ /^(\w*?)-?(\D+)(\d{2,3})$/ + match = Regexp.last_match + + hostclass = match[2] + $LOG.debug("matched hostclass #{hostclass}") + @parameters[ "hostclass" ] = hostclass + else + $LOG.debug("hostclass couldn't figure out class from #{@hostname}") + end # if + end # def + +end # Class + + +# Here we begin actual execution by calling methods defined above + +mynode = MyExternalNode.new(ARGV[0], classes = 'test_classes', parameters = 'test_parameters') + +puts mynode.to_yaml diff -Nru puppet-0.25.1/lib/puppet/agent.rb puppet-0.25.4/lib/puppet/agent.rb --- puppet-0.25.1/lib/puppet/agent.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/agent.rb 2010-01-29 21:32:27.000000000 +0000 @@ -51,7 +51,9 @@ with_client do |client| begin sync.synchronize { lock { client.run(*args) } } - rescue => detail + rescue SystemExit,NoMemoryError + raise + rescue Exception => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not run %s: %s" % [client_class, detail] end @@ -122,7 +124,9 @@ def with_client begin @client = client_class.new - rescue => detail + rescue SystemExit,NoMemoryError + raise + rescue Exception => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not create instance of %s: %s" % [client_class, detail] return diff -Nru puppet-0.25.1/lib/puppet/application/puppetdoc.rb puppet-0.25.4/lib/puppet/application/puppetdoc.rb --- puppet-0.25.1/lib/puppet/application/puppetdoc.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/application/puppetdoc.rb 2010-01-29 21:32:27.000000000 +0000 @@ -66,8 +66,9 @@ exit_code = 0 files = [] unless @manifest - files += Puppet[:modulepath].split(':').collect { |p| File.expand_path(p) } - files += Puppet[:manifestdir].split(':').collect { |p| File.expand_path(p) } + env = Puppet::Node::Environment.new + files += env.modulepath + files << File.dirname(env[:manifest]) end files += ARGV Puppet.info "scanning: %s" % files.inspect @@ -191,7 +192,7 @@ end end - def setup_rdoc + def setup_rdoc(dummy_argument=:work_arround_for_ruby_GC_bug) # consume the unknown options # and feed them as settings if @unknown_args.size > 0 diff -Nru puppet-0.25.1/lib/puppet/application/puppetd.rb puppet-0.25.4/lib/puppet/application/puppetd.rb --- puppet-0.25.1/lib/puppet/application/puppetd.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/application/puppetd.rb 2010-01-29 21:32:27.000000000 +0000 @@ -125,7 +125,7 @@ Puppet.settings.handlearg("--no-daemonize") options[:verbose] = true options[:onetime] = true - options[:waitforcert] = 0 + options[:waitforcert] = 0 unless @explicit_waitforcert end # Handle the logging settings. diff -Nru puppet-0.25.1/lib/puppet/application/puppet.rb puppet-0.25.4/lib/puppet/application/puppet.rb --- puppet-0.25.1/lib/puppet/application/puppet.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/application/puppet.rb 2010-01-29 21:32:27.000000000 +0000 @@ -1,5 +1,6 @@ require 'puppet' require 'puppet/application' +require 'puppet/configurer' require 'puppet/network/handler' require 'puppet/network/client' @@ -49,7 +50,7 @@ end begin - catalog = PSON.parse(text) + catalog = Puppet::Resource::Catalog.convert_from(Puppet::Resource::Catalog.default_format,text) unless catalog.is_a?(Puppet::Resource::Catalog) catalog = Puppet::Resource::Catalog.pson_create(catalog) end @@ -124,9 +125,14 @@ catalog.retrieval_duration = Time.now - starttime + configurer = Puppet::Configurer.new + configurer.execute_prerun_command + # And apply it transaction = catalog.apply + configurer.execute_postrun_command + status = 0 if not Puppet[:noop] and options[:detailed_exitcodes] then transaction.generate_report @@ -135,9 +141,7 @@ end exit(status) rescue => detail - if Puppet[:trace] - puts detail.backtrace - end + puts detail.backtrace if Puppet[:trace] if detail.is_a?(XMLRPC::FaultException) $stderr.puts detail.message else diff -Nru puppet-0.25.1/lib/puppet/application/puppetrun.rb puppet-0.25.4/lib/puppet/application/puppetrun.rb --- puppet-0.25.1/lib/puppet/application/puppetrun.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/application/puppetrun.rb 2010-01-29 21:32:27.000000000 +0000 @@ -1,18 +1,9 @@ -begin - require 'rubygems' -rescue LoadError - # Nothing; we were just doing this just in case -end - -begin - require 'ldap' -rescue LoadError - $stderr.puts "Failed to load ruby LDAP library. LDAP functionality will not be available" -end - require 'puppet' require 'puppet/application' +Puppet.warning "RubyGems not installed" unless Puppet.features.rubygems? +Puppet.warning "Failed to load ruby LDAP library. LDAP functionality will not be available" unless Puppet.features.ldap? + Puppet::Application.new(:puppetrun) do should_not_parse_config @@ -176,12 +167,12 @@ if Puppet[:node_terminus] == "ldap" and (options[:all] or @classes) if options[:all] - @hosts = Puppet::Node.search("whatever").collect { |node| node.name } + @hosts = Puppet::Node.search("whatever", :fqdn => options[:fqdn]).collect { |node| node.name } puts "all: %s" % @hosts.join(", ") else @hosts = [] @classes.each do |klass| - list = Puppet::Node.search("whatever", :class => klass).collect { |node| node.name } + list = Puppet::Node.search("whatever", :fqdn => options[:fqdn], :class => klass).collect { |node| node.name } puts "%s: %s" % [klass, list.join(", ")] @hosts += list diff -Nru puppet-0.25.1/lib/puppet/application/ralsh.rb puppet-0.25.4/lib/puppet/application/ralsh.rb --- puppet-0.25.1/lib/puppet/application/ralsh.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/application/ralsh.rb 2010-01-29 21:32:27.000000000 +0000 @@ -38,25 +38,15 @@ end command(:main) do - if ARGV.length > 0 - type = ARGV.shift - else - raise "You must specify the type to display" - end - - name = nil + type = ARGV.shift or raise "You must specify the type to display" + typeobj = Puppet::Type.type(type) or raise "Could not find type #{type}" + name = ARGV.shift params = {} - if ARGV.length > 0 - name = ARGV.shift - end - - if ARGV.length > 0 - ARGV.each do |setting| - if setting =~ /^(\w+)=(.+)$/ - params[$1] = $2 - else - raise "Invalid parameter setting %s" % setting - end + ARGV.each do |setting| + if setting =~ /^(\w+)=(.+)$/ + params[$1] = $2 + else + raise "Invalid parameter setting %s" % setting end end @@ -64,12 +54,6 @@ raise "You cannot edit a remote host" end - typeobj = nil - - unless typeobj = Puppet::Type.type(type) - raise "Could not find type %s" % type - end - properties = typeobj.properties.collect { |s| s.name } format = proc {|trans| @@ -106,7 +90,7 @@ transbucket.sort { |a,b| a.name <=> b.name }.collect(&format) else if name - obj = typeobj.new(:name => name, :check => properties) + obj = typeobj.instances.find { |o| o.name == name } || typeobj.new(:name => name, :check => properties) vals = obj.retrieve unless params.empty? diff -Nru puppet-0.25.1/lib/puppet/configurer/fact_handler.rb puppet-0.25.4/lib/puppet/configurer/fact_handler.rb --- puppet-0.25.1/lib/puppet/configurer/fact_handler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/configurer/fact_handler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -11,14 +11,15 @@ end def find_facts - reload_facter() - # This works because puppetd configures Facts to use 'facter' for # finding facts and the 'rest' terminus for caching them. Thus, we'll # compile them and then "cache" them on the server. begin + reload_facter() Puppet::Node::Facts.find(Puppet[:certname]) - rescue => detail + rescue SystemExit,NoMemoryError + raise + rescue Exception => detail puts detail.backtrace if Puppet[:trace] raise Puppet::Error, "Could not retrieve local facts: %s" % detail end @@ -28,12 +29,15 @@ facts = find_facts #format = facts.class.default_format - # Hard-code yaml, because I couldn't get marshal to work. - format = :b64_zlib_yaml + if facts.support_format?(:b64_zlib_yaml) + format = :b64_zlib_yaml + else + format = :yaml + end text = facts.render(format) - return {:facts_format => :b64_zlib_yaml, :facts => CGI.escape(text)} + return {:facts_format => format, :facts => CGI.escape(text)} end # Retrieve facts from the central server. diff -Nru puppet-0.25.1/lib/puppet/configurer/plugin_handler.rb puppet-0.25.4/lib/puppet/configurer/plugin_handler.rb --- puppet-0.25.1/lib/puppet/configurer/plugin_handler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/configurer/plugin_handler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -19,6 +19,8 @@ begin Puppet.info "Loading downloaded plugin %s" % file load file + rescue SystemExit,NoMemoryError + raise rescue Exception => detail Puppet.err "Could not load downloaded file %s: %s" % [file, detail] end diff -Nru puppet-0.25.1/lib/puppet/configurer.rb puppet-0.25.4/lib/puppet/configurer.rb --- puppet-0.25.1/lib/puppet/configurer.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/configurer.rb 2010-01-29 21:32:27.000000000 +0000 @@ -5,6 +5,8 @@ require 'puppet/util' class Puppet::Configurer + class CommandHookError < RuntimeError; end + require 'puppet/configurer/fact_handler' require 'puppet/configurer/plugin_handler' @@ -39,6 +41,14 @@ @catalog = nil end + def execute_postrun_command + execute_from_setting(:postrun_command) + end + + def execute_prerun_command + execute_from_setting(:prerun_command) + end + # Initialize and load storage def dostorage begin @@ -75,6 +85,8 @@ download_plugins() download_fact_plugins() + + execute_prerun_command end # Get the remote catalog, yo. Returns nil if no catalog can be found. @@ -93,7 +105,9 @@ duration = thinmark do result = catalog_class.find(name, fact_options.merge(:ignore_cache => true)) end - rescue => detail + rescue SystemExit,NoMemoryError + raise + rescue Exception => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Could not retrieve catalog from remote server: %s" % detail end @@ -123,6 +137,7 @@ # Convert a plain resource catalog into our full host catalog. def convert_catalog(result, duration) catalog = result.to_ral + catalog.finalize catalog.retrieval_duration = duration catalog.host_config = true catalog.write_class_file @@ -135,6 +150,8 @@ def run(options = {}) begin prepare() + rescue SystemExit,NoMemoryError + raise rescue Exception => detail puts detail.backtrace if Puppet[:trace] Puppet.err "Failed to prepare catalog: %s" % detail @@ -159,6 +176,8 @@ # Now close all of our existing http connections, since there's no # reason to leave them lying open. Puppet::Network::HttpPool.clear_http_instances + ensure + execute_postrun_command end private @@ -179,4 +198,14 @@ return timeout end + + def execute_from_setting(setting) + return if (command = Puppet[setting]) == "" + + begin + Puppet::Util.execute([command]) + rescue => detail + raise CommandHookError, "Could not run command from #{setting}: #{detail}" + end + end end diff -Nru puppet-0.25.1/lib/puppet/daemon.rb puppet-0.25.4/lib/puppet/daemon.rb --- puppet-0.25.1/lib/puppet/daemon.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/daemon.rb 2010-01-29 21:32:27.000000000 +0000 @@ -31,10 +31,10 @@ $stderr.reopen $stdout Puppet::Util::Log.reopen rescue => detail - File.open("/tmp/daemonout", "w") { |f| + Puppet.err "Could not start %s: %s" % [Puppet[:name], detail] + Puppet::Util::secure_open("/tmp/daemonout", "w") { |f| f.puts "Could not start %s: %s" % [Puppet[:name], detail] } - Puppet.err "Could not start %s: %s" % [Puppet[:name], detail] exit(12) end end diff -Nru puppet-0.25.1/lib/puppet/defaults.rb puppet-0.25.4/lib/puppet/defaults.rb --- puppet-0.25.1/lib/puppet/defaults.rb 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/lib/puppet/defaults.rb 2010-02-12 16:48:13.000000000 +0000 @@ -56,8 +56,8 @@ choose one of those; you cannot just make one up."], :statedir => { :default => "$vardir/state", :mode => 01755, - :owner => "service", - :group => "service", + :owner => "service", + :group => "service", :desc => "The directory where Puppet state is stored. Generally, this directory can be removed without causing harm (although it might result in spurious service restarts)." @@ -88,6 +88,10 @@ :mkusers => [false, "Whether to create the necessary user and group that puppetd will run as."], + :manage_internal_file_permissions => [true, + "Whether Puppet should manage the owner, group, and mode of files + it uses internally" + ], :path => {:default => "none", :desc => "The shell search path. Defaults to whatever is inherited from the parent process.", @@ -158,7 +162,7 @@ :http_proxy_port => [3128, "The HTTP proxy port to use for outgoing connections"], :http_enable_post_connection_check => [true, - "Boolean; wheter or not puppetd should validate the server + "Boolean; whether or not puppetd should validate the server SSL certificate against the request hostname."], :filetimeout => [ 15, "The minimum time to wait (in seconds) between checking for updates in @@ -194,7 +198,15 @@ :config_version => ["", "How to determine the configuration version. By default, it will be the time that the configuration is parsed, but you can provide a shell script to override how the version is determined. The output of this script will be added to every log message in the - reports, allowing you to correlate changes on your hosts to the source version on the server."] + reports, allowing you to correlate changes on your hosts to the source version on the server."], + :zlib => [true, + "Boolean; whether to use the zlib library", + ], + :prerun_command => ["", "A command to run before every agent run. If this command returns a non-zero + return code, the entire Puppet run will fail."], + :postrun_command => ["", "A command to run after every agent run. If this command returns a non-zero + return code, the entire Puppet run will be considered to have failed, even though it might have + performed work during the normal run."] ) hostname = Facter["hostname"].value @@ -524,6 +536,18 @@ authority requests. It's a separate server because it cannot and does not need to horizontally scale."], :ca_port => ["$masterport", "The port to use for the certificate authority."], + :catalog_format => { + :default => "", + :desc => "(Deprecated for 'preferred_serialization_format') What format to + use to dump the catalog. Only supports 'marshal' and 'yaml'. Only + matters on the client, since it asks the server for a specific format.", + :hook => proc { |value| + if value + Puppet.warning "Setting 'catalog_format' is deprecated; use 'preferred_serialization_format' instead." + Puppet.settings[:preferred_serialization_format] = value + end + } + }, :preferred_serialization_format => ["pson", "The preferred means of serializing ruby instances for passing over the wire. This won't guarantee that all instances will be serialized using this method, since not all classes diff -Nru puppet-0.25.1/lib/puppet/external/pson/common.rb puppet-0.25.4/lib/puppet/external/pson/common.rb --- puppet-0.25.1/lib/puppet/external/pson/common.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/external/pson/common.rb 2010-01-29 21:32:27.000000000 +0000 @@ -48,7 +48,7 @@ case when c.empty? then p when p.const_defined?(c) then p.const_get(c) - else raise ArgumentError, "can't find const #{path}" + else raise ArgumentError, "can't find const for unregistered document type #{path}" end end end diff -Nru puppet-0.25.1/lib/puppet/external/pson/pure.rb puppet-0.25.4/lib/puppet/external/pson/pure.rb --- puppet-0.25.1/lib/puppet/external/pson/pure.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/external/pson/pure.rb 2010-01-29 21:32:27.000000000 +0000 @@ -11,8 +11,8 @@ UTF8toUTF16 = Iconv.new('utf-16be', 'utf-8') # :nodoc: UTF8toUTF16.iconv('no bom') rescue LoadError - raise MissingUnicodeSupport, - "iconv couldn't be loaded, which is required for UTF-8/UTF-16 conversions" + # We actually don't care + Puppet.warning "iconv couldn't be loaded, which is required for UTF-8/UTF-16 conversions" rescue Errno::EINVAL, Iconv::InvalidEncoding # Iconv doesn't support big endian utf-16. Let's try to hack this manually # into the converters. @@ -50,7 +50,7 @@ UTF16toUTF8 = swapper.new(UTF16toUTF8) # :nodoc: end rescue Errno::EINVAL, Iconv::InvalidEncoding - raise MissingUnicodeSupport, "iconv doesn't seem to support UTF-8/UTF-16 conversions" + Puppet.warning "iconv doesn't seem to support UTF-8/UTF-16 conversions" ensure $VERBOSE = old_verbose end diff -Nru puppet-0.25.1/lib/puppet/feature/base.rb puppet-0.25.4/lib/puppet/feature/base.rb --- puppet-0.25.1/lib/puppet/feature/base.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/feature/base.rb 2010-01-29 21:32:27.000000000 +0000 @@ -28,3 +28,6 @@ # We have RRD available Puppet.features.add(:rrd, :libs => ["RRDtool"]) + +# We have OpenSSL +Puppet.features.add(:openssl, :libs => ["openssl"]) diff -Nru puppet-0.25.1/lib/puppet/feature/selinux.rb puppet-0.25.4/lib/puppet/feature/selinux.rb --- puppet-0.25.1/lib/puppet/feature/selinux.rb 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/lib/puppet/feature/selinux.rb 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,3 @@ +require 'puppet/util/feature' + +Puppet.features.add(:selinux, :libs => ["selinux"]) diff -Nru puppet-0.25.1/lib/puppet/feature/zlib.rb puppet-0.25.4/lib/puppet/feature/zlib.rb --- puppet-0.25.1/lib/puppet/feature/zlib.rb 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/lib/puppet/feature/zlib.rb 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,6 @@ +require 'puppet/util/feature' + +# We want this to load if possible, but it's not automatically +# required. +Puppet.features.rubygems? +Puppet.features.add(:zlib, :libs => %{zlib}) diff -Nru puppet-0.25.1/lib/puppet/file_serving/base.rb puppet-0.25.4/lib/puppet/file_serving/base.rb --- puppet-0.25.1/lib/puppet/file_serving/base.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/file_serving/base.rb 2010-01-29 21:32:27.000000000 +0000 @@ -22,7 +22,7 @@ end # Return the full path to our file. Fails if there's no path set. - def full_path + def full_path(dummy_argument=:work_arround_for_ruby_GC_bug) (if relative_path.nil? or relative_path == "" or relative_path == "." path else @@ -74,4 +74,19 @@ end File.send(@stat_method, full_path()) end + + def to_pson_data_hash + { + # No 'document_type' since we don't send these bare + 'data' => { + 'path' => @path, + 'relative_path' => @relative_path, + 'links' => @links + }, + 'metadata' => { + 'api_version' => 1 + } + } + end + end diff -Nru puppet-0.25.1/lib/puppet/file_serving/metadata.rb puppet-0.25.4/lib/puppet/file_serving/metadata.rb --- puppet-0.25.1/lib/puppet/file_serving/metadata.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/file_serving/metadata.rb 2010-01-29 21:32:27.000000000 +0000 @@ -22,18 +22,15 @@ PARAM_ORDER = [:mode, :ftype, :owner, :group] def attributes_with_tabs + raise(ArgumentError, "Cannot manage files of type #{ftype}") unless ['file','directory','link'].include? ftype desc = [] PARAM_ORDER.each { |check| check = :ftype if check == :type desc << send(check) } - case ftype - when "file", "directory"; desc << checksum - when "link"; desc << @destination - else - raise ArgumentError, "Cannot manage files of type %s" % ftype - end + desc << checksum + desc << @destination rescue nil if ftype == 'link' return desc.join("\t") end @@ -66,13 +63,53 @@ @checksum = ("{%s}" % @checksum_type) + send("%s_file" % @checksum_type, path).to_s when "link" @destination = File.readlink(real_path) + @checksum = ("{%s}" % @checksum_type) + send("%s_file" % @checksum_type, real_path).to_s rescue nil else raise ArgumentError, "Cannot manage files of type %s" % stat.ftype end end - def initialize(*args) - @checksum_type = "md5" - super + def initialize(path,data={}) + @owner = data.delete('owner') + @group = data.delete('group') + @mode = data.delete('mode') + if checksum = data.delete('checksum') + @checksum_type = checksum['type'] + @checksum = checksum['value'] + end + @checksum_type ||= "md5" + @ftype = data.delete('type') + @destination = data.delete('destination') + super(path,data) + end + + PSON.register_document_type('FileMetadata',self) + def to_pson_data_hash + { + 'document_type' => 'FileMetadata', + 'data' => super['data'].update({ + 'owner' => owner, + 'group' => group, + 'mode' => mode, + 'checksum' => { + 'type' => checksum_type, + 'value' => checksum + }, + 'type' => ftype, + 'destination' => destination, + }), + 'metadata' => { + 'api_version' => 1 + } + } end + + def to_pson(*args) + to_pson_data_hash.to_pson(*args) + end + + def self.from_pson(data) + new(data.delete('path'), data) + end + end diff -Nru puppet-0.25.1/lib/puppet/file_serving/mount/file.rb puppet-0.25.4/lib/puppet/file_serving/mount/file.rb --- puppet-0.25.1/lib/puppet/file_serving/mount/file.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/file_serving/mount/file.rb 2010-01-29 21:32:27.000000000 +0000 @@ -25,7 +25,10 @@ file = ::File.join(full_path, relative_path) - return nil unless FileTest.exist?(file) + if !(FileTest.exist?(file) or FileTest.symlink?(file)) + Puppet.info("File does not exist or is not accessible: #{file}") + return nil + end return file end diff -Nru puppet-0.25.1/lib/puppet/indirector/catalog/active_record.rb puppet-0.25.4/lib/puppet/indirector/catalog/active_record.rb --- puppet-0.25.1/lib/puppet/indirector/catalog/active_record.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/indirector/catalog/active_record.rb 2010-01-29 21:32:27.000000000 +0000 @@ -30,6 +30,11 @@ host.merge_resources(catalog.vertices) host.last_compile = Time.now + if node = Puppet::Node.find(catalog.name) + host.ip = node.parameters["ipaddress"] + host.environment = node.environment + end + host.save end end diff -Nru puppet-0.25.1/lib/puppet/indirector/envelope.rb puppet-0.25.4/lib/puppet/indirector/envelope.rb --- puppet-0.25.1/lib/puppet/indirector/envelope.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/indirector/envelope.rb 2010-01-29 21:32:27.000000000 +0000 @@ -6,8 +6,6 @@ attr_accessor :expiration def expired? - return false unless expiration - return false if expiration >= Time.now - return true + expiration and expiration < Time.now end end diff -Nru puppet-0.25.1/lib/puppet/indirector/facts/facter.rb puppet-0.25.4/lib/puppet/indirector/facts/facter.rb --- puppet-0.25.1/lib/puppet/indirector/facts/facter.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/indirector/facts/facter.rb 2010-01-29 21:32:27.000000000 +0000 @@ -29,6 +29,8 @@ Timeout::timeout(self.timeout) do load file end + rescue SystemExit,NoMemoryError + raise rescue Exception => detail Puppet.warning "Could not load fact file %s: %s" % [fqfile, detail] end diff -Nru puppet-0.25.1/lib/puppet/indirector/indirection.rb puppet-0.25.4/lib/puppet/indirector/indirection.rb --- puppet-0.25.1/lib/puppet/indirector/indirection.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/indirector/indirection.rb 2010-01-29 21:32:27.000000000 +0000 @@ -161,22 +161,19 @@ end end - # Expire a cached object, if one is cached. Note that we don't actually - # remove it, we expire it and write it back out to disk. This way people - # can still use the expired object if they want. + # Expire a cached object, if one is cached. Note that we now actually + # remove it if possible, and only mark it as expired if destroy isn't + # supported. def expire(key, *args) - request = request(:expire, key, *args) - - return nil unless cache? - - return nil unless instance = cache.find(request(:find, key, *args)) - - Puppet.info "Expiring the %s cache of %s" % [self.name, instance.name] - - # Set an expiration date in the past - instance.expiration = Time.now - 60 - - cache.save(request(:save, instance, *args)) + if cache? and instance = cache.find(request(:find, key, *args)) + Puppet.info "Expiring the #{name} cache of #{instance.name}" + if cache.respond_to? :destroy + cache.destroy(request(:destroy, instance, *args)) + else + instance.expiration = Time.now - 1 + cache.save(request(:save,instance,*args)) + end + end end # Search for an instance in the appropriate terminus, caching the @@ -216,7 +213,7 @@ return nil end - Puppet.debug "Using cached %s for %s" % [self.name, request.key] + Puppet.debug "Using cached #{name} for #{request.key}, good until #{cached.expiration}" return cached end diff -Nru puppet-0.25.1/lib/puppet/indirector/ldap.rb puppet-0.25.4/lib/puppet/indirector/ldap.rb --- puppet-0.25.1/lib/puppet/indirector/ldap.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/indirector/ldap.rb 2010-01-29 21:32:27.000000000 +0000 @@ -40,6 +40,8 @@ found = true yield entry end + rescue SystemExit,NoMemoryError + raise rescue Exception => detail if count == 0 # Try reconnecting to ldap if we get an exception and we haven't yet retried. diff -Nru puppet-0.25.1/lib/puppet/indirector/node/ldap.rb puppet-0.25.4/lib/puppet/indirector/node/ldap.rb --- puppet-0.25.1/lib/puppet/indirector/node/ldap.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/indirector/node/ldap.rb 2010-01-29 21:32:27.000000000 +0000 @@ -55,7 +55,7 @@ end infos = [] - ldapsearch(filter) { |entry| infos << entry2hash(entry) } + ldapsearch(filter) { |entry| infos << entry2hash(entry, request.options[:fqdn]) } return infos.collect do |info| info2node(info[:name], info) @@ -73,14 +73,17 @@ # The attributes that Puppet will stack as array over the full # hierarchy. - def stacked_attributes + def stacked_attributes(dummy_argument=:work_arround_for_ruby_GC_bug) Puppet[:ldapstackedattrs].split(/\s*,\s*/) end # Convert the found entry into a simple hash. - def entry2hash(entry) + def entry2hash(entry, fqdn = false) result = {} - result[:name] = entry.dn.split(',')[0].split("=")[1] + + cn = entry.dn[ /cn\s*=\s*([^,\s]+)/i,1] + dcs = entry.dn.scan(/dc\s*=\s*([^,\s]+)/i) + result[:name] = fqdn ? ([cn]+dcs).join('.') : cn result[:parent] = get_parent_from_entry(entry) if parent_attribute result[:classes] = get_classes_from_entry(entry) result[:stacked] = get_stacked_values_from_entry(entry) diff -Nru puppet-0.25.1/lib/puppet/indirector/ssl_file.rb puppet-0.25.4/lib/puppet/indirector/ssl_file.rb --- puppet-0.25.1/lib/puppet/indirector/ssl_file.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/indirector/ssl_file.rb 2010-01-29 21:32:27.000000000 +0000 @@ -91,7 +91,7 @@ def save(request) path = path(request.key) dir = File.dirname(path) - + raise Puppet::Error.new("Cannot save %s; parent directory %s does not exist" % [request.key, dir]) unless FileTest.directory?(dir) raise Puppet::Error.new("Cannot save %s; parent directory %s is not writable" % [request.key, dir]) unless FileTest.writable?(dir) diff -Nru puppet-0.25.1/lib/puppet/network/authstore.rb puppet-0.25.4/lib/puppet/network/authstore.rb --- puppet-0.25.1/lib/puppet/network/authstore.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/authstore.rb 2010-01-29 21:32:27.000000000 +0000 @@ -49,7 +49,7 @@ return decl.result end - self.info "defaulting to no access for %s" % name + info "defaulting to no access for %s" % name return false end @@ -78,11 +78,7 @@ end def interpolate(match) - declarations = @declarations.collect do |ace| - ace.interpolate(match) - end - declarations.sort! - Thread.current[:declarations] = declarations + Thread.current[:declarations] = @declarations.collect { |ace| ace.interpolate(match) }.sort end def reset_interpolation @@ -96,8 +92,7 @@ # this is used if we want to override the this purely immutable list # by a modified version in a multithread safe way. def declarations - return Thread.current[:declarations] if Thread.current[:declarations] - @declarations + Thread.current[:declarations] || @declarations end # Store the results of a pattern into our hash. Basically just @@ -130,46 +125,21 @@ # The length. Only used for iprange and domain. attr_accessor :length - # Sort the declarations specially. + # Sort the declarations most specific first. def <=>(other) - # Sort first based on whether the matches are exact. - if r = compare(exact?, other.exact?) - return r - end - - # Then by type - if r = compare(self.ip?, other.ip?) - return r - end - - # Next sort based on length - unless self.length == other.length - # Longer names/ips should go first, because they're more - # specific. - return other.length <=> self.length - end - - # Then sort deny before allow - if r = compare(self.deny?, other.deny?) - return r - end - - # We've already sorted by name and length, so all that's left - # is the pattern - if ip? - return self.pattern.to_s <=> other.pattern.to_s - else - return self.pattern <=> other.pattern - end + compare(exact?, other.exact?) || + compare(ip?, other.ip?) || + ((length != other.length) && (other.length <=> length)) || + compare(deny?, other.deny?) || + ( ip? ? pattern.to_s <=> other.pattern.to_s : pattern <=> other.pattern) end def deny? - self.type == :deny + type == :deny end - # Are we an exact match? def exact? - self.length.nil? + @exact == :exact end def initialize(type, pattern) @@ -179,16 +149,12 @@ # Are we an IP type? def ip? - self.name == :ip + name == :ip end # Does this declaration match the name/ip combo? def match?(name, ip) - if self.ip? - return pattern.include?(IPAddr.new(ip)) - else - return matchname?(name) - end + ip? ? pattern.include?(IPAddr.new(ip)) : matchname?(name) end # Set the pattern appropriately. Also sets the name and length. @@ -199,15 +165,11 @@ # Mapping a type of statement into a return value. def result - case @type - when :allow; true - else - false - end + type == :allow end def to_s - "%s: %s" % [self.type, self.pattern] + "#{type}: #{pattern}" end # Set the declaration type. Either :allow or :deny. @@ -238,86 +200,54 @@ # -1 if the first is true, and 1 if the second is true. Used # in the <=> operator. def compare(me, them) - unless me and them - if me - return -1 - elsif them - return 1 - else - return false - end - end - return nil + (me and them) ? nil : me ? -1 : them ? 1 : nil end # Does the name match our pattern? def matchname?(name) name = munge_name(name) - return true if self.pattern == name - - # If it's an exact match, then just return false, since the - # exact didn't match. - if exact? - return false - end - - # If every field in the pattern matches, then we consider it - # a match. - pattern.zip(name) do |p,n| - unless p == n - return false - end - end - - return true + (pattern == name) or (not exact? and pattern.zip(name).all? { |p,n| p == n }) end # Convert the name to a common pattern. def munge_name(name) # LAK:NOTE http://snurl.com/21zf8 [groups_google_com] - # Change to x = name.downcase.split(".",-1).reverse for FQDN support - x = name.downcase.split(".").reverse + # Change to name.downcase.split(".",-1).reverse for FQDN support + name.downcase.split(".").reverse end # Parse our input pattern and figure out what kind of allowal # statement it is. The output of this is used for later matching. + Octet = '(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])' + IPv4 = "#{Octet}\.#{Octet}\.#{Octet}\.#{Octet}" + IPv6_full = "_:_:_:_:_:_:_:_|_:_:_:_:_:_::_?|_:_:_:_:_::((_:)?_)?|_:_:_:_::((_:){0,2}_)?|_:_:_::((_:){0,3}_)?|_:_::((_:){0,4}_)?|_::((_:){0,5}_)?|::((_:){0,6}_)?" + IPv6_partial = "_:_:_:_:_:_:|_:_:_:_::(_:)?|_:_::(_:){0,2}|_::(_:){0,3}" + # It should be: + # IP = "#{IPv4}|#{IPv6_full}|(#{IPv6_partial}#{IPv4})".gsub(/_/,'([0-9a-fA-F]{1,4})').gsub(/\(/,'(?:') + # but ruby's ipaddr lib doesn't support the hybrid format + IP = "#{IPv4}|#{IPv6_full}".gsub(/_/,'([0-9a-fA-F]{1,4})').gsub(/\(/,'(?:') def parse(value) - # Use the IPAddr class to determine if we've got a - # valid IP address. - @length = Integer($1) if value =~ /\/(\d+)$/ - begin - @pattern = IPAddr.new(value) - @name = :ip - rescue ArgumentError => detail - case value - when /^(\d+\.){1,3}\*$/ # an ip address with a '*' at the end - @name = :ip - segments = value.split(".")[0..-2] - @length = 8*segments.length - begin - @pattern = IPAddr.new((segments+[0,0,0])[0,4].join(".") + "/" + @length.to_s) - rescue ArgumentError => detail - raise AuthStoreError, "Invalid IP address pattern %s" % value - end - when /^([a-zA-Z0-9][-\w]*\.)+[-\w]+$/ # a full hostname - # Change to /^([a-zA-Z][-\w]*\.)+[-\w]+\.?$/ for FQDN support - @name = :domain - @pattern = munge_name(value) - when /^\*(\.([a-zA-Z][-\w]*)){1,}$/ # *.domain.com - @name = :domain - @pattern = munge_name(value) - @pattern.pop # take off the '*' - @length = @pattern.length - when /\$\d+/ # a backreference pattern ala $1.reductivelabs.com or 192.168.0.$1 or $1.$2 - @name = :dynamic - @pattern = munge_name(value) - when /^[a-zA-Z0-9][-a-zA-Z0-9_.@]*$/ - @pattern = [value] - @length = nil # force an exact match - @name = :opaque - else - raise AuthStoreError, "Invalid pattern %s" % value - end + @name,@exact,@length,@pattern = *case value + when /^(?:#{IP})\/(\d+)$/ # 12.34.56.78/24, a001:b002::efff/120, c444:1000:2000::9:192.168.0.1/112 + [:ip,:inexact,$1.to_i,IPAddr.new(value)] + when /^(#{IP})$/ # 10.20.30.40, + [:ip,:exact,nil,IPAddr.new(value)] + when /^(#{Octet}\.){1,3}\*$/ # an ip address with a '*' at the end + segments = value.split(".")[0..-2] + bits = 8*segments.length + [:ip,:inexact,bits,IPAddr.new((segments+[0,0,0])[0,4].join(".") + "/#{bits}")] + when /^(\w[-\w]*\.)+[-\w]+$/ # a full hostname + # Change to /^(\w[-\w]*\.)+[-\w]+\.?$/ for FQDN support + [:domain,:exact,nil,munge_name(value)] + when /^\*(\.(\w[-\w]*)){1,}$/ # *.domain.com + host_sans_star = munge_name(value)[0..-2] + [:domain,:inexact,host_sans_star.length,host_sans_star] + when /\$\d+/ # a backreference pattern ala $1.reductivelabs.com or 192.168.0.$1 or $1.$2 + [:dynamic,:exact,nil,munge_name(value)] + when /^\w[-.@\w]*$/ # ? Just like a host name but allow '@'s and ending '.'s + [:opaque,:exact,nil,[value]] + else + raise AuthStoreError, "Invalid pattern %s" % value end end end diff -Nru puppet-0.25.1/lib/puppet/network/client/resource.rb puppet-0.25.4/lib/puppet/network/client/resource.rb --- puppet-0.25.1/lib/puppet/network/client/resource.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/client/resource.rb 2010-01-29 21:32:27.000000000 +0000 @@ -27,25 +27,12 @@ def describe(type, name, retrieve = false, ignore = false) Puppet.info "Describing %s[%s]" % [type.to_s.capitalize, name] text = @driver.describe(type, name, retrieve, ignore, "yaml") - - object = nil - if @local - object = text - else - object = YAML::load(Base64.decode64(text)) - end - - return object + @local ? text : YAML::load(Base64.decode64(text)) end def list(type, ignore = false, base = false) bucket = @driver.list(type, ignore, base, "yaml") - - unless @local - bucket = YAML::load(Base64.decode64(bucket)) - end - - return bucket + @local ? bucket : YAML::load(Base64.decode64(bucket)) end end diff -Nru puppet-0.25.1/lib/puppet/network/format_handler.rb puppet-0.25.4/lib/puppet/network/format_handler.rb --- puppet-0.25.1/lib/puppet/network/format_handler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/format_handler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -119,16 +119,30 @@ format_handler.format(b).weight <=> format_handler.format(a).weight end - put_preferred_format_first(result) + result = put_preferred_format_first(result) + + Puppet.debug "#{friendly_name} supports formats: #{result.map{ |f| f.to_s }.sort.join(' ')}; using #{result.first}" + + result end private + def friendly_name + if self.respond_to? :indirection + indirection.name + else + self + end + end + def put_preferred_format_first(list) preferred_format = Puppet.settings[:preferred_serialization_format].to_sym if list.include?(preferred_format) list.delete(preferred_format) list.unshift(preferred_format) + else + Puppet.warning "Value of 'preferred_serialization_format' (#{preferred_format}) is invalid for #{friendly_name}, using default (#{list.first})" end list end diff -Nru puppet-0.25.1/lib/puppet/network/format.rb puppet-0.25.4/lib/puppet/network/format.rb --- puppet-0.25.1/lib/puppet/network/format.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/format.rb 2010-01-29 21:32:27.000000000 +0000 @@ -107,17 +107,7 @@ method = send(name) - if type == :class - has_method = klass.respond_to?(method) - message = "has not implemented method '%s'" % method - else - has_method = klass.instance_methods.include?(method) - message = "has not implemented instance method '%s'" % method - end - - return true if has_method - - Puppet.debug "Format %s not supported for %s; %s" % [self.name, klass, message] - return false + return klass.respond_to?(method) if type == :class + return klass.instance_methods.include?(method) end end diff -Nru puppet-0.25.1/lib/puppet/network/formats.rb puppet-0.25.4/lib/puppet/network/formats.rb --- puppet-0.25.1/lib/puppet/network/formats.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/formats.rb 2010-01-29 21:32:27.000000000 +0000 @@ -44,7 +44,18 @@ # This format combines a yaml serialization, then zlib compression and base64 encoding. Puppet::Network::FormatHandler.create(:b64_zlib_yaml, :mime => "text/b64_zlib_yaml") do require 'base64' - require 'zlib' + + def use_zlib? + Puppet.features.zlib? && Puppet[:zlib] + end + + def requiring_zlib + if use_zlib? + yield + else + raise Puppet::Error, "the zlib library is not installed or is disabled." + end + end def intern(klass, text) decode(text) @@ -70,7 +81,7 @@ # Because of yaml issue in ruby 1.8.1... def supported?(klass) - RUBY_VERSION != '1.8.1' + RUBY_VERSION != '1.8.1' and use_zlib? end # fixup invalid yaml as per: @@ -81,11 +92,15 @@ end def encode(text) - Base64.encode64(Zlib::Deflate.deflate(text, Zlib::BEST_COMPRESSION)) + requiring_zlib do + Base64.encode64(Zlib::Deflate.deflate(text, Zlib::BEST_COMPRESSION)) + end end def decode(yaml) - YAML.load(Zlib::Inflate.inflate(Base64.decode64(yaml))) + requiring_zlib do + YAML.load(Zlib::Inflate.inflate(Base64.decode64(yaml))) + end end end diff -Nru puppet-0.25.1/lib/puppet/network/handler/fileserver.rb puppet-0.25.4/lib/puppet/network/handler/fileserver.rb --- puppet-0.25.1/lib/puppet/network/handler/fileserver.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/handler/fileserver.rb 2010-01-29 21:32:27.000000000 +0000 @@ -310,6 +310,7 @@ mount.info "allowing %s access" % val mount.allow(val) rescue AuthStoreError => detail + puts detail.backtrace if Puppet[:trace] raise FileServerError.new(detail.to_s, count, @configuration.file) end diff -Nru puppet-0.25.1/lib/puppet/network/http/handler.rb puppet-0.25.4/lib/puppet/network/http/handler.rb --- puppet-0.25.1/lib/puppet/network/http/handler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/http/handler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -66,6 +66,8 @@ check_authorization(indirection_request) send("do_%s" % indirection_request.method, indirection_request, request, response) + rescue SystemExit,NoMemoryError + raise rescue Exception => e return do_exception(response, e) end @@ -97,6 +99,7 @@ # Execute our find. def do_find(indirection_request, request, response) unless result = indirection_request.model.find(indirection_request.key, indirection_request.to_hash) + Puppet.info("Could not find %s for '%s'" % [indirection_request.indirection_name, indirection_request.key]) return do_exception(response, "Could not find %s %s" % [indirection_request.indirection_name, indirection_request.key], 404) end diff -Nru puppet-0.25.1/lib/puppet/network/http/rack/httphandler.rb puppet-0.25.4/lib/puppet/network/http/rack/httphandler.rb --- puppet-0.25.1/lib/puppet/network/http/rack/httphandler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/http/rack/httphandler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -12,23 +12,5 @@ raise NotImplementedError, "Your RackHttpHandler subclass is supposed to override service(request)" end - def ssl_client_header(request) - env_or_request_env(Puppet[:ssl_client_header], request) - end - - def ssl_client_verify_header(request) - env_or_request_env(Puppet[:ssl_client_verify_header], request) - end - - # Older Passenger versions passed all Environment vars in app(env), - # but since 2.2.3 they (some?) are really in ENV. - # Mongrel, etc. may also still use request.env. - def env_or_request_env(var, request) - if ENV.include?(var) - ENV[var] - else - request.env[var] - end - end end diff -Nru puppet-0.25.1/lib/puppet/network/http/rack/rest.rb puppet-0.25.4/lib/puppet/network/http/rack/rest.rb --- puppet-0.25.1/lib/puppet/network/http/rack/rest.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/http/rack/rest.rb 2010-01-29 21:32:27.000000000 +0000 @@ -63,11 +63,11 @@ result[:ip] = request.ip # if we find SSL info in the headers, use them to get a hostname. - # try this with :ssl_client_header. - # For Apache you need special configuration, see ext/rack/README. - if dn = ssl_client_header(request) and dn_matchdata = dn.match(/^.*?CN\s*=\s*(.*)/) + # try this with :ssl_client_header, which defaults should work for + # Apache with StdEnvVars. + if dn = request.env[Puppet[:ssl_client_header]] and dn_matchdata = dn.match(/^.*?CN\s*=\s*(.*)/) result[:node] = dn_matchdata[1].to_str - result[:authenticated] = (ssl_client_verify_header(request) == 'SUCCESS') + result[:authenticated] = (request.env[Puppet[:ssl_client_verify_header]] == 'SUCCESS') else result[:node] = resolve_node(result) result[:authenticated] = false diff -Nru puppet-0.25.1/lib/puppet/network/http/rack/xmlrpc.rb puppet-0.25.4/lib/puppet/network/http/rack/xmlrpc.rb --- puppet-0.25.1/lib/puppet/network/http/rack/xmlrpc.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/http/rack/xmlrpc.rb 2010-01-29 21:32:27.000000000 +0000 @@ -43,11 +43,11 @@ ip = request.ip # if we find SSL info in the headers, use them to get a hostname. - # try this with :ssl_client_header. - # For Apache you need special configuration, see ext/rack/README. - if dn = ssl_client_header(request) and dn_matchdata = dn.match(/^.*?CN\s*=\s*(.*)/) + # try this with :ssl_client_header, which defaults should work for + # Apache with StdEnvVars. + if dn = request.env[Puppet[:ssl_client_header]] and dn_matchdata = dn.match(/^.*?CN\s*=\s*(.*)/) node = dn_matchdata[1].to_str - authenticated = (ssl_client_verify_header(request) == 'SUCCESS') + authenticated = (request.env[Puppet[:ssl_client_verify_header]] == 'SUCCESS') else begin node = Resolv.getname(ip) diff -Nru puppet-0.25.1/lib/puppet/network/http/webrick.rb puppet-0.25.4/lib/puppet/network/http/webrick.rb --- puppet-0.25.1/lib/puppet/network/http/webrick.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/http/webrick.rb 2010-01-29 21:32:27.000000000 +0000 @@ -44,7 +44,8 @@ sock.accept @server.run(sock) } - } + } + sleep 0.1 until @server.status == :Running end end diff -Nru puppet-0.25.1/lib/puppet/network/server.rb puppet-0.25.4/lib/puppet/network/server.rb --- puppet-0.25.1/lib/puppet/network/server.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/server.rb 2010-01-29 21:32:27.000000000 +0000 @@ -22,7 +22,7 @@ $stderr.reopen $stdout Puppet::Util::Log.reopen rescue => detail - File.open("/tmp/daemonout", "w") { |f| + Puppet::Util.secure_open("/tmp/daemonout", "w") { |f| f.puts "Could not start %s: %s" % [Puppet[:name], detail] } raise "Could not start %s: %s" % [Puppet[:name], detail] diff -Nru puppet-0.25.1/lib/puppet/network/xmlrpc/client.rb puppet-0.25.4/lib/puppet/network/xmlrpc/client.rb --- puppet-0.25.1/lib/puppet/network/xmlrpc/client.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/network/xmlrpc/client.rb 2010-01-29 21:32:27.000000000 +0000 @@ -144,6 +144,8 @@ Puppet.debug "Calling %s.%s" % [namespace, method] begin call("%s.%s" % [namespace, method.to_s],*args) + rescue SystemExit,NoMemoryError + raise rescue Exception => detail retry if self.class.error_handler(detail).execute(self, detail, namespace, method) == :retry end diff -Nru puppet-0.25.1/lib/puppet/node/environment.rb puppet-0.25.4/lib/puppet/node/environment.rb --- puppet-0.25.1/lib/puppet/node/environment.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/node/environment.rb 2010-01-29 21:32:27.000000000 +0000 @@ -55,15 +55,7 @@ if ENV["PUPPETLIB"] dirs = ENV["PUPPETLIB"].split(File::PATH_SEPARATOR) + dirs end - dirs.collect do |dir| - if dir !~ /^#{File::SEPARATOR}/ - File.join(Dir.getwd, dir) - else - dir - end - end.find_all do |p| - p =~ /^#{File::SEPARATOR}/ && FileTest.directory?(p) - end + validate_dirs(dirs) end # Return all modules from this environment. @@ -73,7 +65,26 @@ module_names.collect { |path| Puppet::Module.new(path, self) rescue nil }.compact end + # Cache the manifestdir, so that we aren't searching through + # all known directories all the time. + cached_attr(:manifestdir, :ttl => Puppet[:filetimeout]) do + validate_dirs(self[:manifestdir].split(File::PATH_SEPARATOR)) + end + def to_s name.to_s end + + def validate_dirs(dirs) + dirs.collect do |dir| + if dir !~ /^#{File::SEPARATOR}/ + File.join(Dir.getwd, dir) + else + dir + end + end.find_all do |p| + p =~ /^#{File::SEPARATOR}/ && FileTest.directory?(p) + end + end + end diff -Nru puppet-0.25.1/lib/puppet/parameter.rb puppet-0.25.4/lib/puppet/parameter.rb --- puppet-0.25.1/lib/puppet/parameter.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/parameter.rb 2010-01-29 21:32:27.000000000 +0000 @@ -293,6 +293,13 @@ define_method(:unmunge, &block) end + # Optionaly convert the value to a canonical form so that it will + # be found in hashes, etc. Mostly useful for namevars. + def to_canonicalize(&block) + metaclass = (class << self; self; end) + metaclass.send(:define_method,:canonicalize,&block) + end + # Mark whether we're the namevar. def isnamevar @isnamevar = true @@ -464,10 +471,19 @@ value end + # Assume the value is already in canonical form by default + def self.canonicalize(value) + value + end + + def canonicalize(value) + self.class.canonicalize(value) + end + # A wrapper around our munging that makes sure we raise useful exceptions. def munge(value) begin - ret = unsafe_munge(value) + ret = unsafe_munge(canonicalize(value)) rescue Puppet::Error => detail Puppet.debug "Reraising %s" % detail raise diff -Nru puppet-0.25.1/lib/puppet/parser/ast/boolean_operator.rb puppet-0.25.4/lib/puppet/parser/ast/boolean_operator.rb --- puppet-0.25.1/lib/puppet/parser/ast/boolean_operator.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/parser/ast/boolean_operator.rb 2010-01-29 21:32:27.000000000 +0000 @@ -20,14 +20,14 @@ # return result # lazy evaluate right operand case @operator - when "and"; + when "and" if Puppet::Parser::Scope.true?(lval) rval = @rval.safeevaluate(scope) Puppet::Parser::Scope.true?(rval) else # false and false == false false end - when "or"; + when "or" if Puppet::Parser::Scope.true?(lval) true else diff -Nru puppet-0.25.1/lib/puppet/parser/ast/leaf.rb puppet-0.25.4/lib/puppet/parser/ast/leaf.rb --- puppet-0.25.1/lib/puppet/parser/ast/leaf.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/parser/ast/leaf.rb 2010-01-29 21:32:27.000000000 +0000 @@ -101,7 +101,7 @@ end end - def to_classname + def to_classname(dummy_argument=:work_arround_for_ruby_GC_bug) to_s.downcase.gsub(/[^-\w:.]/,'').sub(/^\.+/,'') end @@ -150,6 +150,10 @@ return scope.lookupvar(@value) end end + + def to_s + "\$#{value}" + end end class Regex < AST::Leaf diff -Nru puppet-0.25.1/lib/puppet/parser/ast/resourceparam.rb puppet-0.25.4/lib/puppet/parser/ast/resourceparam.rb --- puppet-0.25.1/lib/puppet/parser/ast/resourceparam.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/parser/ast/resourceparam.rb 2010-01-29 21:32:27.000000000 +0000 @@ -18,5 +18,9 @@ :add => self.add ) end + + def to_s + "#{@param} => #{@value.to_s}" + end end end diff -Nru puppet-0.25.1/lib/puppet/parser/ast/selector.rb puppet-0.25.4/lib/puppet/parser/ast/selector.rb --- puppet-0.25.1/lib/puppet/parser/ast/selector.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/parser/ast/selector.rb 2010-01-29 21:32:27.000000000 +0000 @@ -41,5 +41,9 @@ ensure scope.unset_ephemeral_var end + + def to_s + param.to_s + " ? { " + values.collect { |v| v.to_s }.join(', ') + " }" + end end end diff -Nru puppet-0.25.1/lib/puppet/parser/functions/generate.rb puppet-0.25.4/lib/puppet/parser/functions/generate.rb --- puppet-0.25.1/lib/puppet/parser/functions/generate.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/parser/functions/generate.rb 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,7 @@ # Runs an external command and returns the results Puppet::Parser::Functions::newfunction(:generate, :type => :rvalue, - :doc => "Calls an external command and returns the results of the - command. Any arguments are passed to the external command as + :doc => "Calls an external command on the Puppet master and returns + the results of the command. Any arguments are passed to the external command as arguments. If the generator does not exit with return code of 0, the generator is considered to have failed and a parse error is thrown. Generators can only have file separators, alphanumerics, dashes, diff -Nru puppet-0.25.1/lib/puppet/parser/functions/shellquote.rb puppet-0.25.4/lib/puppet/parser/functions/shellquote.rb --- puppet-0.25.1/lib/puppet/parser/functions/shellquote.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/parser/functions/shellquote.rb 2010-01-29 21:32:27.000000000 +0000 @@ -10,7 +10,7 @@ with spaces. If an argument is an array, the elements of that array is interpolated within the rest of the arguments; this makes it possible to have an array of arguments and pass that array to - shellquote() instead of having to specify specify each argument + shellquote() instead of having to specify each argument individually in the call. ") \ do |args| diff -Nru puppet-0.25.1/lib/puppet/property.rb puppet-0.25.4/lib/puppet/property.rb --- puppet-0.25.1/lib/puppet/property.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/property.rb 2010-01-29 21:32:27.000000000 +0000 @@ -355,20 +355,12 @@ end def should_to_s(newvalue) - newvalue = [newvalue] unless newvalue.is_a? Array - if defined? newvalue - newvalue.join(" ") - else - return nil - end + [newvalue].flatten.join(" ") end def sync - if value = self.should - set(value) - else - self.devfail "Got a nil value for should" - end + devfail "Got a nil value for should" unless should + set(should) end def to_s diff -Nru puppet-0.25.1/lib/puppet/provider/augeas/augeas.rb puppet-0.25.4/lib/puppet/provider/augeas/augeas.rb --- puppet-0.25.1/lib/puppet/provider/augeas/augeas.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/augeas/augeas.rb 2010-01-29 21:32:27.000000000 +0000 @@ -254,6 +254,8 @@ when "get"; return_value = process_get(cmd_array) when "match"; return_value = process_match(cmd_array) end + rescue SystemExit,NoMemoryError + raise rescue Exception => e fail("Error sending command '#{command}' with params #{cmd_array[1..-1].inspect}/#{e.message}") end @@ -335,6 +337,8 @@ aug.insert(path, label, before) else fail("Command '#{command}' is not supported") end + rescue SystemExit,NoMemoryError + raise rescue Exception => e fail("Error sending command '#{command}' with params #{cmd_array.inspect}/#{e.message}") end diff -Nru puppet-0.25.1/lib/puppet/provider/cron/crontab.rb puppet-0.25.4/lib/puppet/provider/cron/crontab.rb --- puppet-0.25.1/lib/puppet/provider/cron/crontab.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/cron/crontab.rb 2010-01-29 21:32:27.000000000 +0000 @@ -3,6 +3,8 @@ tab = case Facter.value(:operatingsystem) when "Solaris" :suntab + when "AIX" + :aixtab else :crontab end diff -Nru puppet-0.25.1/lib/puppet/provider/host/parsed.rb puppet-0.25.4/lib/puppet/provider/host/parsed.rb --- puppet-0.25.1/lib/puppet/provider/host/parsed.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/host/parsed.rb 2010-01-29 21:32:27.000000000 +0000 @@ -17,8 +17,8 @@ text_line :comment, :match => /^#/ text_line :blank, :match => /^\s*$/ - record_line :parsed, :fields => %w{ip name alias}, - :optional => %w{alias}, + record_line :parsed, :fields => %w{ip name host_aliases}, + :optional => %w{host_aliases}, :rts => true do |line| hash = {} if line.sub!(/^(\S+)\s+(\S+)\s*/, '') @@ -30,7 +30,7 @@ line.sub!(/^([^#]+)\s*/) do |value| aliases = $1 unless aliases =~ /^\s*$/ - hash[:alias] = aliases.split(/\s+/) + hash[:host_aliases] = aliases.split(/\s+/) end "" @@ -40,8 +40,8 @@ raise Puppet::Error, "Could not match '%s'" % line end - if hash[:alias] == "" - hash.delete(:alias) + if hash[:host_aliases] == "" + hash.delete(:host_aliases) end return hash @@ -58,11 +58,11 @@ str = "%s\t%s" % [hash[:ip], hash[:name]] - if hash.include? :alias - if hash[:alias].is_a? Array - str += "\t%s" % hash[:alias].join("\t") + if hash.include? :host_aliases + if hash[:host_aliases].is_a? Array + str += "\t%s" % hash[:host_aliases].join("\t") else - raise ArgumentError, "Aliases must be specified as an array" + raise ArgumentError, "Host aliases must be specified as an array" end end diff -Nru puppet-0.25.1/lib/puppet/provider/mount/parsed.rb puppet-0.25.4/lib/puppet/provider/mount/parsed.rb --- puppet-0.25.1/lib/puppet/provider/mount/parsed.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/mount/parsed.rb 2010-01-29 21:32:27.000000000 +0000 @@ -31,6 +31,15 @@ text_line :comment, :match => /^\s*#/ text_line :blank, :match => /^\s*$/ - record_line self.name, :fields => @fields, :separator => /\s+/, :joiner => "\t", :optional => [:pass, :dump] + optional_fields = @fields - [:device, :name, :blockdevice] + mandatory_fields = @fields - optional_fields + + # fstab will ignore lines that have fewer than the mandatory number of columns, + # so we should, too. + field_pattern = '(\s*(?>\S+))' + text_line :incomplete, :match => /^(?!#{field_pattern}{#{mandatory_fields.length}})/ + + record_line self.name, :fields => @fields, :separator => /\s+/, :joiner => "\t", :optional => optional_fields + end diff -Nru puppet-0.25.1/lib/puppet/provider/package/blastwave.rb puppet-0.25.4/lib/puppet/provider/package/blastwave.rb --- puppet-0.25.1/lib/puppet/provider/package/blastwave.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/package/blastwave.rb 2010-01-29 21:32:27.000000000 +0000 @@ -10,8 +10,9 @@ commands :pkgget => pkgget - # This is so stupid, but then, so is blastwave. - ENV["PAGER"] = "/usr/bin/cat" + def pkgget_with_cat(*args) + Puppet::Util::Execution::withenv(:PAGER => "/usr/bin/cat") { pkgget(*args) } + end def self.extended(mod) unless command(:pkgget) != "pkg-get" @@ -40,7 +41,7 @@ command << hash[:justme] end - output = pkgget command + output = Puppet::Util::Execution::withenv(:PAGER => "/usr/bin/cat") { pkgget command } list = output.split("\n").collect do |line| next if line =~ /^#/ @@ -88,7 +89,7 @@ end def install - pkgget "-f", :install, @resource[:name] + pkgget_with_cat "-f", :install, @resource[:name] end # Retrieve the version from the current package file. @@ -107,11 +108,11 @@ # Remove the old package, and install the new one def update - pkgget "-f", :upgrade, @resource[:name] + pkgget_with_cat "-f", :upgrade, @resource[:name] end def uninstall - pkgget "-f", :remove, @resource[:name] + pkgget_with_cat "-f", :remove, @resource[:name] end end diff -Nru puppet-0.25.1/lib/puppet/provider/package/portage.rb puppet-0.25.4/lib/puppet/provider/package/portage.rb --- puppet-0.25.1/lib/puppet/provider/package/portage.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/package/portage.rb 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ require 'puppet/provider/package' Puppet::Type.type(:package).provide :portage, :parent => Puppet::Provider::Package do - include Puppet::Util::Execution desc "Provides packaging support for Gentoo's portage system." has_feature :versionable @@ -13,33 +12,32 @@ defaultfor :operatingsystem => :gentoo def self.instances - result_format = /(\S+) (\S+) \[(?:([0-9.a-zA-Z]+(?:_(?:alpha|beta|pre|rc|p)[0-9]*)*(?:-r[0-9]*)?)(?:\([^\)]+\))?(?:\[([^\]]+)\])?[ ]*)*\] \[(?:(?:\{M\})?(?:\([~*]+\))?([0-9.a-zA-Z]+(?:_(?:alpha|beta|pre|rc|p)[0-9]*)*(?:-r[0-9]*)?)(?:\(([^\)]+)\))?(?:![mf])*(?:\[([^\]]+)\])?)?\] ([\S]*) (.*)/ - result_fields = [:category, :name, :ensure, :ensure_overlay, :version_available, :slot, :overlay, :vendor, :description] + result_format = /(\S+) (\S+) \[(\S+)\] \[(\S+)\] (\S+) (.*)/ + result_fields = [:category, :name, :ensure, :version_available, :vendor, :description] - version_format = "{!last} {}" - search_format = " [] [] " + version_format = "{last}{}" + search_format = " [] [] \n" begin if !FileUtils.uptodate?("/var/cache/eix", %w(/usr/bin/eix /usr/portage/metadata/timestamp)) update_eix end + search_output = nil - withenv :SPLITVERSIONS => version_format do - search_output = eix "--nocolor", "--pure-packages", "--installed", "--format", search_format + Puppet::Util::Execution.withenv :LASTVERSION => version_format do + search_output = eix "--nocolor", "--pure-packages", "--stable", "--installed", "--format", search_format end packages = [] search_output.each do |search_result| - match = result_format.match( search_result ) + match = result_format.match(search_result) if match package = {} - result_fields.zip(match.captures) { |field, value| + result_fields.zip(match.captures) do |field, value| package[field] = value unless !value or value.empty? - } + end package[:provider] = :portage - package[:ensure] = package[:ensure].split.last - packages << new(package) end end @@ -74,36 +72,35 @@ end def query - result_format = /(\S+) (\S+) \[(?:([0-9.a-zA-Z]+(?:_(?:alpha|beta|pre|rc|p)[0-9]*)*(?:-r[0-9]*)?)(?:\([^\)]+\))?(?:\[([^\]]+)\])?[ ]*)*\] \[(?:(?:\{M\})?(?:\([~*]+\))?([0-9.a-zA-Z]+(?:_(?:alpha|beta|pre|rc|p)[0-9]*)*(?:-r[0-9]*)?)(?:\(([^\)]+)\))?(?:![mf])*(?:\[([^\]]+)\])?)?\] ([\S]*) (.*)/ - result_fields = [:category, :name, :ensure, :ensure_overlay, :version_available, :slot, :overlay, :vendor, :description] + result_format = /(\S+) (\S+) \[(\S*)\] \[(\S+)\] (\S+) (.*)/ + result_fields = [:category, :name, :ensure, :version_available, :vendor, :description] + + version_format = "{last}{}" + search_format = " [] [] \n" search_field = package_name.count('/') > 0 ? "--category-name" : "--name" search_value = package_name - version_format = "{!last} {}" - search_format = " [] [] " - begin if !FileUtils.uptodate?("/var/cache/eix", %w(/usr/bin/eix /usr/portage/metadata/timestamp)) update_eix end + search_output = nil - withenv :SPLITVERSIONS => version_format do - search_output = eix "--nocolor", "--pure-packages", "--format", search_format, "--exact", search_field, search_value + Puppet::Util::Execution.withenv :LASTVERSION => version_format do + search_output = eix "--nocolor", "--pure-packages", "--stable", "--format", search_format, "--exact", search_field, search_value end packages = [] search_output.each do |search_result| - match = result_format.match( search_result ) + match = result_format.match(search_result) - if( match ) + if match package = {} - result_fields.zip( match.captures ) { |field, value| package[field] = value unless !value or value.empty? } - if package[:ensure] - package[:ensure] = package[:ensure].split.last - else - package[:ensure] = :absent + result_fields.zip(match.captures) do |field, value| + package[field] = value unless !value or value.empty? end + package[:ensure] = package[:ensure] ? package[:ensure] : :absent packages << package end end @@ -126,4 +123,3 @@ return self.query[:version_available] end end - diff -Nru puppet-0.25.1/lib/puppet/provider/package/rug.rb puppet-0.25.4/lib/puppet/provider/package/rug.rb --- puppet-0.25.1/lib/puppet/provider/package/rug.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/package/rug.rb 2010-01-29 21:32:27.000000000 +0000 @@ -36,7 +36,7 @@ #rug can only get a list of *all* available packages? output = rug "list-updates" - if output =~ /#{Regexp.escape @resource[:name]}\s*\|\s*([0-9\.\-]+)/ + if output =~ /#{Regexp.escape @resource[:name]}\s*\|\s*([^\s\|]+)/ return $1 else # rug didn't find updates, pretend the current diff -Nru puppet-0.25.1/lib/puppet/provider/package/sun.rb puppet-0.25.4/lib/puppet/provider/package/sun.rb --- puppet-0.25.1/lib/puppet/provider/package/sun.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/package/sun.rb 2010-01-29 21:32:27.000000000 +0000 @@ -94,7 +94,7 @@ execpipe(cmd) { |process| # we're using the long listing, so each line is a separate # piece of information - process.each { |line| + process.readlines.each { |line| case line when /^$/ # ignore when /\s*([A-Z]+):\s+(.+)/ @@ -111,8 +111,10 @@ } } return hash - rescue Puppet::ExecutionFailure - return nil + rescue Puppet::ExecutionFailure => detail + return {:ensure => :absent} if detail.message =~ /information for "#{Regexp.escape(@resource[:name])}" was not found/ + puts detail.backtrace if Puppet[:trace] + raise Puppet::Error, "Unable to get information about package #{@resource[:name]} because of: #{detail}" end end diff -Nru puppet-0.25.1/lib/puppet/provider/service/daemontools.rb puppet-0.25.4/lib/puppet/provider/service/daemontools.rb --- puppet-0.25.1/lib/puppet/provider/service/daemontools.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/service/daemontools.rb 2010-01-29 21:32:27.000000000 +0000 @@ -45,7 +45,7 @@ attr_writer :defpath # Determine the daemon path. - def defpath + def defpath(dummy_argument=:work_arround_for_ruby_GC_bug) unless defined?(@defpath) and @defpath ["/var/lib/service", "/etc"].each do |path| if FileTest.exist?(path) diff -Nru puppet-0.25.1/lib/puppet/provider/service/debian.rb puppet-0.25.4/lib/puppet/provider/service/debian.rb --- puppet-0.25.1/lib/puppet/provider/service/debian.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/service/debian.rb 2010-01-29 21:32:27.000000000 +0000 @@ -29,7 +29,7 @@ def enabled? # TODO: Replace system() call when Puppet::Util.execute gives us a way # to determine exit status. http://projects.reductivelabs.com/issues/2538 - system("/usr/sbin/invoke-rc.d", "--query", @resource[:name], "start") + system("/usr/sbin/invoke-rc.d", "--quiet", "--query", @resource[:name], "start") # 104 is the exit status when you query start an enabled service. # 106 is the exit status when the policy layer supplies a fallback action diff -Nru puppet-0.25.1/lib/puppet/provider/service/init.rb puppet-0.25.4/lib/puppet/provider/service/init.rb --- puppet-0.25.1/lib/puppet/provider/service/init.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/service/init.rb 2010-01-29 21:32:27.000000000 +0000 @@ -70,8 +70,23 @@ @initscript ||= self.search(@resource[:name]) end + def paths + @paths ||= @resource[:path].find_all do |path| + if File.directory?(path) + true + else + if File.exist?(path) and ! File.directory?(path) + self.debug "Search path #{path} is not a directory" + else + self.debug "Search path #{path} does not exist" + end + false + end + end + end + def search(name) - @resource[:path].each { |path| + paths.each { |path| fqname = File.join(path,name) begin stat = File.stat(fqname) @@ -84,7 +99,8 @@ # if we've gotten this far, we found a valid script return fqname } - @resource[:path].each { |path| + + paths.each { |path| fqname_sh = File.join(path,"#{name}.sh") begin stat = File.stat(fqname_sh) diff -Nru puppet-0.25.1/lib/puppet/provider/service/runit.rb puppet-0.25.4/lib/puppet/provider/service/runit.rb --- puppet-0.25.1/lib/puppet/provider/service/runit.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/service/runit.rb 2010-01-29 21:32:27.000000000 +0000 @@ -38,7 +38,7 @@ class << self # this is necessary to autodetect a valid resource # default path, since there is no standard for such directory. - def defpath + def defpath(dummy_argument=:work_arround_for_ruby_GC_bug) unless defined?(@defpath) and @defpath ["/etc/sv", "/var/lib/service"].each do |path| if FileTest.exist?(path) diff -Nru puppet-0.25.1/lib/puppet/provider/ssh_authorized_key/parsed.rb puppet-0.25.4/lib/puppet/provider/ssh_authorized_key/parsed.rb --- puppet-0.25.1/lib/puppet/provider/ssh_authorized_key/parsed.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/ssh_authorized_key/parsed.rb 2010-01-29 21:32:27.000000000 +0000 @@ -14,8 +14,9 @@ :fields => %w{options type key name}, :optional => %w{options}, :rts => /^\s+/, - :match => /^(?:(.+) )?(ssh-dss|ssh-rsa) ([^ ]+)(?: (.+))?$/, + :match => /^(?:(.+) )?(ssh-dss|ssh-rsa) ([^ ]+) ?(.*)$/, :post_parse => proc { |h| + h[:name] = "" if h[:name] == :absent h[:options] ||= [:absent] h[:options] = Puppet::Type::Ssh_authorized_key::ProviderParsed.parse_options(h[:options]) if h[:options].is_a? String }, diff -Nru puppet-0.25.1/lib/puppet/provider/sshkey/parsed.rb puppet-0.25.4/lib/puppet/provider/sshkey/parsed.rb --- puppet-0.25.1/lib/puppet/provider/sshkey/parsed.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/sshkey/parsed.rb 2010-01-29 21:32:27.000000000 +0000 @@ -19,18 +19,16 @@ record_line :parsed, :fields => %w{name type key}, :post_parse => proc { |hash| - if hash[:name] =~ /,/ - names = hash[:name].split(",") - hash[:name] = names.shift - hash[:alias] = names - end + names = hash[:name].split(",", -1) + hash[:name] = names.shift + hash[:host_aliases] = names }, :pre_gen => proc { |hash| - if hash[:alias] - names = [hash[:name], hash[:alias]].flatten + if hash[:host_aliases] + names = [hash[:name], hash[:host_aliases]].flatten - hash[:name] = [hash[:name], hash[:alias]].flatten.join(",") - hash.delete(:alias) + hash[:name] = [hash[:name], hash[:host_aliases]].flatten.join(",") + hash.delete(:host_aliases) end } end diff -Nru puppet-0.25.1/lib/puppet/provider/zone/solaris.rb puppet-0.25.4/lib/puppet/provider/zone/solaris.rb --- puppet-0.25.1/lib/puppet/provider/zone/solaris.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/provider/zone/solaris.rb 2010-01-29 21:32:27.000000000 +0000 @@ -64,7 +64,7 @@ @property_hash.clear end - def install + def install(dummy_argument=:work_arround_for_ruby_GC_bug) if @resource[:install_args] zoneadm :install, @resource[:install_args].split(" ") else diff -Nru puppet-0.25.1/lib/puppet/rails/benchmark.rb puppet-0.25.4/lib/puppet/rails/benchmark.rb --- puppet-0.25.1/lib/puppet/rails/benchmark.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/rails/benchmark.rb 2010-01-29 21:32:27.000000000 +0000 @@ -64,6 +64,6 @@ data = {} end data[branch] = $benchmarks - File.open(file, "w") { |f| f.print YAML.dump(data) } + Puppet::Util.secure_open(file, "w") { |f| f.print YAML.dump(data) } end end diff -Nru puppet-0.25.1/lib/puppet/rails/host.rb puppet-0.25.4/lib/puppet/rails/host.rb --- puppet-0.25.1/lib/puppet/rails/host.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/rails/host.rb 2010-01-29 21:32:27.000000000 +0000 @@ -172,11 +172,6 @@ end def find_resources_parameters_tags(resources) - # initialize all resource parameters - resources.each do |key,resource| - resource.params_hash = [] - end - find_resources_parameters(resources) find_resources_tags(resources) end @@ -294,7 +289,7 @@ # assign each loaded parameters/tags to the resource it belongs to params.each do |param| - resources[param['resource_id']].add_param_to_hash(param) if resources.include?(param['resource_id']) + resources[param['resource_id']].add_param_to_list(param) if resources.include?(param['resource_id']) end end @@ -302,7 +297,7 @@ tags = Puppet::Rails::ResourceTag.find_all_tags_from_host(self) tags.each do |tag| - resources[tag['resource_id']].add_tag_to_hash(tag) if resources.include?(tag['resource_id']) + resources[tag['resource_id']].add_tag_to_list(tag) if resources.include?(tag['resource_id']) end end diff -Nru puppet-0.25.1/lib/puppet/rails/resource.rb puppet-0.25.4/lib/puppet/rails/resource.rb --- puppet-0.25.1/lib/puppet/rails/resource.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/rails/resource.rb 2010-01-29 21:32:27.000000000 +0000 @@ -63,22 +63,28 @@ unserialize_value(self[:title]) end - def add_param_to_hash(param) - @params_hash ||= [] - @params_hash << param + def params_list + @params_list ||= [] end - def add_tag_to_hash(tag) - @tags_hash ||= [] - @tags_hash << tag + def params_list=(params) + @params_list = params end - def params_hash=(hash) - @params_hash = hash + def add_param_to_list(param) + params_list << param end - def tags_hash=(hash) - @tags_hash = hash + def tags_list + @tags_list ||= [] + end + + def tags_list=(tags) + @tags_list = tags + end + + def add_tag_to_list(tag) + tags_list << tag end def [](param) @@ -116,7 +122,7 @@ db_params = {} deletions = [] - @params_hash.each do |value| + params_list.each do |value| # First remove any parameters our catalog resource doesn't have at all. deletions << value['id'] and next unless catalog_params.include?(value['name']) @@ -142,7 +148,7 @@ # Lastly, add any new parameters. catalog_params.each do |name, value| - next if db_params.include?(name) + next if db_params.include?(name) && ! db_params[name].find{ |val| deletions.include?( val["id"] ) } values = value.is_a?(Array) ? value : [value] values.each do |v| @@ -156,7 +162,7 @@ in_db = [] deletions = [] resource_tags = resource.tags - @tags_hash.each do |tag| + tags_list.each do |tag| deletions << tag['id'] and next unless resource_tags.include?(tag['name']) in_db << tag['name'] end @@ -187,19 +193,7 @@ end end - def parameters - result = get_params_hash - result.each do |param, value| - if value.is_a?(Array) - result[param] = value.collect { |v| v['value'] } - else - result[param] = value.value - end - end - result - end - - def ref + def ref(dummy_argument=:work_arround_for_ruby_GC_bug) "%s[%s]" % [self[:restype].split("::").collect { |s| s.capitalize }.join("::"), self.title.to_s] end diff -Nru puppet-0.25.1/lib/puppet/rails.rb puppet-0.25.4/lib/puppet/rails.rb --- puppet-0.25.1/lib/puppet/rails.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/rails.rb 2010-01-29 21:32:27.000000000 +0000 @@ -22,10 +22,16 @@ ActiveRecord::Base.logger.level = Logger::DEBUG end + if (::ActiveRecord::VERSION::MAJOR == 2 and ::ActiveRecord::VERSION::MINOR <= 1) + ActiveRecord::Base.allow_concurrency = true + end + ActiveRecord::Base.verify_active_connections! begin - ActiveRecord::Base.establish_connection(database_arguments()) + args = database_arguments + Puppet.info "Connecting to #{args[:adapter]} database: #{args[:database]}" + ActiveRecord::Base.establish_connection(args) rescue => detail if Puppet[:trace] puts detail.backtrace @@ -42,12 +48,13 @@ case adapter when "sqlite3" - args[:dbfile] = Puppet[:dblocation] + args[:database] = Puppet[:dblocation] when "mysql", "postgresql" args[:host] = Puppet[:dbserver] unless Puppet[:dbserver].empty? args[:username] = Puppet[:dbuser] unless Puppet[:dbuser].empty? args[:password] = Puppet[:dbpassword] unless Puppet[:dbpassword].empty? args[:database] = Puppet[:dbname] + args[:reconnect]= true socket = Puppet[:dbsocket] args[:socket] = socket unless socket.empty? diff -Nru puppet-0.25.1/lib/puppet/resource/catalog.rb puppet-0.25.4/lib/puppet/resource/catalog.rb --- puppet-0.25.1/lib/puppet/resource/catalog.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/resource/catalog.rb 2010-01-29 21:32:27.000000000 +0000 @@ -78,7 +78,7 @@ @resource_table[ref] = resource # If the name and title differ, set up an alias - #self.alias(resource, resource.name) if resource.respond_to?(:name) and resource.respond_to?(:title) and resource.name != resource.title + if resource.respond_to?(:name) and resource.respond_to?(:title) and resource.name != resource.title self.alias(resource, resource.name) if resource.isomorphic? end @@ -430,12 +430,12 @@ # the class. edge = Puppet::Relationship.from_pson(edge) if edge.is_a?(Hash) unless source = result.resource(edge.source) - raise ArgumentError, "Could not convert from pson: Could not find relationship source '%s'" % source + raise ArgumentError, "Could not convert from pson: Could not find relationship source #{edge.source.inspect}" end edge.source = source unless target = result.resource(edge.target) - raise ArgumentError, "Could not convert from pson: Could not find relationship target '%s'" % target + raise ArgumentError, "Could not convert from pson: Could not find relationship target #{edge.target.inspect}" end edge.target = target diff -Nru puppet-0.25.1/lib/puppet/resource/reference.rb puppet-0.25.4/lib/puppet/resource/reference.rb --- puppet-0.25.1/lib/puppet/resource/reference.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/resource/reference.rb 2010-01-29 21:32:27.000000000 +0000 @@ -20,24 +20,12 @@ end def initialize(argtype, argtitle = nil) - if argtitle.nil? - if argtype.is_a?(Puppet::Type) - self.title = argtype.title - self.type = argtype.class.name - else - self.title = argtype - if self.title == argtype - raise ArgumentError, "No title provided and title '%s' is not a valid resource reference" % argtype.inspect - end - end - else - # This will set @type if it looks like a resource reference. - self.title = argtitle - - # Don't override whatever was done by setting the title. - self.type ||= argtype - end - + self.type,self.title = + if (argtitle || argtype) =~ /^([^\[\]]+)\[(.+)\]$/m then [ $1, $2 ] + elsif argtitle then [ argtype, argtitle ] + elsif argtype.is_a?(Puppet::Type) then [ argtype.class.name, argtype.title ] + else raise ArgumentError, "No title provided and #{argtype.inspect} is not a valid resource reference" + end @builtin_type = nil end @@ -47,15 +35,11 @@ return nil end - # If the title has square brackets, treat it like a reference and - # set things appropriately; else, just set it. def title=(value) - if value =~ /^([^\[\]]+)\[(.+)\]$/ - self.type = $1 - @title = $2 - else - @title = value + if @type and klass = Puppet::Type.type(@type.to_s.downcase) + value = klass.canonicalize_ref(value) end + @title = value end # Canonize the type so we know it's always consistent. @@ -66,6 +50,10 @@ # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] x = @type = value.to_s.split("::").collect { |s| s.capitalize }.join("::") end + + if @title + self.title = @title + end end # Convert to the reference format that TransObject uses. Yay backward diff -Nru puppet-0.25.1/lib/puppet/ssl/certificate.rb puppet-0.25.4/lib/puppet/ssl/certificate.rb --- puppet-0.25.1/lib/puppet/ssl/certificate.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/ssl/certificate.rb 2010-01-29 21:32:27.000000000 +0000 @@ -28,7 +28,8 @@ end def expiration - return nil unless content - return content.not_after + # Our expiration is either that of the cache or the content, whichever comes first + cache_expiration = @expiration + [(content and content.not_after), cache_expiration].compact.sort.first end end diff -Nru puppet-0.25.1/lib/puppet/ssl/host.rb puppet-0.25.4/lib/puppet/ssl/host.rb --- puppet-0.25.1/lib/puppet/ssl/host.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/ssl/host.rb 2010-01-29 21:32:27.000000000 +0000 @@ -94,12 +94,7 @@ # Remove all traces of a given host def self.destroy(name) - [Key, Certificate, CertificateRequest].inject(false) do |result, klass| - if klass.destroy(name) - result = true - end - result - end + [Key, Certificate, CertificateRequest].collect { |part| part.destroy(name) }.any? { |x| x } end # Search for more than one host, optionally only specifying @@ -107,12 +102,7 @@ # This just allows our non-indirected class to have one of # indirection methods. def self.search(options = {}) - classes = [Key, CertificateRequest, Certificate] - if klass = options[:for] - classlist = [klass].flatten - else - classlist = [Key, CertificateRequest, Certificate] - end + classlist = [options[:for] || [Key, CertificateRequest, Certificate]].flatten # Collect the results from each class, flatten them, collect all of the names, make the name list unique, # then create a Host instance for each one. @@ -127,8 +117,7 @@ end def key - return nil unless @key ||= Key.find(name) - @key + @key ||= Key.find(name) end # This is the private key; we can create it from scratch @@ -146,8 +135,7 @@ end def certificate_request - return nil unless @certificate_request ||= CertificateRequest.find(name) - @certificate_request + @certificate_request ||= CertificateRequest.find(name) end # Our certificate request requires the key but that's all. @@ -166,26 +154,19 @@ end def certificate - unless @certificate - generate_key unless key - + @certificate ||= ( # get the CA cert first, since it's required for the normal cert # to be of any use. - return nil unless Certificate.find("ca") unless ca? - return nil unless @certificate = Certificate.find(name) - - unless certificate_matches_key? - raise Puppet::Error, "Retrieved certificate does not match private key; please remove certificate from server and regenerate it with the current key" + if not (key or generate_key) or not (ca? or Certificate.find("ca")) or not (cert = Certificate.find(name)) or cert.expired? + nil + elsif not cert.content.check_private_key(key.content) + Certificate.expire(name) + Puppet.warning "Retrieved certificate does not match private key" + nil + else + cert end - end - @certificate - end - - def certificate_matches_key? - return false unless key - return false unless certificate - - return certificate.content.check_private_key(key.content) + ) end # Generate all necessary parts of our ssl host. @@ -239,6 +220,8 @@ return if certificate generate return if certificate + rescue SystemExit,NoMemoryError + raise rescue Exception => detail Puppet.err "Could not request certificate: %s" % detail.to_s if time < 1 diff -Nru puppet-0.25.1/lib/puppet/sslcertificates/ca.rb puppet-0.25.4/lib/puppet/sslcertificates/ca.rb --- puppet-0.25.1/lib/puppet/sslcertificates/ca.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/sslcertificates/ca.rb 2010-01-29 21:32:27.000000000 +0000 @@ -134,7 +134,7 @@ # List certificates waiting to be signed. This returns a list of hostnames, not actual # files -- the names can be converted to full paths with host2csrfile. - def list + def list(dummy_argument=:work_arround_for_ruby_GC_bug) return Dir.entries(Puppet[:csrdir]).find_all { |file| file =~ /\.pem$/ }.collect { |file| @@ -144,7 +144,7 @@ # List signed certificates. This returns a list of hostnames, not actual # files -- the names can be converted to full paths with host2csrfile. - def list_signed + def list_signed(dummy_argument=:work_arround_for_ruby_GC_bug) return Dir.entries(Puppet[:signeddir]).find_all { |file| file =~ /\.pem$/ }.collect { |file| @@ -278,12 +278,13 @@ host = thing2name(csr) csrfile = host2csrfile(host) - if File.exists?(csrfile) - raise Puppet::Error, "Certificate request for %s already exists" % host - end + raise Puppet::Error, "Certificate request for #{host} already exists" if File.exists?(csrfile) + Puppet.settings.writesub(:csrdir, csrfile) { |f| f.print csr.to_pem } - Puppet.settings.writesub(:csrdir, csrfile) do |f| - f.print csr.to_pem + certfile = host2certfile(host) + if File.exists?(certfile) + Puppet.notice "Removing previously signed certificate #{certfile} for #{host}" + Puppet::SSLCertificates::Inventory::rebuild end end diff -Nru puppet-0.25.1/lib/puppet/sslcertificates.rb puppet-0.25.4/lib/puppet/sslcertificates.rb --- puppet-0.25.1/lib/puppet/sslcertificates.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/sslcertificates.rb 2010-01-29 21:32:27.000000000 +0000 @@ -2,11 +2,7 @@ require 'puppet' -begin - require 'openssl' -rescue LoadError - raise Puppet::Error, "You must have the Ruby openssl library installed" -end +raise Puppet::Error, "You must have the Ruby openssl library installed" unless Puppet.features.openssl? module Puppet::SSLCertificates #def self.mkcert(type, name, dnsnames, ttl, issuercert, issuername, serial, publickey) diff -Nru puppet-0.25.1/lib/puppet/transaction.rb puppet-0.25.4/lib/puppet/transaction.rb --- puppet-0.25.1/lib/puppet/transaction.rb 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/lib/puppet/transaction.rb 2010-01-29 21:32:27.000000000 +0000 @@ -355,6 +355,7 @@ made = [made] unless made.is_a?(Array) made.uniq.find_all do |res| begin + res.tag(*resource.tags) @catalog.add_resource(res) do |r| r.finish make_parent_child_relationship(resource, [r]) @@ -618,8 +619,11 @@ # Is this resource tagged appropriately? def missing_tags?(resource) - return false if self.ignore_tags? or tags.empty? - return true unless resource.tagged?(tags) + not appropriately_tagged?(resource) + end + + def appropriately_tagged?(resource) + self.ignore_tags? or tags.empty? or resource.tagged?(*tags) end # Are there any edges that target this resource? diff -Nru puppet-0.25.1/lib/puppet/type/file/content.rb puppet-0.25.4/lib/puppet/type/file/content.rb --- puppet-0.25.1/lib/puppet/type/file/content.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/file/content.rb 2010-01-29 21:32:27.000000000 +0000 @@ -96,7 +96,7 @@ return true if ! @resource.replace? if self.should - return super + result = super elsif source = resource.parameter(:source) fail "Got a remote source with no checksum" unless source.checksum result = (is == source.checksum) @@ -114,14 +114,14 @@ def retrieve return :absent unless stat = @resource.stat - + ftype = stat.ftype # Don't even try to manage the content on directories or links - return nil if stat.ftype == "directory" + return nil if ["directory","link"].include? ftype or checksum_type.nil? begin - return "{#{checksum_type}}" + send(checksum_type.to_s + "_file", resource[:path]).to_s + "{#{checksum_type}}" + send(checksum_type.to_s + "_file", resource[:path]).to_s rescue => detail - raise Puppet::Error, "Could not read %s: %s" % [@resource.title, detail] + raise Puppet::Error, "Could not read #{ftype} #{@resource.title}: #{detail}" end end diff -Nru puppet-0.25.1/lib/puppet/type/file/ensure.rb puppet-0.25.4/lib/puppet/type/file/ensure.rb --- puppet-0.25.1/lib/puppet/type/file/ensure.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/file/ensure.rb 2010-01-29 21:32:27.000000000 +0000 @@ -80,13 +80,9 @@ newvalue(:link) do - if property = @resource.property(:target) - property.retrieve - - return property.mklink - else - self.fail "Cannot create a symlink without a target" - end + fail "Cannot create a symlink without a target" unless property = resource.property(:target) + property.retrieve + property.mklink end # Symlinks. @@ -97,16 +93,9 @@ munge do |value| value = super(value) - - # It doesn't make sense to try to manage links unless, well, - # we're managing links. - resource[:links] = :manage if value == :link - return value if value.is_a? Symbol - - @resource[:target] = value - resource[:links] = :manage - - return :link + value,resource[:target] = :link,value unless value.is_a? Symbol + resource[:links] = :manage if value == :link and resource[:links] != :follow + value end def change_to_s(currentvalue, newvalue) diff -Nru puppet-0.25.1/lib/puppet/type/file/mode.rb puppet-0.25.4/lib/puppet/type/file/mode.rb --- puppet-0.25.1/lib/puppet/type/file/mode.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/file/mode.rb 2010-01-29 21:32:27.000000000 +0000 @@ -5,7 +5,24 @@ Puppet::Type.type(:file).newproperty(:mode) do require 'etc' desc "Mode the file should be. Currently relatively limited: - you must specify the exact mode the file should be." + you must specify the exact mode the file should be. + + Note that when you set the mode of a directory, Puppet always + sets the search/traverse (1) bit anywhere the read (4) bit is set. + This is almost always what you want: read allows you to list the + entries in a directory, and search/traverse allows you to access + (read/write/execute) those entries.) Because of this feature, you + can recursively make a directory and all of the files in it + world-readable by setting e.g.:: + + file { '/some/dir': + mode => 644, + recurse => true, + } + + In this case all of the files underneath ``/some/dir`` will have + mode 644, and all of the directories will have mode 755." + @event = :file_changed # Our modes are octal, so make sure they print correctly. Other diff -Nru puppet-0.25.1/lib/puppet/type/file/source.rb puppet-0.25.4/lib/puppet/type/file/source.rb --- puppet-0.25.1/lib/puppet/type/file/source.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/file/source.rb 2010-01-29 21:32:27.000000000 +0000 @@ -93,11 +93,7 @@ end def checksum - if metadata - metadata.checksum - else - nil - end + metadata && metadata.checksum end # Look up (if necessary) and return remote content. @@ -119,16 +115,20 @@ [:owner, :mode, :group, :checksum].each do |param| next if param == :owner and Puppet::Util::SUIDManager.uid != 0 next if param == :checksum and metadata.ftype == "directory" - unless value = @resource[param] and value != :absent - @resource[param] = metadata.send(param) + unless value = resource[param] and value != :absent + resource[param] = metadata.send(param) end end - # Set the 'ensure' value, unless we're trying to delete the file. - @resource[:ensure] = metadata.ftype unless @resource[:ensure] == :absent - - if metadata.ftype == "link" - @resource[:target] = metadata.destination + if resource[:ensure] == :absent + # We know all we need to + elsif metadata.ftype != "link" + resource[:ensure] = metadata.ftype + elsif @resource[:links] == :follow + resource[:ensure] = :present + else + resource[:ensure] = "link" + resource[:target] = metadata.destination end end diff -Nru puppet-0.25.1/lib/puppet/type/file.rb puppet-0.25.4/lib/puppet/type/file.rb --- puppet-0.25.1/lib/puppet/type/file.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/file.rb 2010-01-29 21:32:27.000000000 +0000 @@ -31,7 +31,7 @@ validate do |value| unless value =~ /^#{File::SEPARATOR}/ - raise Puppet::Error, "File paths must be fully qualified, not '%s'" % value + fail Puppet::Error,"File paths must be fully qualified, not '#{value}'" end end @@ -46,6 +46,12 @@ unmunge do |value| File.join( Puppet::FileCollection.collection.path(value[:index]), value[:name] ) end + + to_canonicalize do |s| + # Get rid of any duplicate slashes, and remove any trailing slashes unless + # the title is just a slash, in which case leave it. + s.gsub(/\/+/, "/").sub(/(.)\/$/,'\1') + end end newparam(:backup) do @@ -120,10 +126,10 @@ munge do |value| newval = super(value) case newval - when :true, :inf: true - when :false: false - when :remote: :remote - when Integer, Fixnum, Bignum: + when :true, :inf; true + when :false; false + when :remote; :remote + when Integer, Fixnum, Bignum self.warning "Setting recursion depth with the recurse parameter is now deprecated, please use recurselimit" # recurse == 0 means no recursion @@ -131,7 +137,7 @@ resource[:recurselimit] = value true - when /^\d+$/: + when /^\d+$/ self.warning "Setting recursion depth with the recurse parameter is now deprecated, please use recurselimit" value = Integer(value) @@ -141,7 +147,7 @@ resource[:recurselimit] = value true else - raise ArgumentError, "Invalid recurse value %s" % value.inspect + self.fail "Invalid recurse value #{value.inspect}" end end end @@ -154,10 +160,10 @@ munge do |value| newval = super(value) case newval - when Integer, Fixnum, Bignum: value - when /^\d+$/: Integer(value) + when Integer, Fixnum, Bignum; value + when /^\d+$/; Integer(value) else - raise ArgumentError, "Invalid recurselimit value %s" % value.inspect + self.fail "Invalid recurselimit value #{value.inspect}" end end end @@ -399,11 +405,7 @@ super - # Get rid of any duplicate slashes, and remove any trailing slashes. - @title = @title.gsub(/\/+/, "/") - - @title.sub!(/\/$/, "") unless @title == "/" - + @title = self.class.canonicalize_ref(@title) @stat = nil end @@ -494,26 +496,18 @@ # not likely to have many actual conflicts, which is good, because # this is a pretty inefficient implementation. def remove_less_specific_files(files) - # We sort the paths so we can short-circuit some tests. - mypath = self[:path] - other_paths = catalog.vertices.find_all do |r| - r.is_a?(self.class) and r[:path][0..(mypath.length - 1)] == mypath - end.collect { |r| r[:path] }.sort { |a, b| a.length <=> b.length } - [self[:path]] + mypath = self[:path].split(File::Separator) + other_paths = catalog.vertices. + select { |r| r.is_a?(self.class) and r[:path] != self[:path] }. + collect { |r| r[:path].split(File::Separator) }. + select { |p| p[0,mypath.length] == mypath } return files if other_paths.empty? - remove = [] - files.each do |file| - path = file[:path] - other_paths.each do |p| - if path[0..(p.length - 1)] == p - remove << file - break - end - end - end - - files - remove + files.reject { |file| + path = file[:path].split(File::Separator) + other_paths.any? { |p| path[0,p.length] == p } + } end # A simple method for determining whether we should be recursing. diff -Nru puppet-0.25.1/lib/puppet/type/host.rb puppet-0.25.4/lib/puppet/type/host.rb --- puppet-0.25.1/lib/puppet/type/host.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/host.rb 2010-01-29 21:32:27.000000000 +0000 @@ -13,12 +13,11 @@ end - newproperty(:alias) do - desc "Any alias the host might have. Multiple values must be - specified as an array. Note that this state has the same name - as one of the metaparams; using this state to set aliases will - make those aliases available in your Puppet scripts and also on - disk." + newproperty(:host_aliases) do + desc 'Any aliases the host might have. Multiple values must be + specified as an array. Note that this property is not the same as + the "alias" metaparam; use this property to add aliases to a host + on disk, and "alias" to aliases for use in your Puppet scripts.' def insync?(is) is == @should @@ -63,9 +62,7 @@ end validate do |value| - if value =~ /\s/ - raise Puppet::Error, "Aliases cannot include whitespace" - end + raise Puppet::Error, "Host aliases cannot include whitespace" if value =~ /\s/ end end diff -Nru puppet-0.25.1/lib/puppet/type/k5login.rb puppet-0.25.4/lib/puppet/type/k5login.rb --- puppet-0.25.1/lib/puppet/type/k5login.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/k5login.rb 2010-01-29 21:32:27.000000000 +0000 @@ -56,7 +56,7 @@ end # Return the principals - def principals + def principals(dummy_argument=:work_arround_for_ruby_GC_bug) if File.exists?(@resource[:name]) File.readlines(@resource[:name]).collect { |line| line.chomp } else diff -Nru puppet-0.25.1/lib/puppet/type/maillist.rb puppet-0.25.4/lib/puppet/type/maillist.rb --- puppet-0.25.1/lib/puppet/type/maillist.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/maillist.rb 2010-01-29 21:32:27.000000000 +0000 @@ -42,13 +42,10 @@ should = :absent end atype = Puppet::Type.type(:mailalias) - return provider.aliases.collect do |name, recipient| - if atype[name] - nil - else - malias = Puppet::Type.type(:mailalias).new(:name => name, :recipient => recipient, :ensure => should) - end - end.compact + + provider.aliases. + reject { |name,recipient| catalog.resource(:mailalias, name) }. + collect { |name,recipient| atype.new(:name => name, :recipient => recipient, :ensure => should) } end end end diff -Nru puppet-0.25.1/lib/puppet/type/port.rb puppet-0.25.4/lib/puppet/type/port.rb --- puppet-0.25.1/lib/puppet/type/port.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/port.rb 2010-01-29 21:32:27.000000000 +0000 @@ -57,11 +57,12 @@ # desc "The port description." # end # -# newproperty(:alias) do -# desc "Any aliases the port might have. Multiple values must be -# specified as an array. Note that this property has the same name as -# one of the metaparams; using this property to set aliases will make -# those aliases available in your Puppet scripts and also on disk." +# newproperty(:port_aliases) do +# desc 'Any aliases the port might have. Multiple values must be +# specified as an array. Note that this property is not the same as +# the "alias" metaparam; use this property to add aliases to a port +# in the services file, and "alias" to aliases for use in your Puppet +# scripts.' # # # We actually want to return the whole array here, not just the first # # value. diff -Nru puppet-0.25.1/lib/puppet/type/resources.rb puppet-0.25.4/lib/puppet/type/resources.rb --- puppet-0.25.1/lib/puppet/type/resources.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/resources.rb 2010-01-29 21:32:27.000000000 +0000 @@ -99,18 +99,18 @@ def generate return [] unless self.purge? resource_type.instances. - reject { |r| managed? }. - reject { |r| catalog.resources.include? r.ref }. - select { |r| check(r) }. - select { |r| able_to_ensure_absent?(r) }. - each { |resource| - @parameters.each do |name, param| - resource[name] = param.value if param.metaparam? - end - - # Mark that we're purging, so transactions can handle relationships - # correctly - resource.purging + reject { |r| catalog.resources.include? r.ref }. + select { |r| check(r) }. + select { |r| r.class.validproperty?(:ensure) }. + select { |r| able_to_ensure_absent?(r) }. + each { |resource| + @parameters.each do |name, param| + resource[name] = param.value if param.metaparam? + end + + # Mark that we're purging, so transactions can handle relationships + # correctly + resource.purging } end diff -Nru puppet-0.25.1/lib/puppet/type/service.rb puppet-0.25.4/lib/puppet/type/service.rb --- puppet-0.25.1/lib/puppet/type/service.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/service.rb 2010-01-29 21:32:27.000000000 +0000 @@ -115,20 +115,7 @@ value = [value] unless value.is_a?(Array) # LAK:NOTE See http://snurl.com/21zf8 [groups_google_com] # It affects stand-alone blocks, too. - paths = value.flatten.collect { |p| x = p.split(":") }.flatten.find_all do |path| - if FileTest.directory?(path) - true - else - if FileTest.exist?(path) and ! FileTest.directory?(path) - @resource.debug "Search path %s is not a directory" % [path] - else - @resource.debug("Search path %s does not exist" % [path]) - end - false - end - end - - paths + paths = value.flatten.collect { |p| x = p.split(":") }.flatten end defaultto { provider.class.defpath if provider.class.respond_to?(:defpath) } diff -Nru puppet-0.25.1/lib/puppet/type/sshkey.rb puppet-0.25.4/lib/puppet/type/sshkey.rb --- puppet-0.25.1/lib/puppet/type/sshkey.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/sshkey.rb 2010-01-29 21:32:27.000000000 +0000 @@ -21,11 +21,11 @@ # FIXME This should automagically check for aliases to the hosts, just # to see if we can automatically glean any aliases. - newproperty(:alias) do - desc "Any alias the host might have. Multiple values must be - specified as an array. Note that this parameter has the same name - as one of the metaparams; using this parameter to set aliases will - make those aliases available in your Puppet scripts." + newproperty(:host_aliases) do + desc 'Any aliases the host might have. Multiple values must be + specified as an array. Note that this property is not the same as + the "alias" metaparam; use this property to add aliases to a host + on disk, and "alias" to aliases for use in your Puppet scripts.' attr_accessor :meta diff -Nru puppet-0.25.1/lib/puppet/type/tidy.rb puppet-0.25.4/lib/puppet/type/tidy.rb --- puppet-0.25.1/lib/puppet/type/tidy.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/tidy.rb 2010-01-29 21:32:27.000000000 +0000 @@ -247,8 +247,15 @@ def generate return [] unless stat(self[:path]) - if self[:recurse] - files = Puppet::FileServing::Fileset.new(self[:path], :recurse => self[:recurse]).files.collect do |f| + case self[:recurse] + when Integer, Fixnum, Bignum, /^\d+$/ + parameter = { :recurse => true, :recurselimit => self[:recurse] } + when true, :true, :inf + parameter = { :recurse => true } + end + + if parameter + files = Puppet::FileServing::Fileset.new(self[:path], parameter).files.collect do |f| f == "." ? self[:path] : File.join(self[:path], f) end else diff -Nru puppet-0.25.1/lib/puppet/type/yumrepo.rb puppet-0.25.4/lib/puppet/type/yumrepo.rb --- puppet-0.25.1/lib/puppet/type/yumrepo.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type/yumrepo.rb 2010-01-29 21:32:27.000000000 +0000 @@ -233,12 +233,14 @@ end newparam(:name) do - desc "The name of the repository." + desc "The name of the repository. This corresponds to the + repositoryid parameter in yum.conf(5)." isnamevar end newproperty(:descr, :parent => Puppet::IniProperty) do desc "A human readable description of the repository. + This corresponds to the name parameter in yum.conf(5). #{ABSENT_DOC}" newvalue(:absent) { self.should = :absent } newvalue(/.*/) { } diff -Nru puppet-0.25.1/lib/puppet/type.rb puppet-0.25.4/lib/puppet/type.rb --- puppet-0.25.1/lib/puppet/type.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/type.rb 2010-01-29 21:32:27.000000000 +0000 @@ -210,8 +210,8 @@ end # Find the namevar - def self.namevar - unless defined? @namevar + def self.namevar_parameter + @namevar_parameter ||= ( params = @parameters.find_all { |param| param.isnamevar? or param.name == :name } @@ -219,12 +219,19 @@ if params.length > 1 raise Puppet::DevError, "Found multiple namevars for %s" % self.name elsif params.length == 1 - @namevar = params[0].name + params.first else raise Puppet::DevError, "No namevar for %s" % self.name end - end - @namevar + ) + end + + def self.namevar + @namevar ||= namevar_parameter.name + end + + def self.canonicalize_ref(s) + namevar_parameter.canonicalize(s) end # Create a new parameter. Requires a block and a name, stores it in the diff -Nru puppet-0.25.1/lib/puppet/util/autoload.rb puppet-0.25.4/lib/puppet/util/autoload.rb --- puppet-0.25.1/lib/puppet/util/autoload.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/autoload.rb 2010-01-29 21:32:27.000000000 +0000 @@ -86,6 +86,8 @@ name = symbolize(name) loaded name, file return true + rescue SystemExit,NoMemoryError + raise rescue Exception => detail # I have no idea what's going on here, but different versions # of ruby are raising different errors on missing files. @@ -123,6 +125,8 @@ begin Kernel.require file loaded(name, file) + rescue SystemExit,NoMemoryError + raise rescue Exception => detail if Puppet[:trace] puts detail.backtrace diff -Nru puppet-0.25.1/lib/puppet/util/backups.rb puppet-0.25.4/lib/puppet/util/backups.rb --- puppet-0.25.1/lib/puppet/util/backups.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/backups.rb 2010-01-29 21:32:27.000000000 +0000 @@ -26,8 +26,9 @@ info "Recursively backing up to filebucket" Find.find(self[:path]) { |f| backup_file_with_filebucket(f) if File.file?(f) } when "file"; backup_file_with_filebucket(file) - when "link"; return true + when "link"; end + true end def perform_backup_with_backuplocal(fileobj, backup) diff -Nru puppet-0.25.1/lib/puppet/util/feature.rb puppet-0.25.4/lib/puppet/util/feature.rb --- puppet-0.25.1/lib/puppet/util/feature.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/feature.rb 2010-01-29 21:32:27.000000000 +0000 @@ -83,6 +83,8 @@ begin require lib + rescue SystemExit,NoMemoryError + raise rescue Exception Puppet.debug "Failed to load library '%s' for feature '%s'" % [lib, name] return false diff -Nru puppet-0.25.1/lib/puppet/util/filetype.rb puppet-0.25.4/lib/puppet/util/filetype.rb --- puppet-0.25.1/lib/puppet/util/filetype.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/filetype.rb 2010-01-29 21:32:27.000000000 +0000 @@ -251,4 +251,50 @@ output_file.delete end end + + # Support for AIX crontab with output different than suntab's crontab command. + newfiletype(:aixtab) do + # Read a specific @path's cron tab. + def read + begin + output = Puppet::Util.execute(%w{crontab -l}, :uid => @path) + if output.include?("You are not authorized to use the cron command") + raise Puppet::Error, "User %s not authorized to use cron" % @path + end + return output + rescue => detail + raise Puppet::Error, "Could not read crontab for %s: %s" % [@path, detail] + end + end + + # Remove a specific @path's cron tab. + def remove + begin + Puppet::Util.execute(%w{crontab -r}, :uid => @path) + rescue => detail + raise Puppet::Error, "Could not remove crontab for %s: %s" % [@path, detail] + end + end + + # Overwrite a specific @path's cron tab; must be passed the @path name + # and the text with which to create the cron tab. + def write(text) + require "tempfile" + output_file = Tempfile.new("puppet") + fh = output_file.open + fh.print text + fh.close + + # We have to chown the stupid file to the user. + File.chown(Puppet::Util.uid(@path), nil, output_file.path) + + begin + Puppet::Util.execute(["crontab", output_file.path], :uid => @path) + rescue => detail + raise Puppet::Error, "Could not write crontab for %s: %s" % [@path, detail] + ensure + output_file.delete + end + end + end end diff -Nru puppet-0.25.1/lib/puppet/util/log_paths.rb puppet-0.25.4/lib/puppet/util/log_paths.rb --- puppet-0.25.1/lib/puppet/util/log_paths.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/log_paths.rb 2010-01-29 21:32:27.000000000 +0000 @@ -11,5 +11,19 @@ return "/" + @path.join("/") end + + def source_descriptors + descriptors = {} + + descriptors[:tags] = tags + + [:path, :file, :line, :version].each do |param| + next unless value = send(param) + descriptors[param] = value + end + + return descriptors + end + end diff -Nru puppet-0.25.1/lib/puppet/util/log.rb puppet-0.25.4/lib/puppet/util/log.rb --- puppet-0.25.1/lib/puppet/util/log.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/log.rb 2010-01-29 21:32:27.000000000 +0000 @@ -511,11 +511,16 @@ # If they pass a source in to us, we make sure it is a string, and # we retrieve any tags we can. def source=(source) - # We can't store the actual source, we just store the path. - # We can't just check for whether it responds to :path, because - # plenty of providers respond to that in their normal function. - if (source.is_a?(Puppet::Type) or source.is_a?(Puppet::Parameter)) and source.respond_to?(:path) - set_source_from_ral(source) + if source.respond_to?(:source_descriptors) + descriptors = source.source_descriptors + @source = descriptors[:path] + + descriptors[:tags].each { |t| tag(t) } + + [:file, :line, :version].each do |param| + next unless descriptors[param] + send(param.to_s + "=", descriptors[param]) + end else @source = source.to_s end @@ -528,19 +533,6 @@ def to_s return @message end - - private - - def set_source_from_ral(source) - @source = source.path - - source.tags.each { |t| tag(t) } - - [:file, :line, :version].each do |param| - next unless value = source.send(param) - send(param.to_s + "=", value) - end - end end # This is for backward compatibility from when we changed the constant to Puppet::Util::Log diff -Nru puppet-0.25.1/lib/puppet/util/methodhelper.rb puppet-0.25.4/lib/puppet/util/methodhelper.rb --- puppet-0.25.1/lib/puppet/util/methodhelper.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/methodhelper.rb 2010-01-29 21:32:27.000000000 +0000 @@ -12,11 +12,10 @@ def set_options(options) options.each do |param,value| method = param.to_s + "=" - begin + if respond_to? method self.send(method, value) - rescue NoMethodError - raise ArgumentError, "Invalid parameter %s to object class %s" % - [param,self.class.to_s] + else + raise ArgumentError, "Invalid parameter #{param} to object class #{self.class}" end end end diff -Nru puppet-0.25.1/lib/puppet/util/monkey_patches.rb puppet-0.25.4/lib/puppet/util/monkey_patches.rb --- puppet-0.25.1/lib/puppet/util/monkey_patches.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/monkey_patches.rb 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,8 @@ +module RDoc + def self.caller(skip=nil) + in_gem_wrapper = false + Kernel.caller.reject { |call| + in_gem_wrapper ||= call =~ /#{Regexp.escape $0}:\d+:in `load'/ + } + end +end diff -Nru puppet-0.25.1/lib/puppet/util/rdoc/generators/puppet_generator.rb puppet-0.25.4/lib/puppet/util/rdoc/generators/puppet_generator.rb --- puppet-0.25.1/lib/puppet/util/rdoc/generators/puppet_generator.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/rdoc/generators/puppet_generator.rb 2010-01-29 21:32:27.000000000 +0000 @@ -1,5 +1,7 @@ require 'rdoc/generators/html_generator' require 'puppet/util/rdoc/code_objects' +require 'digest/md5' + module Generators # This module holds all the classes needed to generate the HTML documentation @@ -335,7 +337,7 @@ resources.each do |r| res << { "name" => CGI.escapeHTML(r.name), - "aref" => "#{path_prefix}\##{r.aref}" + "aref" => CGI.escape(path_prefix)+"\#"+CGI.escape(r.aref) } end res @@ -414,7 +416,7 @@ if path['<<'] path.gsub!(/<<\s*(\w*)/) { "from-#$1" } end - File.join(prefix, path.split("::")) + ".html" + File.join(prefix, path.split("::").collect { |p| Digest::MD5.hexdigest(p) }) + ".html" end def parent_name @@ -508,7 +510,7 @@ h_name = CGI.escapeHTML(name) @values["classmod"] = "Node" - @values["title"] = "#{@values['classmod']}: #{h_name}" + @values["title"] = CGI.escapeHTML("#{@values['classmod']}: #{h_name}") c = @context c = c.parent while c and !c.diagram diff -Nru puppet-0.25.1/lib/puppet/util/rdoc/parser.rb puppet-0.25.4/lib/puppet/util/rdoc/parser.rb --- puppet-0.25.1/lib/puppet/util/rdoc/parser.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/rdoc/parser.rb 2010-01-29 21:32:27.000000000 +0000 @@ -148,6 +148,7 @@ # create documentation for include statements we can find in +code+ # and associate it with +container+ def scan_for_include(container, code) + code = [code] unless code.is_a?(Array) code.each do |stmt| scan_for_include(container,stmt.children) if stmt.is_a?(Puppet::Parser::AST::ASTArray) @@ -163,6 +164,7 @@ # create documentation for global variables assignements we can find in +code+ # and associate it with +container+ def scan_for_vardef(container, code) + code = [code] unless code.is_a?(Array) code.each do |stmt| scan_for_vardef(container,stmt.children) if stmt.is_a?(Puppet::Parser::AST::ASTArray) @@ -176,24 +178,29 @@ # create documentation for resources we can find in +code+ # and associate it with +container+ def scan_for_resource(container, code) + code = [code] unless code.is_a?(Array) code.each do |stmt| scan_for_resource(container,stmt.children) if stmt.is_a?(Puppet::Parser::AST::ASTArray) if stmt.is_a?(Puppet::Parser::AST::Resource) and !stmt.type.nil? - type = stmt.type.split("::").collect { |s| s.capitalize }.join("::") - title = stmt.title.is_a?(Puppet::Parser::AST::ASTArray) ? stmt.title.to_s.gsub(/\[(.*)\]/,'\1') : stmt.title.to_s - Puppet.debug "rdoc: found resource: %s[%s]" % [type,title] - - param = [] - stmt.params.children.each do |p| - res = {} - res["name"] = p.param - res["value"] = "#{p.value.to_s}" unless p.value.nil? - - param << res + begin + type = stmt.type.split("::").collect { |s| s.capitalize }.join("::") + title = stmt.title.is_a?(Puppet::Parser::AST::ASTArray) ? stmt.title.to_s.gsub(/\[(.*)\]/,'\1') : stmt.title.to_s + Puppet.debug "rdoc: found resource: %s[%s]" % [type,title] + + param = [] + stmt.params.children.each do |p| + res = {} + res["name"] = p.param + res["value"] = "#{p.value.to_s}" unless p.value.nil? + + param << res + end + + container.add_resource(PuppetResource.new(type, title, stmt.doc, param)) + rescue => detail + raise Puppet::ParseError, "impossible to parse resource in #{stmt.file} at line #{stmt.line}: #{detail}" end - - container.add_resource(PuppetResource.new(type, title, stmt.doc, param)) end end end @@ -225,6 +232,8 @@ end cls.comment = comment + rescue => detail + raise Puppet::ParseError, "impossible to parse class '#{name}' in #{klass.file} at line #{klass.line}: #{detail}" end # create documentation for a node @@ -247,6 +256,8 @@ end n.comment = comment + rescue => detail + raise Puppet::ParseError, "impossible to parse node '#{name}' in #{node.file} at line #{node.line}: #{detail}" end # create documentation for a define @@ -263,12 +274,15 @@ declaration = "" define.arguments.each do |arg,value| declaration << "\$#{arg}" - if !value.nil? + unless value.nil? declaration << " => " - if !value.is_a?(Puppet::Parser::AST::ASTArray) + case value + when Puppet::Parser::AST::Leaf declaration << "'#{value.value}'" - else + when Puppet::Parser::AST::ASTArray declaration << "[%s]" % value.children.collect { |v| "'#{v}'" }.join(", ") + else + declaration << "#{value.to_s}" end end declaration << ", " @@ -284,6 +298,8 @@ meth.visibility = :public meth.document_self = true meth.singleton = false + rescue => detail + raise Puppet::ParseError, "impossible to parse definition '#{name}' in #{define.file} at line #{define.line}: #{detail}" end # Traverse the AST tree and produce code-objects node diff -Nru puppet-0.25.1/lib/puppet/util/reference.rb puppet-0.25.4/lib/puppet/util/reference.rb --- puppet-0.25.1/lib/puppet/util/reference.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/reference.rb 2010-01-29 21:32:27.000000000 +0000 @@ -36,7 +36,7 @@ def self.pdf(text) puts "creating pdf" - File.open("/tmp/puppetdoc.txt", "w") do |f| + Puppet::Util.secure_open("/tmp/puppetdoc.txt", "w") do |f| f.puts text end rst2latex = %x{which rst2latex} @@ -48,6 +48,9 @@ end rst2latex.chomp! cmd = %{#{rst2latex} /tmp/puppetdoc.txt > /tmp/puppetdoc.tex} + Puppet::Util.secure_open("/tmp/puppetdoc.tex","w") do |f| + # If we get here without an error, /tmp/puppetdoc.tex isn't a tricky cracker's symlink + end output = %x{#{cmd}} unless $? == 0 $stderr.puts "rst2latex failed" @@ -67,7 +70,7 @@ puts "Creating markdown for #{name} reference." dir = "/tmp/" + Puppet::PUPPETVERSION FileUtils.mkdir(dir) unless File.directory?(dir) - File.open(dir + "/" + "#{name}.rst", "w") do |f| + Puppet::Util.secure_open(dir + "/" + "#{name}.rst", "w") do |f| f.puts text end pandoc = %x{which pandoc} @@ -190,7 +193,7 @@ end def trac - File.open("/tmp/puppetdoc.txt", "w") do |f| + Puppet::Util.secure_open("/tmp/puppetdoc.txt", "w") do |f| f.puts self.to_trac end diff -Nru puppet-0.25.1/lib/puppet/util/selinux.rb puppet-0.25.4/lib/puppet/util/selinux.rb --- puppet-0.25.1/lib/puppet/util/selinux.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/selinux.rb 2010-01-29 21:32:27.000000000 +0000 @@ -7,11 +7,9 @@ # was abysmal. At this time (2008-11-02) the only distribution providing # these Ruby SELinux bindings which I am aware of is Fedora (in libselinux-ruby). -begin - require 'selinux' -rescue LoadError - # Nothing -end +Puppet.features.selinux? # check, but continue even if it's not + +require 'pathname' module Puppet::Util::SELinux @@ -71,7 +69,7 @@ if context.nil? or context == "unlabeled" return nil end - unless context =~ /^([a-z0-9_]+):([a-z0-9_]+):([a-z0-9_]+)(?::([a-zA-Z0-9:,._-]+))?/ + unless context =~ /^([a-z0-9_]+):([a-z0-9_]+):([a-zA-Z0-9_]+)(?::([a-zA-Z0-9:,._-]+))?/ raise Puppet::Error, "Invalid context to parse: #{context}" end ret = { @@ -91,7 +89,7 @@ # I believe that the OS should always provide at least a fall-through context # though on any well-running system. def set_selinux_context(file, value, component = false) - unless selinux_support? + unless selinux_support? && selinux_label_support?(file) return nil end @@ -168,8 +166,8 @@ # that's expected rescue return nil - ensure - mountfh.close + ensure + mountfh.close if mountfh end mntpoint = {} @@ -185,9 +183,19 @@ return mntpoint end + def realpath(path) + path, rest = Pathname.new(path), [] + path, rest = path.dirname, [path.basename] + rest while ! path.exist? + File.join( path.realpath, *rest ) + end + + def parent_directory(path) + Pathname.new(path).dirname.to_s + end + # Internal helper function to return which type of filesystem a # given file path resides on - def find_fs(file) + def find_fs(path) unless mnts = read_mounts() return nil end @@ -198,13 +206,12 @@ # Just in case: return something if you're down to "/" or "" # Remove the last slash and everything after it, # and repeat with that as the file for the next loop through. - ary = file.split('/') - while not ary.empty? do - path = ary.join('/') + path = realpath(path) + while not path.empty? do if mnts.has_key?(path) return mnts[path] end - ary.pop + path = parent_directory(path) end return mnts['/'] end diff -Nru puppet-0.25.1/lib/puppet/util/settings/file_setting.rb puppet-0.25.4/lib/puppet/util/settings/file_setting.rb --- puppet-0.25.1/lib/puppet/util/settings/file_setting.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/settings/file_setting.rb 2010-01-29 21:32:27.000000000 +0000 @@ -89,11 +89,14 @@ return nil if path =~ /^\/dev/ resource = Puppet::Resource.new(:file, path) - resource[:mode] = self.mode if self.mode - if Puppet.features.root? - resource[:owner] = self.owner if self.owner - resource[:group] = self.group if self.group + if Puppet[:manage_internal_file_permissions] + resource[:mode] = self.mode if self.mode + + if Puppet.features.root? + resource[:owner] = self.owner if self.owner + resource[:group] = self.group if self.group + end end resource[:ensure] = type diff -Nru puppet-0.25.1/lib/puppet/util/settings.rb puppet-0.25.4/lib/puppet/util/settings.rb --- puppet-0.25.1/lib/puppet/util/settings.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/settings.rb 2010-01-29 21:32:27.000000000 +0000 @@ -64,20 +64,25 @@ # Remove all set values, potentially skipping cli values. def clear(exceptcli = false) @sync.synchronize do - @values.each do |name, values| - @values.delete(name) unless exceptcli and name == :cli - end + unsafe_clear(exceptcli) + end + end + + # Remove all set values, potentially skipping cli values. + def unsafe_clear(exceptcli = false) + @values.each do |name, values| + @values.delete(name) unless exceptcli and name == :cli + end - # Don't clear the 'used' in this case, since it's a config file reparse, - # and we want to retain this info. - unless exceptcli - @used = [] - end + # Don't clear the 'used' in this case, since it's a config file reparse, + # and we want to retain this info. + unless exceptcli + @used = [] + end - @cache.clear + @cache.clear - @name = nil - end + @name = nil end # This is mostly just used for testing. @@ -317,23 +322,25 @@ # and reparsed if necessary. set_filetimeout_timer() - # Retrieve the value now, so that we don't lose it in the 'clear' call. - file = self[:config] - - return unless FileTest.exist?(file) - - # We have to clear outside of the sync, because it's - # also using synchronize(). - clear(true) - @sync.synchronize do - unsafe_parse(file) + unsafe_parse(self[:config]) end end # Unsafely parse the file -- this isn't thread-safe and causes plenty of problems if used directly. def unsafe_parse(file) - parse_file(file).each do |area, values| + return unless FileTest.exist?(file) + begin + data = parse_file(file) + rescue => details + puts details.backtrace if Puppet[:trace] + Puppet.err "Could not parse #{file}: #{details}" + return + end + + unsafe_clear(true) + + data.each do |area, values| @values[area] = values end @@ -425,9 +432,7 @@ def reparse if file and file.changed? Puppet.notice "Reparsing %s" % file.file - @sync.synchronize do - parse - end + parse reuse() end end diff -Nru puppet-0.25.1/lib/puppet/util/subclass_loader.rb puppet-0.25.4/lib/puppet/util/subclass_loader.rb --- puppet-0.25.1/lib/puppet/util/subclass_loader.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/subclass_loader.rb 2010-01-29 21:32:27.000000000 +0000 @@ -72,7 +72,7 @@ end # Retrieve or calculate a name. - def name + def name(dummy_argument=:work_arround_for_ruby_GC_bug) unless defined? @name @name = self.to_s.sub(/.+::/, '').intern end diff -Nru puppet-0.25.1/lib/puppet/util/tagging.rb puppet-0.25.4/lib/puppet/util/tagging.rb --- puppet-0.25.1/lib/puppet/util/tagging.rb 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util/tagging.rb 2010-01-29 21:32:27.000000000 +0000 @@ -20,8 +20,8 @@ end # Are we tagged with the provided tag? - def tagged?(tag) - defined?(@tags) and @tags.include?(tag.to_s) + def tagged?(*tags) + not ( self.tags & tags.flatten.collect { |t| t.to_s } ).empty? end # Return a copy of the tag list, so someone can't ask for our tags diff -Nru puppet-0.25.1/lib/puppet/util.rb puppet-0.25.4/lib/puppet/util.rb --- puppet-0.25.1/lib/puppet/util.rb 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/lib/puppet/util.rb 2010-01-29 21:32:27.000000000 +0000 @@ -422,6 +422,28 @@ end module_function :memory, :thinmark + + def secure_open(file,must_be_w,&block) + raise Puppet::DevError,"secure_open only works with mode 'w'" unless must_be_w == 'w' + raise Puppet::DevError,"secure_open only requires a block" unless block_given? + Puppet.warning "#{file} was a symlink to #{File.readlink(file)}" if File.symlink?(file) + if File.exists?(file) or File.symlink?(file) + wait = File.symlink?(file) ? 5.0 : 0.1 + File.delete(file) + sleep wait # give it a chance to reappear, just in case someone is actively trying something. + end + begin + File.open(file,File::CREAT|File::EXCL|File::TRUNC|File::WRONLY,&block) + rescue Errno::EEXIST + desc = File.symlink?(file) ? "symlink to #{File.readlink(file)}" : File.stat(file).ftype + puts "Warning: #{file} was apparently created by another process (as" + puts "a #{desc}) as soon as it was deleted by this process. Someone may be trying" + puts "to do something objectionable (such as tricking you into overwriting system" + puts "files if you are running as root)." + raise + end + end + module_function :secure_open end end diff -Nru puppet-0.25.1/lib/puppet.rb puppet-0.25.4/lib/puppet.rb --- puppet-0.25.1/lib/puppet.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/lib/puppet.rb 2010-01-29 21:32:27.000000000 +0000 @@ -24,7 +24,7 @@ # it's also a place to find top-level commands like 'debug' module Puppet - PUPPETVERSION = '0.25.1' + PUPPETVERSION = '0.25.4' def Puppet.version return PUPPETVERSION diff -Nru puppet-0.25.1/man/man8/filebucket.8 puppet-0.25.4/man/man8/filebucket.8 --- puppet-0.25.1/man/man8/filebucket.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/filebucket.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. .SH SYNOPSIS @@ -9,16 +8,18 @@ .SH USAGE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 .TP .B filebucket [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-l|\-\-local] [\-r|\-\-remote] [\-s|\-\-server ] [\-b|\-\-bucket ] ... - -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION This is a stand\-alone filebucket client for sending files to a local or @@ -28,6 +29,7 @@ .SH USAGE This client can operate in three modes, with only one mode per call: +.INDENT 0.0 .TP .B backup: Send one or more files to the specified file bucket. Each sent @@ -45,6 +47,7 @@ entirely new path to this argument; you are not restricted to restoring the content to its original location. +.UNINDENT Note that +filebucket+ defaults to using a network\-based filebucket available on the server named +puppet+. To use this, you\'ll have to be running as a user with valid Puppet certificates. Alternatively, you can @@ -52,15 +55,15 @@ .SH EXAMPLE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 $ filebucket backup /etc/passwd /etc/passwd: 429b225650b912a2ee067b0a4cf1e949 $ filebucket restore /tmp/passwd 429b225650b912a2ee067b0a4cf1e949 $ - -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH OPTIONS Note that any configuration parameter that\'s valid in the configuration @@ -69,8 +72,8 @@ argument. See the configuration file documentation at -http://reductivelabs.com/projects/puppet/reference/configref.html for -the full list of acceptable parameters. A commented list of all +\fI\%http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference\fP for the +full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'. @@ -78,6 +81,7 @@ help: Print this help message +.INDENT 0.0 .TP .B local: Use the local filebucket. This will use the default @@ -88,6 +92,7 @@ .B remote: Use a remote filebucket. This will use the default configuration information. +.UNINDENT server: The server to send the file to, instead of locally. verbose: Print extra information. @@ -96,12 +101,12 @@ .SH EXAMPLE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 filebucket \-b /tmp/filebucket /my/file - -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH AUTHOR Luke Kanies @@ -112,5 +117,5 @@ License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:24. +.\" diff -Nru puppet-0.25.1/man/man8/pi.8 puppet-0.25.4/man/man8/pi.8 --- puppet-0.25.1/man/man8/pi.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/pi.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,34 +1,56 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. -.TP -.B bin/pi [options] [type] +.SH SYNOPSIS +Print help about puppet types on the console. Run with \'\-h\' to get +detailed help. + + +.SH USAGE +.INDENT 0.0 +.INDENT 3.5 +pi [\-h|\-\-help] [\-s|\-\-short] [\-p|\-\-providers] [\-l|\-\-list] [\-m|\-\-meta] + +.UNINDENT +.UNINDENT + +.SH DESCRIPTION +Prints details of Puppet types, providers and metaparameters on the +console. + + +.SH OPTIONS +help: Print this help text + +providers: Describe providers in detail for each type + +list: List all types -.TP -.B Print documentation for puppet types and their parameters +meta: List all metaparameters -.TP -.B \-l , \-\-list -List all types +short: List only parameters without detail -.TP -.B \-p , \-\-providers -Describe providers in detail +.SH EXAMPLE +.INDENT 0.0 +.INDENT 3.5 +pi \-\-list +pi file \-\-providers +pi user \-s \-m +.UNINDENT +.UNINDENT -.TP -.B \-s , \-\-short -Only list parameters without detail +.SH AUTHOR +David Lutterkort -.TP -.B \-m , \-\-meta -Include metaparams +.SH COPYRIGHT +Copyright (c) 2005 Reductive Labs, LLC Licensed under the GNU Public +License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:24. +.\" diff -Nru puppet-0.25.1/man/man8/puppet.8 puppet-0.25.4/man/man8/puppet.8 --- puppet-0.25.1/man/man8/puppet.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/puppet.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,28 +1,29 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. .SH SYNOPSIS -Run a stand\-alone +puppet+ script. +Run a stand\-alone +puppet+ manifest. .SH USAGE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 .TP -.B puppet [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] -[\-l|\-\-logdest ] - +.B puppet [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-e|\-\-execute] +[\-\-detailed\-exitcodes] [\-l|\-\-logdest ] -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION -This is the standalone puppet execution script; use it to execute -individual scripts that you write. If you need to execute site\-wide -scripts, use +puppetd+ and +puppetmasterd+. +This is the standalone puppet execution tool; use it to execute +individual manifests that you write. If you need to execute site\-wide +manifests, use +puppetd+ and +puppetmasterd+. .SH OPTIONS @@ -32,46 +33,60 @@ argument. See the configuration file documentation at -http://reductivelabs.com/projects/puppet/reference/configref.html for -the full list of acceptable parameters. A commented list of all +\fI\%http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference\fP for the +full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'. -debug: Enable full debugging. - -help: Print this help message +debug: Enable full debugging. +.INDENT 0.0 .TP -.B loadclasses: Load any stored classes. +puppetd+ caches configured -classes (usually at /etc/puppet/classes.txt), and setting -this option causes all of those classes to be set in your -+puppet+ manifest. +.B detailed\-exitcodes: Provide transaction information via exit codes. If +this is enabled, an exit code of \'2\' means there +were changes, and an exit code of \'4\' means that +there were failures during the transaction. + +.UNINDENT +help: Print this help message +.INDENT 0.0 .TP -.B logdest: Where to send messages. Choose between syslog, the console, -and a log file. Defaults to sending messages to the -console. +.B loadclasses: Load any stored classes. +puppetd+ caches configured +classes (usually at /etc/puppet/classes.txt), and +setting this option causes all of those classes to +be set in your +puppet+ manifest. -verbose: Print extra information. +.TP +.B logdest: Where to send messages. Choose between syslog, the +console, and a log file. Defaults to sending +messages to the console. -.SH EXAMPLE +.UNINDENT +execute: Execute a specific piece of Puppet code + +verbose: Print extra information. -.\" visit_block_quote -puppet \-l /tmp/script.log script.pp +.SH EXAMPLE +.INDENT 0.0 +.INDENT 3.5 +puppet \-l /tmp/manifest.log manifest.pp -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH AUTHOR Luke Kanies -.\" Generated by docutils manpage writer on 2008-01-20 10:28. + + .SH COPYRIGHT Copyright (c) 2005 Reductive Labs, LLC Licensed under the GNU Public License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:24. +.\" diff -Nru puppet-0.25.1/man/man8/puppetca.8 puppet-0.25.4/man/man8/puppetca.8 --- puppet-0.25.1/man/man8/puppetca.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/puppetca.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. .SH SYNOPSIS @@ -10,16 +9,18 @@ .SH USAGE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 .TP .B puppetca [\-h|\-\-help] [\-V|\-\-version] [\-d|\-\-debug] [\-v|\-\-verbose] [\-g|\-\-generate] [\-l|\-\-list] [\-s|\-\-sign] [\-r|\-\-revoke] [\-p|\-\-print] [\-c|\-\-clean] [\-\-verify] [host] - -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION Because the puppetmasterd daemon defaults to not signing client @@ -35,11 +36,12 @@ argument. See the configuration file documentation at -http://reductivelabs.com/projects/puppet/reference/configref.html for +\fI\%http://reductivelabs.com/projects/puppet/reference/configref.html\fP for the full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppetca with \'\-\-genconfig\'. +.INDENT 0.0 .TP .B all: Operate on all items. Currently only makes sense with @@ -55,24 +57,31 @@ then all host certificates, both signed and unsigned, will be removed. +.UNINDENT debug: Enable full debugging. +.INDENT 0.0 .TP .B generate: Generate a certificate for a named client. A certificate/keypair will be generated for each client named on the command line. +.UNINDENT help: Print this help message +.INDENT 0.0 .TP .B list: List outstanding certificate requests. If \'\-\-all\' is specified, signed certificates are also listed, prefixed by -\'+\'. +\'+\', and revoked or invalid certificates are prefixed by \'\-\' +(the verification outcome is printed in parenthesis). +.UNINDENT print: Print the full\-text version of a host\'s certificate. +.INDENT 0.0 .TP .B revoke: Revoke the certificate of a client. The certificate can be @@ -88,6 +97,7 @@ .B sign: Sign an outstanding certificate request. Unless \'\-\-all\' is specified, hosts must be listed after all flags. +.UNINDENT verbose: Enable verbosity. version: Print the puppet version number and exit. @@ -96,14 +106,14 @@ .SH EXAMPLE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 $ puppetca \-l culain.madstop.com $ puppetca \-s culain.madstop.com - -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH AUTHOR Luke Kanies @@ -114,5 +124,5 @@ License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:31. +.\" diff -Nru puppet-0.25.1/man/man8/puppet.conf.8 puppet-0.25.4/man/man8/puppet.conf.8 --- puppet-0.25.1/man/man8/puppet.conf.8 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/man/man8/puppet.conf.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,53 +1,30 @@ .TH Configuration Reference "" "" "" .SH NAME -Configuration Reference \- - +Configuration Reference \- .\" Man page generated from reStructeredText. -This page is autogenerated; any changes will get overwritten -.I (last generated on Mon May 05 09:33:01 +1000 2008) - +\fPThis page is autogenerated; any changes will get overwritten\fP \fI(last generated on Wed Dec 30 19:31:12 \-0500 2009)\fP .\" topic: Contents -.\" +.\" .\" Specifying Configuration Parameters -.\" +.\" .\" Signals -.\" +.\" .\" Configuration Parameter Reference .SH Specifying Configuration Parameters .SS On The Command\-Line -Every Puppet executable (with the exception of -.\" visit_literal -puppetdoc -.\" depart_literal -) accepts all of +Every Puppet executable (with the exception of \fBpuppetdoc\fP) accepts all of the parameters below, but not all of the arguments make sense for every executable. -Each parameter has a section listed with it in parentheses; often, that section -will map to an executable (e.g., -.\" visit_literal -puppetd -.\" depart_literal -), in which case it probably only -makes sense for that one executable. If -.\" visit_literal -main -.\" depart_literal - is listed as the section, -it is most likely an option that is valid for everyone. I have tried to be as thorough as possible in the descriptions of the arguments, so it should be obvious whether an argument is appropriate or not. These parameters can be supplied to the executables either as command\-line options or in the configuration file. For instance, the command\-line -invocation below would set the configuration directory to -.\" visit_literal -/private/puppet -.\" depart_literal -: +invocation below would set the configuration directory to \fB/private/puppet\fP: .nf @@ -69,72 +46,24 @@ .SS Configuration Files As mentioned above, the configuration parameters can also be stored in a configuration file, located in the configuration directory. As root, the -default configuration directory is -.\" visit_literal -/etc/puppet -.\" depart_literal -, and as a regular user, the -default configuration directory is -.\" visit_literal -~user/.puppet -.\" depart_literal -. As of 0.23.0, all -executables look for -.\" visit_literal -puppet.conf -.\" depart_literal - in their configuration directory +default configuration directory is \fB/etc/puppet\fP, and as a regular user, the +default configuration directory is \fB~user/.puppet\fP. As of 0.23.0, all +executables look for \fBpuppet.conf\fP in their configuration directory (although they previously looked for separate files). For example, +\fBpuppet.conf\fP is located at \fB/etc/puppet/puppet.conf\fP as root and +\fB~user/.puppet/puppet.conf\fP as a regular user by default. -.\" visit_literal -puppet.conf -.\" depart_literal - is located at -.\" visit_literal -/etc/puppet/puppet.conf -.\" depart_literal - as root and - -.\" visit_literal -~user/.puppet/puppet.conf -.\" depart_literal - as a regular user by default. - -All executables will set any parameters set within the -.\" visit_literal -main -.\" depart_literal - section, +All executables will set any parameters set within the \fBmain\fP section, while each executable will also look for a section named for the executable -and load those parameters. For example, -.\" visit_literal -puppetd -.\" depart_literal - will look for a -section named -.\" visit_literal -puppetd -.\" depart_literal -, and -.\" visit_literal -puppetmasterd -.\" depart_literal - looks for a section -named -.\" visit_literal -puppetmasterd -.\" depart_literal -. This allows you to use a single configuration file +and load those parameters. For example, \fBpuppetd\fP will look for a +section named \fBpuppetd\fP, and \fBpuppetmasterd\fP looks for a section +named \fBpuppetmasterd\fP. This allows you to use a single configuration file to customize the settings for all of your executables. .SS File Format The file follows INI\-style formatting. Here is an example of a very simple - -.\" visit_literal -puppet.conf -.\" depart_literal - file: +\fBpuppet.conf\fP file: .nf @@ -142,12 +71,8 @@ confdir = /private/puppet storeconfigs = true .fi -Note that boolean parameters must be explicitly specified as -.I true - or - -.I false - as seen above. +Note that boolean parameters must be explicitly specified as \fItrue\fP or +\fIfalse\fP as seen above. If you need to change file parameters (e.g., reset the mode or owner), do so within curly braces on the same line: @@ -159,9 +84,7 @@ .fi If you\'re starting out with a fresh configuration, you may wish to let the executable generate a template configuration file for you by invoking -the executable in question with the -.I \-\-genconfig - command. The executable +the executable in question with the \fI\-\-genconfig\fP command. The executable will print a template configuration to standard output, which can be redirected to a file like so: @@ -170,19 +93,10 @@ $ puppetd \-\-genconfig > /etc/puppet/puppet.conf .fi Note that this invocation will replace the contents of any pre\-existing - -.I puppet.conf - file, so make a backup of your present config if it contains +\fIpuppet.conf\fP file, so make a backup of your present config if it contains valuable information. -All parameters will be under a single section heading matching the name of -the process used to generate the configuraiton (\'puppetd\', in this case). - -Like the -.I \-\-genconfig - argument, the executables also accept a -.I \-\-genmanifest - +Like the \fI\-\-genconfig\fP argument, the executables also accept a \fI\-\-genmanifest\fP argument, which will generate a manifest that can be used to manage all of Puppet\'s directories and files and prints it to standard output. This can likewise be redirected to a file: @@ -191,16 +105,8 @@ .nf $ puppetd \-\-genmanifest > /etc/puppet/manifests/site.pp .fi -Puppet can also create user and group accounts for itself (one -.I puppet - group -and one -.I puppet - user) if it is invoked as -.I root - with the -.I \-\-mkusers - argument: +Puppet can also create user and group accounts for itself (one \fIpuppet\fP group +and one \fIpuppet\fP user) if it is invoked as \fIroot\fP with the \fI\-\-mkusers\fP argument: .nf @@ -208,54 +114,14 @@ .fi .SH Signals -The -.\" visit_literal -puppetd -.\" depart_literal - and -.\" visit_literal -puppetmasterd -.\" depart_literal - executables catch some signals for special -handling. Both daemons catch ( -.\" visit_literal -SIGHUP -.\" depart_literal -), which forces the server to restart -tself. Predictably, interrupt and terminate ( -.\" visit_literal -SIGINT -.\" depart_literal - and -.\" visit_literal -SIGHUP -.\" depart_literal -) will shut -down the server, whether it be an instance of -.\" visit_literal -puppetd -.\" depart_literal - or -.\" visit_literal -puppetmasterd -.\" depart_literal -. - -Sending the -.\" visit_literal -SIGUSR1 -.\" depart_literal - signal to an instance of -.\" visit_literal -puppetd -.\" depart_literal - will cause it to +The \fBpuppetd\fP and \fBpuppetmasterd\fP executables catch some signals for special +handling. Both daemons catch (\fBSIGHUP\fP), which forces the server to restart +tself. Predictably, interrupt and terminate (\fBSIGINT\fP and \fBSIGTERM\fP) will shut +down the server, whether it be an instance of \fBpuppetd\fP or \fBpuppetmasterd\fP. + +Sending the \fBSIGUSR1\fP signal to an instance of \fBpuppetd\fP will cause it to immediately begin a new configuration transaction with the server. This -signal has no effect on -.\" visit_literal -puppetmasterd -.\" depart_literal -. +signal has no effect on \fBpuppetmasterd\fP. .SH Configuration Parameter Reference @@ -263,192 +129,217 @@ Puppet executables, but the executables will ignore any inappropriate values. +.SS async_storeconfigs +Whether to use a queueing system to provide asynchronous database integration. Requires that \fBpuppetqd\fP be running and that \'PSON\' support for ruby be installed. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: false + +.UNINDENT + .SS authconfig -The configuration file that defines the rights to the different namespaces and methods. This can be used as a coarse\-grained authorization system for both -.\" visit_literal -puppetd -.\" depart_literal - and -.\" visit_literal -puppetmasterd -.\" depart_literal -. +The configuration file that defines the rights to the different namespaces and methods. This can be used as a coarse\-grained authorization system for both \fBpuppetd\fP and \fBpuppetmasterd\fP. +.INDENT 0.0 -.TP 2 -\(bu -Default: $confdir/namespaceauth.conf +.IP \(bu 2 +\fPDefault\fP: $confdir/namespaceauth.conf +.UNINDENT .SS autoflush Whether log files should always flush to disk. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS autosign Whether to enable autosign. Valid values are true (which autosigns any key request, and is a very bad idea), false (which never autosigns any key request), and the path to a file, which uses that configuration file to determine which keys to sign. +.INDENT 0.0 -.TP 2 -\(bu -Default: $confdir/autosign.conf +.IP \(bu 2 +\fPDefault\fP: $confdir/autosign.conf +.UNINDENT .SS bindaddress -The address to bind to. Mongrel servers default to 127.0.0.1 and WEBrick defaults to 0.0.0.0. +The address a listening server should bind to. Mongrel servers default to 127.0.0.1 and WEBrick defaults to 0.0.0.0. .SS bucketdir Where FileBucket files are stored. +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/bucket +.IP \(bu 2 +\fPDefault\fP: $vardir/bucket +.UNINDENT .SS ca Wether the master should function as a certificate authority. +.INDENT 0.0 -.TP 2 -\(bu -Default: true +.IP \(bu 2 +\fPDefault\fP: true +.UNINDENT .SS ca_days -How long a certificate should be valid. This parameter is deprecated, use ca_ttl instead +How long a certificate should be valid. This parameter is deprecated, use ca_ttl instead .SS ca_md The type of hash used in certificates. +.INDENT 0.0 -.TP 2 -\(bu -Default: md5 +.IP \(bu 2 +\fPDefault\fP: md5 +.UNINDENT .SS ca_port The port to use for the certificate authority. +.INDENT 0.0 -.TP 2 -\(bu -Default: $masterport +.IP \(bu 2 +\fPDefault\fP: $masterport +.UNINDENT .SS ca_server The server to use for certificate authority requests. It\'s a separate server because it cannot and does not need to horizontally scale. +.INDENT 0.0 -.TP 2 -\(bu -Default: $server +.IP \(bu 2 +\fPDefault\fP: $server +.UNINDENT .SS ca_ttl -The default TTL for new certificates; valid values must be an integer, optionally followed by one of the units \'y\' (years of 365 days), \'d\' (days), \'h\' (hours), or \'s\' (seconds). The unit defaults to seconds. If this parameter is set, ca_days is ignored. Examples are \'3600\' (one hour) and \'1825d\', which is the same as \'5y\' (5 years) +The default TTL for new certificates; valid values must be an integer, optionally followed by one of the units \'y\' (years of 365 days), \'d\' (days), \'h\' (hours), or \'s\' (seconds). The unit defaults to seconds. If this parameter is set, ca_days is ignored. Examples are \'3600\' (one hour) and \'1825d\', which is the same as \'5y\' (5 years) +.INDENT 0.0 -.TP 2 -\(bu -Default: 5y +.IP \(bu 2 +\fPDefault\fP: 5y +.UNINDENT .SS cacert The CA certificate. +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/ca_crt.pem +.IP \(bu 2 +\fPDefault\fP: $cadir/ca_crt.pem +.UNINDENT .SS cacrl -The certificate revocation list (CRL) for the CA. Set this to \'false\' if you do not want to use a CRL. +The certificate revocation list (CRL) for the CA. Will be used if present but otherwise ignored. +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/ca_crl.pem +.IP \(bu 2 +\fPDefault\fP: $cadir/ca_crl.pem +.UNINDENT .SS cadir The root directory for the certificate authority. +.INDENT 0.0 -.TP 2 -\(bu -Default: $ssldir/ca +.IP \(bu 2 +\fPDefault\fP: $ssldir/ca +.UNINDENT .SS cakey The CA private key. +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/ca_key.pem +.IP \(bu 2 +\fPDefault\fP: $cadir/ca_key.pem +.UNINDENT .SS capass Where the CA stores the password for the private key +.INDENT 0.0 -.TP 2 -\(bu -Default: $caprivatedir/ca.pass +.IP \(bu 2 +\fPDefault\fP: $caprivatedir/ca.pass +.UNINDENT .SS caprivatedir Where the CA stores private certificate information. +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/private +.IP \(bu 2 +\fPDefault\fP: $cadir/private +.UNINDENT .SS capub The CA public key. +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/ca_pub.pem +.IP \(bu 2 +\fPDefault\fP: $cadir/ca_pub.pem +.UNINDENT .SS casesensitive Whether matching in case statements and selectors should be case\-sensitive. Case insensitivity is handled by downcasing all values before comparison. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false + +.UNINDENT + +.SS catalog_format +(Deprecated for \'preferred_serialization_format\') What format to use to dump the catalog. Only supports \'marshal\' and \'yaml\'. Only matters on the client, since it asks the server for a specific format. .SS cert_inventory A Complete listing of all certificates +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/inventory.txt +.IP \(bu 2 +\fPDefault\fP: $cadir/inventory.txt +.UNINDENT .SS certdir The certificate directory. +.INDENT 0.0 -.TP 2 -\(bu -Default: $ssldir/certs +.IP \(bu 2 +\fPDefault\fP: $ssldir/certs +.UNINDENT .SS certdnsnames The DNS names on the Server certificate as a colon\-separated list. If it\'s anything other than an empty string, it will be used as an alias in the created certificate. By default, only the server gets an alias set up, and only for \'puppet\'. @@ -457,95 +348,79 @@ .SS certname The name to use when handling certificates. Defaults to the fully qualified domain name. +.INDENT 0.0 -.TP 2 -\(bu -Default: absinthe.lovedthanlost.net +.IP \(bu 2 +\fPDefault\fP: pelin.lovedthanlost.net +.UNINDENT .SS classfile -The file in which puppetd stores a list of the classes associated with the retrieved configuration. Can be loaded in the separate -.\" visit_literal -puppet -.\" depart_literal - executable using the -.\" visit_literal -\-\-loadclasses -.\" depart_literal - option. +The file in which puppetd stores a list of the classes associated with the retrieved configuration. Can be loaded in the separate \fBpuppet\fP executable using the \fB\-\-loadclasses\fP option. +.INDENT 0.0 -.TP 2 -\(bu -Default: $statedir/classes.txt +.IP \(bu 2 +\fPDefault\fP: $statedir/classes.txt +.UNINDENT .SS clientbucketdir Where FileBucket files are stored locally. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $vardir/clientbucket + +.UNINDENT + +.SS clientyamldir +The directory in which client\-side YAML data is stored. + +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/clientbucket +.IP \(bu 2 +\fPDefault\fP: $vardir/client_yaml +.UNINDENT .SS code -Code to parse directly. This is essentially only used by -.\" visit_literal -puppet -.\" depart_literal -, and should only be set if you\'re writing your own Puppet executable +Code to parse directly. This is essentially only used by \fBpuppet\fP, and should only be set if you\'re writing your own Puppet executable .SS color -Whether to use colors when logging to the console. Valid values are -.\" visit_literal -ansi -.\" depart_literal - (equivalent to -.\" visit_literal -true -.\" depart_literal -), -.\" visit_literal -html -.\" depart_literal - (mostly used during testing with TextMate), and -.\" visit_literal -false -.\" depart_literal -, which produces no color. - - -.TP 2 -\(bu -Default: ansi +Whether to use colors when logging to the console. Valid values are \fBansi\fP (equivalent to \fBtrue\fP), \fBhtml\fP (mostly used during testing with TextMate), and \fBfalse\fP, which produces no color. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: ansi + +.UNINDENT .SS confdir -The main Puppet configuration directory. The default for this parameter is calculated based on the user. If the process is runnig as root or the user that -.\" visit_literal -puppetmasterd -.\" depart_literal - is supposed to run as, it defaults to a system directory, but if it\'s running as any other user, it defaults to being in -.\" visit_literal -~ -.\" depart_literal -. +The main Puppet configuration directory. The default for this parameter is calculated based on the user. If the process is runnig as root or the user that \fBpuppetmasterd\fP is supposed to run as, it defaults to a system directory, but if it\'s running as any other user, it defaults to being in \fB~\fP. +.INDENT 0.0 -.TP 2 -\(bu -Default: /etc/puppet +.IP \(bu 2 +\fPDefault\fP: /etc/puppet +.UNINDENT .SS config The configuration file for puppetdoc. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $confdir/puppet.conf -.TP 2 -\(bu -Default: $confdir/puppet.conf +.UNINDENT + +.SS config_version +How to determine the configuration version. By default, it will be the time that the configuration is parsed, but you can provide a shell script to override how the version is determined. The output of this script will be added to every log message in the reports, allowing you to correlate changes on your hosts to the source version on the server. .SS configprint @@ -555,83 +430,92 @@ .SS configtimeout How long the client should wait for the configuration to be retrieved before considering it a failure. This can help reduce flapping if too many clients contact the server at one time. +.INDENT 0.0 -.TP 2 -\(bu -Default: 120 +.IP \(bu 2 +\fPDefault\fP: 120 +.UNINDENT .SS csrdir Where the CA stores certificate requests +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/requests +.IP \(bu 2 +\fPDefault\fP: $cadir/requests +.UNINDENT .SS daemonize Send the process into the background. This is the default. +.INDENT 0.0 -.TP 2 -\(bu -Default: true +.IP \(bu 2 +\fPDefault\fP: true +.UNINDENT .SS dbadapter The type of database to use. +.INDENT 0.0 -.TP 2 -\(bu -Default: sqlite3 +.IP \(bu 2 +\fPDefault\fP: sqlite3 +.UNINDENT .SS dblocation The database cache for client configurations. Used for querying within the language. +.INDENT 0.0 -.TP 2 -\(bu -Default: $statedir/clientconfigs.sqlite3 +.IP \(bu 2 +\fPDefault\fP: $statedir/clientconfigs.sqlite3 +.UNINDENT .SS dbmigrate Whether to automatically migrate the database. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS dbname The name of the database to use. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet +.IP \(bu 2 +\fPDefault\fP: puppet +.UNINDENT .SS dbpassword The database password for Client caching. Only used when networked databases are used. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet +.IP \(bu 2 +\fPDefault\fP: puppet +.UNINDENT .SS dbserver The database server for Client caching. Only used when networked databases are used. +.INDENT 0.0 -.TP 2 -\(bu -Default: localhost +.IP \(bu 2 +\fPDefault\fP: localhost +.UNINDENT .SS dbsocket The database socket location. Only used when networked databases are used. Will be ignored if the value is an empty string. @@ -640,331 +524,342 @@ .SS dbuser The database user for Client caching. Only used when networked databases are used. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet +.IP \(bu 2 +\fPDefault\fP: puppet +.UNINDENT .SS diff Which diff command to use when printing differences between files. +.INDENT 0.0 -.TP 2 -\(bu -Default: diff +.IP \(bu 2 +\fPDefault\fP: diff +.UNINDENT .SS diff_args Which arguments to pass to the diff command when printing differences between files. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: \-u + +.UNINDENT .SS downcasefacts Whether facts should be made all lowercase when sent to the server. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS dynamicfacts Facts that are dynamic; these facts will be ignored when deciding whether changed facts should result in a recompile. Multiple facts should be comma\-separated. +.INDENT 0.0 -.TP 2 -\(bu -Default: memorysize,memoryfree,swapsize,swapfree +.IP \(bu 2 +\fPDefault\fP: memorysize,memoryfree,swapsize,swapfree +.UNINDENT .SS environment -The environment Puppet is running in. For clients (e.g., -.\" visit_literal -puppetd -.\" depart_literal -) this determines the environment itself, which is used to find modules and much more. For servers (i.e., -.\" visit_literal -puppetmasterd -.\" depart_literal -) this provides the default environment for nodes we know nothing about. +The environment Puppet is running in. For clients (e.g., \fBpuppetd\fP) this determines the environment itself, which is used to find modules and much more. For servers (i.e., \fBpuppetmasterd\fP) this provides the default environment for nodes we know nothing about. +.INDENT 0.0 -.TP 2 -\(bu -Default: production - - -.SS environments -The valid environments for Puppet clients. This is more useful as a server\-side setting than client, but any environment chosen must be in this list. Values should be separated by a comma. - - -.TP 2 -\(bu -Default: production,development +.IP \(bu 2 +\fPDefault\fP: production +.UNINDENT .SS evaltrace Whether each resource should log when it is being evaluated. This allows you to interactively see exactly what is being done. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS external_nodes -An external command that can produce node information. The output must be a YAML dump of a hash, and that hash must have one or both of -.\" visit_literal -classes -.\" depart_literal - and -.\" visit_literal -parameters -.\" depart_literal -, where -.\" visit_literal -classes -.\" depart_literal - is an array and -.\" visit_literal -parameters -.\" depart_literal - is a hash. For unknown nodes, the commands should exit with a non\-zero exit code. This command makes it straightforward to store your node mapping information in other data sources like databases. - - -.TP 2 -\(bu -Default: none +An external command that can produce node information. The output must be a YAML dump of a hash, and that hash must have one or both of \fBclasses\fP and \fBparameters\fP, where \fBclasses\fP is an array and \fBparameters\fP is a hash. For unknown nodes, the commands should exit with a non\-zero exit code. This command makes it straightforward to store your node mapping information in other data sources like databases. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: none +.UNINDENT .SS factdest Where Puppet should store facts that it pulls down from the central server. +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/facts +.IP \(bu 2 +\fPDefault\fP: $vardir/facts/ +.UNINDENT .SS factpath Where Puppet should look for facts. Multiple directories should be colon\-separated, like normal PATH variables. +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/facts +.IP \(bu 2 +\fPDefault\fP: $vardir/facts/ +.UNINDENT .SS factsignore What files to ignore when pulling down facts. +.INDENT 0.0 -.TP 2 -\(bu -Default: .svn CVS +.IP \(bu 2 +\fPDefault\fP: .svn CVS +.UNINDENT .SS factsource -From where to retrieve facts. The standard Puppet -.\" visit_literal -file -.\" depart_literal - type is used for retrieval, so anything that is a valid file source can be used here. +From where to retrieve facts. The standard Puppet \fBfile\fP type is used for retrieval, so anything that is a valid file source can be used here. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet://$server/facts +.IP \(bu 2 +\fPDefault\fP: puppet://$server/facts/ +.UNINDENT .SS factsync Whether facts should be synced with the central server. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS fileserverconfig Where the fileserver configuration is stored. +.INDENT 0.0 -.TP 2 -\(bu -Default: $confdir/fileserver.conf +.IP \(bu 2 +\fPDefault\fP: $confdir/fileserver.conf +.UNINDENT .SS filetimeout The minimum time to wait (in seconds) between checking for updates in configuration files. This timeout determines how quickly Puppet checks whether a file (such as manifests or templates) has changed on disk. +.INDENT 0.0 -.TP 2 -\(bu -Default: 15 +.IP \(bu 2 +\fPDefault\fP: 15 +.UNINDENT .SS genconfig Whether to just print a configuration to stdout and exit. Only makes sense when used interactively. Takes into account arguments specified on the CLI. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS genmanifest Whether to just print a manifest to stdout and exit. Only makes sense when used interactively. Takes into account arguments specified on the CLI. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS graph Whether to create dot graph files for the different configuration graphs. These dot files can be interpreted by tools like OmniGraffle or dot (which is part of ImageMagick). +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS graphdir Where to store dot\-outputted graphs. +.INDENT 0.0 -.TP 2 -\(bu -Default: $statedir/graphs +.IP \(bu 2 +\fPDefault\fP: $statedir/graphs +.UNINDENT .SS group The group puppetmasterd should run as. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet +.IP \(bu 2 +\fPDefault\fP: puppet +.UNINDENT .SS hostcert Where individual hosts store and look for their certificates. +.INDENT 0.0 -.TP 2 -\(bu -Default: $certdir/$certname.pem +.IP \(bu 2 +\fPDefault\fP: $certdir/$certname.pem +.UNINDENT + +.SS hostcrl +Where the host\'s certificate revocation list can be found. This is distinct from the certificate authority\'s CRL. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $ssldir/crl.pem + +.UNINDENT .SS hostcsr -Where individual hosts store and look for their certificates. +Where individual hosts store and look for their certificate requests. +.INDENT 0.0 -.TP 2 -\(bu -Default: $ssldir/csr_$certname.pem +.IP \(bu 2 +\fPDefault\fP: $ssldir/csr_$certname.pem +.UNINDENT .SS hostprivkey Where individual hosts store and look for their private key. +.INDENT 0.0 -.TP 2 -\(bu -Default: $privatekeydir/$certname.pem +.IP \(bu 2 +\fPDefault\fP: $privatekeydir/$certname.pem +.UNINDENT .SS hostpubkey Where individual hosts store and look for their public key. +.INDENT 0.0 -.TP 2 -\(bu -Default: $publickeydir/$certname.pem +.IP \(bu 2 +\fPDefault\fP: $publickeydir/$certname.pem +.UNINDENT .SS http_enable_post_connection_check Boolean; wheter or not puppetd should validate the server SSL certificate against the request hostname. +.INDENT 0.0 -.TP 2 -\(bu -Default: true +.IP \(bu 2 +\fPDefault\fP: true +.UNINDENT .SS http_proxy_host The HTTP proxy host to use for outgoing connections. Note: You may need to use a FQDN for the server hostname when using a proxy. +.INDENT 0.0 -.TP 2 -\(bu -Default: none +.IP \(bu 2 +\fPDefault\fP: none +.UNINDENT .SS http_proxy_port The HTTP proxy port to use for outgoing connections +.INDENT 0.0 -.TP 2 -\(bu -Default: 3128 +.IP \(bu 2 +\fPDefault\fP: 3128 +.UNINDENT .SS httplog Where the puppetd web server logs. +.INDENT 0.0 -.TP 2 -\(bu -Default: $logdir/http.log +.IP \(bu 2 +\fPDefault\fP: $logdir/http.log +.UNINDENT .SS ignorecache Ignore cache and always recompile the configuration. This is useful for testing new configurations, where the local cache may in fact be stale even if the timestamps are up to date \- if the facts change or if the server changes. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS ignoreimport A parameter that can be used in commit hooks, since it enables you to parse\-check a single file rather than requiring that all files exist. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS ignoreschedules Boolean; whether puppetd should ignore schedules. This is useful for initial puppetd runs. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS keylength The bit length of keys. +.INDENT 0.0 -.TP 2 -\(bu -Default: 1024 +.IP \(bu 2 +\fPDefault\fP: 1024 +.UNINDENT .SS ldapattrs The LDAP attributes to include when querying LDAP for nodes. All returned attributes are set as variables in the top\-level scope. Multiple values should be comma\-separated. The value \'all\' returns all attributes. +.INDENT 0.0 -.TP 2 -\(bu -Default: all +.IP \(bu 2 +\fPDefault\fP: all +.UNINDENT .SS ldapbase The search base for LDAP searches. It\'s impossible to provide a meaningful default here, although the LDAP libraries might have one already set. Generally, it should be the \'ou=Hosts\' branch under your main directory. @@ -973,86 +868,96 @@ .SS ldapclassattrs The LDAP attributes to use to define Puppet classes. Values should be comma\-separated. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppetclass +.IP \(bu 2 +\fPDefault\fP: puppetclass +.UNINDENT .SS ldapnodes -Whether to search for node configurations in LDAP. See http://reductivelabs.com/trac/puppet/wiki/LDAPNodes for more information. +Whether to search for node configurations in LDAP. See \fI\%http://reductivelabs.com/trac/puppet/wiki/LDAPNodes\fP for more information. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS ldapparentattr The attribute to use to define the parent node. +.INDENT 0.0 -.TP 2 -\(bu -Default: parentnode +.IP \(bu 2 +\fPDefault\fP: parentnode +.UNINDENT .SS ldappassword The password to use to connect to LDAP. .SS ldapport -The LDAP port. Only used if -.\" visit_literal -ldapnodes -.\" depart_literal - is enabled. +The LDAP port. Only used if \fBldapnodes\fP is enabled. +.INDENT 0.0 -.TP 2 -\(bu -Default: 389 +.IP \(bu 2 +\fPDefault\fP: 389 +.UNINDENT .SS ldapserver -The LDAP server. Only used if -.\" visit_literal -ldapnodes -.\" depart_literal - is enabled. +The LDAP server. Only used if \fBldapnodes\fP is enabled. +.INDENT 0.0 -.TP 2 -\(bu -Default: ldap +.IP \(bu 2 +\fPDefault\fP: ldap +.UNINDENT .SS ldapssl Whether SSL should be used when searching for nodes. Defaults to false because SSL usually requires certificates to be set up on the client side. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: false -.TP 2 -\(bu -Default: false +.UNINDENT +.SS ldapstackedattrs +The LDAP attributes that should be stacked to arrays by adding the values in all hierarchy elements of the tree. Values should be comma\-separated. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: puppetvar + +.UNINDENT .SS ldapstring The search string used to find an LDAP node. +.INDENT 0.0 -.TP 2 -\(bu -Default: (&(objectclass=puppetClient)(cn=%s)) +.IP \(bu 2 +\fPDefault\fP: (&(objectclass=puppetClient)(cn=%s)) +.UNINDENT .SS ldaptls Whether TLS should be used when searching for nodes. Defaults to false because TLS usually requires certificates to be set up on the client side. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS ldapuser The user to use to connect to LDAP. Must be specified as a full DN. @@ -1061,676 +966,816 @@ .SS lexical Whether to use lexical scoping (vs. dynamic). +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS libdir An extra search path for Puppet. This is only useful for those files that Puppet will load on demand, and is only guaranteed to work for those cases. In fact, the autoload mechanism is responsible for making sure this directory is in Ruby\'s search path +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/lib +.IP \(bu 2 +\fPDefault\fP: $vardir/lib +.UNINDENT .SS listen -Whether puppetd should listen for connections. If this is true, then by default only the -.\" visit_literal -runner -.\" depart_literal - server is started, which allows remote authorized and authenticated nodes to connect and trigger -.\" visit_literal -puppetd -.\" depart_literal - runs. +Whether puppetd should listen for connections. If this is true, then by default only the \fBrunner\fP server is started, which allows remote authorized and authenticated nodes to connect and trigger \fBpuppetd\fP runs. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS localcacert Where each client stores the CA certificate. +.INDENT 0.0 -.TP 2 -\(bu -Default: $certdir/ca.pem +.IP \(bu 2 +\fPDefault\fP: $certdir/ca.pem +.UNINDENT .SS localconfig Where puppetd caches the local configuration. An extension indicating the cache format is added automatically. +.INDENT 0.0 -.TP 2 -\(bu -Default: $statedir/localconfig +.IP \(bu 2 +\fPDefault\fP: $statedir/localconfig +.UNINDENT .SS logdir The Puppet log directory. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $vardir/log + +.UNINDENT + +.SS manage_internal_file_permissions +Whether Puppet should manage the owner, group, and mode of files it uses internally -.TP 2 -\(bu -Default: $vardir/log +.INDENT 0.0 +.IP \(bu 2 +\fPDefault\fP: true + +.UNINDENT .SS manifest The entry\-point manifest for puppetmasterd. +.INDENT 0.0 -.TP 2 -\(bu -Default: $manifestdir/site.pp +.IP \(bu 2 +\fPDefault\fP: $manifestdir/site.pp +.UNINDENT .SS manifestdir Where puppetmasterd looks for its manifests. +.INDENT 0.0 -.TP 2 -\(bu -Default: $confdir/manifests +.IP \(bu 2 +\fPDefault\fP: $confdir/manifests +.UNINDENT .SS masterhttplog Where the puppetmasterd web server logs. +.INDENT 0.0 -.TP 2 -\(bu -Default: $logdir/masterhttp.log +.IP \(bu 2 +\fPDefault\fP: $logdir/masterhttp.log +.UNINDENT .SS masterlog Where puppetmasterd logs. This is generally not used, since syslog is the default log destination. +.INDENT 0.0 -.TP 2 -\(bu -Default: $logdir/puppetmaster.log +.IP \(bu 2 +\fPDefault\fP: $logdir/puppetmaster.log +.UNINDENT .SS masterport Which port puppetmasterd listens on. +.INDENT 0.0 -.TP 2 -\(bu -Default: 8140 +.IP \(bu 2 +\fPDefault\fP: 8140 +.UNINDENT .SS maximum_uid The maximum allowed UID. Some platforms use negative UIDs but then ship with tools that do not know how to handle signed ints, so the UIDs show up as huge numbers that can then not be fed back into the system. This is a hackish way to fail in a slightly more useful way when that happens. +.INDENT 0.0 -.TP 2 -\(bu -Default: 4294967290 +.IP \(bu 2 +\fPDefault\fP: 4294967290 +.UNINDENT .SS mkusers Whether to create the necessary user and group that puppetd will run as. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS modulepath The search path for modules as a colon\-separated list of directories. +.INDENT 0.0 -.TP 2 -\(bu -Default: $confdir/modules:/usr/share/puppet/modules +.IP \(bu 2 +\fPDefault\fP: $confdir/modules:/usr/share/puppet/modules +.UNINDENT .SS name -The name of the service, if we are running as one. The default is essentially $0 without the path or -.\" visit_literal -.rb -.\" depart_literal -. +The name of the service, if we are running as one. The default is essentially $0 without the path or \fB.rb\fP. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppetdoc +.IP \(bu 2 +\fPDefault\fP: puppetdoc +.UNINDENT .SS node_name -How the puppetmaster determines the client\'s identity and sets the \'hostname\', \'fqdn\' and \'domain\' facts for use in the manifest, in particular for determining which \'node\' statement applies to the client. Possible values are \'cert\' (use the subject\'s CN in the client\'s certificate) and \'facter\' (use the hostname that the client reported in its facts) +How the puppetmaster determines the client\'s identity and sets the \'hostname\', \'fqdn\' and \'domain\' facts for use in the manifest, in particular for determining which \'node\' statement applies to the client. Possible values are \'cert\' (use the subject\'s CN in the client\'s certificate) and \'facter\' (use the hostname that the client reported in its facts) +.INDENT 0.0 -.TP 2 -\(bu -Default: cert +.IP \(bu 2 +\fPDefault\fP: cert +.UNINDENT .SS node_terminus Where to find information about nodes. +.INDENT 0.0 -.TP 2 -\(bu -Default: plain +.IP \(bu 2 +\fPDefault\fP: plain +.UNINDENT .SS noop Whether puppetd should be run in noop mode. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS paramcheck Whether to validate parameters during parsing. +.INDENT 0.0 -.TP 2 -\(bu -Default: true +.IP \(bu 2 +\fPDefault\fP: true +.UNINDENT .SS parseonly Just check the syntax of the manifests. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS passfile Where puppetd stores the password for its private key. Generally unused. +.INDENT 0.0 -.TP 2 -\(bu -Default: $privatedir/password +.IP \(bu 2 +\fPDefault\fP: $privatedir/password +.UNINDENT .SS path The shell search path. Defaults to whatever is inherited from the parent process. +.INDENT 0.0 -.TP 2 -\(bu -Default: none +.IP \(bu 2 +\fPDefault\fP: none +.UNINDENT .SS pidfile The pid file +.INDENT 0.0 -.SS plugindest -Where Puppet should store plugins that it pulls down from the central server. - - -.TP 2 -\(bu -Default: $libdir +.IP \(bu 2 +\fPDefault\fP: $rundir/$name.pid +.UNINDENT -.SS pluginpath -Where Puppet should look for plugins. Multiple directories should be colon\-separated, like normal PATH variables. As of 0.23.1, this option is deprecated; download your custom libraries to the $libdir instead. +.SS plugindest +Where Puppet should store plugins that it pulls down from the central server. +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/plugins +.IP \(bu 2 +\fPDefault\fP: $libdir +.UNINDENT .SS pluginsignore What files to ignore when pulling down plugins. +.INDENT 0.0 -.TP 2 -\(bu -Default: .svn CVS +.IP \(bu 2 +\fPDefault\fP: .svn CVS .git +.UNINDENT .SS pluginsource -From where to retrieve plugins. The standard Puppet -.\" visit_literal -file -.\" depart_literal - type is used for retrieval, so anything that is a valid file source can be used here. +From where to retrieve plugins. The standard Puppet \fBfile\fP type is used for retrieval, so anything that is a valid file source can be used here. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet://$server/plugins +.IP \(bu 2 +\fPDefault\fP: puppet://$server/plugins +.UNINDENT .SS pluginsync Whether plugins should be synced with the central server. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: false + +.UNINDENT -.TP 2 -\(bu -Default: false +.SS preferred_serialization_format +The preferred means of serializing ruby instances for passing over the wire. This won\'t guarantee that all instances will be serialized using this method, since not all classes can be guaranteed to support this format, but it will be used for all classes that support it. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: pson + +.UNINDENT .SS privatedir Where the client stores private certificate information. +.INDENT 0.0 -.TP 2 -\(bu -Default: $ssldir/private +.IP \(bu 2 +\fPDefault\fP: $ssldir/private +.UNINDENT .SS privatekeydir The private key directory. +.INDENT 0.0 -.TP 2 -\(bu -Default: $ssldir/private_keys +.IP \(bu 2 +\fPDefault\fP: $ssldir/private_keys +.UNINDENT .SS publickeydir The public key directory. +.INDENT 0.0 -.TP 2 -\(bu -Default: $ssldir/public_keys +.IP \(bu 2 +\fPDefault\fP: $ssldir/public_keys +.UNINDENT .SS puppetdlockfile A lock file to temporarily stop puppetd from doing anything. +.INDENT 0.0 -.TP 2 -\(bu -Default: $statedir/puppetdlock +.IP \(bu 2 +\fPDefault\fP: $statedir/puppetdlock +.UNINDENT .SS puppetdlog The log file for puppetd. This is generally not used. +.INDENT 0.0 -.TP 2 -\(bu -Default: $logdir/puppetd.log +.IP \(bu 2 +\fPDefault\fP: $logdir/puppetd.log +.UNINDENT .SS puppetport Which port puppetd listens on. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: 8139 + +.UNINDENT + +.SS queue_source +Which type of queue to use for asynchronous processing. If your stomp server requires authentication, you can include it in the URI as long as your stomp client library is at least 1.1.1 + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: stomp://localhost:61613/ + +.UNINDENT + +.SS queue_type +Which type of queue to use for asynchronous processing. -.TP 2 -\(bu -Default: 8139 +.INDENT 0.0 +.IP \(bu 2 +\fPDefault\fP: stomp + +.UNINDENT .SS rails_loglevel -The log level for Rails connections. The value must be a valid log level within Rails. Production environments normally use -.\" visit_literal -info -.\" depart_literal - and other environments normally use -.\" visit_literal -debug -.\" depart_literal -. +The log level for Rails connections. The value must be a valid log level within Rails. Production environments normally use \fBinfo\fP and other environments normally use \fBdebug\fP. +.INDENT 0.0 -.TP 2 -\(bu -Default: info +.IP \(bu 2 +\fPDefault\fP: info +.UNINDENT .SS railslog Where Rails\-specific logs are sent +.INDENT 0.0 -.TP 2 -\(bu -Default: $logdir/rails.log +.IP \(bu 2 +\fPDefault\fP: $logdir/rails.log +.UNINDENT .SS report Whether to send reports after every transaction. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: false + +.UNINDENT + +.SS report_port +The port to communicate with the report_server. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $masterport -.TP 2 -\(bu -Default: false +.UNINDENT +.SS report_server +The server to which to send transaction reports. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $server + +.UNINDENT .SS reportdir The directory in which to store reports received from the client. Each client gets a separate subdirectory. +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/reports +.IP \(bu 2 +\fPDefault\fP: $vardir/reports +.UNINDENT .SS reportfrom The \'from\' email address for the reports. +.INDENT 0.0 -.TP 2 -\(bu -Default: report@absinthe.lovedthanlost.net +.IP \(bu 2 +\fPDefault\fP: \fI\%report@pelin.lovedthanlost.net\fP +.UNINDENT .SS reports The list of reports to generate. All reports are looked for in puppet/reports/.rb, and multiple report names should be comma\-separated (whitespace is okay). +.INDENT 0.0 -.TP 2 -\(bu -Default: store +.IP \(bu 2 +\fPDefault\fP: store +.UNINDENT .SS reportserver -The server to which to send transaction reports. +(Deprecated for \'report_server\') The server to which to send transaction reports. +.INDENT 0.0 -.TP 2 -\(bu -Default: $server +.IP \(bu 2 +\fPDefault\fP: $server +.UNINDENT .SS req_bits The bit length of the certificates. +.INDENT 0.0 -.TP 2 -\(bu -Default: 2048 +.IP \(bu 2 +\fPDefault\fP: 2048 +.UNINDENT -.SS rrddir -The directory where RRD database files are stored. Directories for each reporting host will be created under this directory. +.SS requestdir +Where host certificate requests are stored. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $ssldir/certificate_requests +.UNINDENT -.TP 2 -\(bu -Default: $vardir/rrd +.SS rest_authconfig +The configuration file that defines the rights to the different rest indirections. This can be used as a fine\-grained authorization system for \fBpuppetmasterd\fP. +.INDENT 0.0 -.SS rrdgraph -Whether RRD information should be graphed. +.IP \(bu 2 +\fPDefault\fP: $confdir/auth.conf + +.UNINDENT + +.SS rrddir +The directory where RRD database files are stored. Directories for each reporting host will be created under this directory. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: $vardir/rrd +.UNINDENT .SS rrdinterval How often RRD should expect data. This should match how often the hosts report back to the server. +.INDENT 0.0 -.TP 2 -\(bu -Default: $runinterval +.IP \(bu 2 +\fPDefault\fP: $runinterval +.UNINDENT .SS rundir Where Puppet PID files are kept. +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/run +.IP \(bu 2 +\fPDefault\fP: $vardir/run +.UNINDENT .SS runinterval How often puppetd applies the client configuration; in seconds. +.INDENT 0.0 -.TP 2 -\(bu -Default: 1800 +.IP \(bu 2 +\fPDefault\fP: 1800 +.UNINDENT .SS sendmail Where to find the sendmail binary with which to send email. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: /usr/sbin/sendmail + +.UNINDENT .SS serial Where the serial number for certificates is stored. +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/serial +.IP \(bu 2 +\fPDefault\fP: $cadir/serial +.UNINDENT .SS server The server to which server puppetd should connect +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet +.IP \(bu 2 +\fPDefault\fP: puppet +.UNINDENT .SS servertype The type of server to use. Currently supported options are webrick and mongrel. If you use mongrel, you will need a proxy in front of the process or processes, since Mongrel cannot speak SSL. +.INDENT 0.0 -.TP 2 -\(bu -Default: webrick +.IP \(bu 2 +\fPDefault\fP: webrick +.UNINDENT .SS show_diff -Whether to print a contextual diff when files are being replaced. The diff is printed on stdout, so this option is meaningless unless you are running Puppet interactively. This feature currently requires the -.\" visit_literal -diff/lcs -.\" depart_literal - Ruby library. +Whether to print a contextual diff when files are being replaced. The diff is printed on stdout, so this option is meaningless unless you are running Puppet interactively. This feature currently requires the \fBdiff/lcs\fP Ruby library. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS signeddir Where the CA stores signed certificates. +.INDENT 0.0 -.TP 2 -\(bu -Default: $cadir/signed +.IP \(bu 2 +\fPDefault\fP: $cadir/signed +.UNINDENT .SS smtpserver The server through which to send email reports. +.INDENT 0.0 -.TP 2 -\(bu -Default: none +.IP \(bu 2 +\fPDefault\fP: none +.UNINDENT .SS splay Whether to sleep for a pseudo\-random (but consistent) amount of time before a run. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS splaylimit The maximum time to delay before runs. Defaults to being the same as the run interval. +.INDENT 0.0 -.TP 2 -\(bu -Default: $runinterval +.IP \(bu 2 +\fPDefault\fP: $runinterval +.UNINDENT .SS ssl_client_header -The header containing an authenticated client\'s SSL DN. Only used with Mongrel. This header must be set by the proxy to the authenticated client\'s SSL DN (e.g., -.\" visit_literal -/CN=puppet.reductivelabs.com -.\" depart_literal -). See http://reductivelabs.com/puppet/trac/wiki/UsingMongrel for more information. +The header containing an authenticated client\'s SSL DN. Only used with Mongrel. This header must be set by the proxy to the authenticated client\'s SSL DN (e.g., \fB/CN=puppet.reductivelabs.com\fP). See \fI\%http://reductivelabs.com/puppet/trac/wiki/UsingMongrel\fP for more information. +.INDENT 0.0 -.TP 2 -\(bu -Default: HTTP_X_CLIENT_DN +.IP \(bu 2 +\fPDefault\fP: HTTP_X_CLIENT_DN +.UNINDENT .SS ssl_client_verify_header -The header containing the status message of the client verification. Only used with Mongrel. This header must be set by the proxy to \'SUCCESS\' if the client successfully authenticated, and anything else otherwise. See http://reductivelabs.com/puppet/trac/wiki/UsingMongrel for more information. +The header containing the status message of the client verification. Only used with Mongrel. This header must be set by the proxy to \'SUCCESS\' if the client successfully authenticated, and anything else otherwise. See \fI\%http://reductivelabs.com/puppet/trac/wiki/UsingMongrel\fP for more information. +.INDENT 0.0 -.TP 2 -\(bu -Default: HTTP_X_CLIENT_VERIFY +.IP \(bu 2 +\fPDefault\fP: HTTP_X_CLIENT_VERIFY +.UNINDENT .SS ssldir Where SSL certificates are kept. +.INDENT 0.0 -.TP 2 -\(bu -Default: $confdir/ssl +.IP \(bu 2 +\fPDefault\fP: $confdir/ssl +.UNINDENT .SS statedir The directory where Puppet state is stored. Generally, this directory can be removed without causing harm (although it might result in spurious service restarts). +.INDENT 0.0 -.TP 2 -\(bu -Default: $vardir/state +.IP \(bu 2 +\fPDefault\fP: $vardir/state +.UNINDENT .SS statefile Where puppetd and puppetmasterd store state associated with the running configuration. In the case of puppetmasterd, this file reflects the state discovered through interacting with clients. +.INDENT 0.0 -.TP 2 -\(bu -Default: $statedir/state.yaml +.IP \(bu 2 +\fPDefault\fP: $statedir/state.yaml +.UNINDENT .SS storeconfigs Whether to store each client\'s configuration. This requires ActiveRecord from Ruby on Rails. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: false + +.UNINDENT + +.SS strict_hostname_checking +Whether to only search for the complete hostname as it is in the certificate when searching for node information in the catalogs. -.TP 2 -\(bu -Default: false +.INDENT 0.0 +.IP \(bu 2 +\fPDefault\fP: false + +.UNINDENT .SS summarize Whether to print a transaction summary. +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS syslogfacility What syslog facility to use when logging to syslog. Syslog has a fixed list of valid facilities, and you must choose one of those; you cannot just make one up. +.INDENT 0.0 -.TP 2 -\(bu -Default: daemon +.IP \(bu 2 +\fPDefault\fP: daemon +.UNINDENT .SS tagmap The mapping between reporting tags and email addresses. +.INDENT 0.0 -.TP 2 -\(bu -Default: $confdir/tagmail.conf +.IP \(bu 2 +\fPDefault\fP: $confdir/tagmail.conf +.UNINDENT .SS tags Tags to use to find resources. If this is set, then only resources tagged with the specified tags will be applied. Values must be comma\-separated. .SS templatedir -Where Puppet looks for template files. +Where Puppet looks for template files. Can be a list of colon\-seperated directories. + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $vardir/templates +.UNINDENT -.TP 2 -\(bu -Default: $vardir/templates +.SS thin_storeconfigs +Boolean; wether storeconfigs store in the database only the facts and exported resources. If true, then storeconfigs performance will be higher and still allow exported/collected resources, but other usage external to Puppet might not work +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: false + +.UNINDENT .SS trace Whether to print stack traces on some errors +.INDENT 0.0 -.TP 2 -\(bu -Default: false +.IP \(bu 2 +\fPDefault\fP: false +.UNINDENT .SS typecheck Whether to validate types during parsing. +.INDENT 0.0 -.TP 2 -\(bu -Default: true +.IP \(bu 2 +\fPDefault\fP: true +.UNINDENT .SS usecacheonfailure Whether to use the cached configuration when the remote configuration will not compile. This option is useful for testing new configurations, where you want to fix the broken configuration rather than reverting to a known\-good one. +.INDENT 0.0 -.TP 2 -\(bu -Default: true +.IP \(bu 2 +\fPDefault\fP: true +.UNINDENT .SS user The user puppetmasterd should run as. +.INDENT 0.0 -.TP 2 -\(bu -Default: puppet +.IP \(bu 2 +\fPDefault\fP: puppet +.UNINDENT .SS vardir -Where Puppet stores dynamic and growing data. The default for this parameter is calculated specially, like confdir. +Where Puppet stores dynamic and growing data. The default for this parameter is calculated specially, like \fI\%confdir\fP. +.INDENT 0.0 -.TP 2 -\(bu -Default: /var/puppet +.IP \(bu 2 +\fPDefault\fP: /var/puppet +.UNINDENT .SS yamldir The directory in which YAML data is stored, usually in a subdirectory. +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: $vardir/yaml -.TP 2 -\(bu -Default: $vardir/yaml +.UNINDENT +.SS zlib +Boolean; whether to use the zlib library + +.INDENT 0.0 + +.IP \(bu 2 +\fPDefault\fP: true + +.UNINDENT .sp .ce @@ -1738,10 +1783,8 @@ .ce 0 .sp - -.I This page autogenerated on Mon May 05 09:33:01 +1000 2008 - +\fIThis page autogenerated on Wed Dec 30 19:31:12 \-0500 2009\fP -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:31. +.\" diff -Nru puppet-0.25.1/man/man8/puppetd.8 puppet-0.25.4/man/man8/puppetd.8 --- puppet-0.25.1/man/man8/puppetd.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/puppetd.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ .TH Synopsis "" "" "" .SH NAME -Synopsis \- - +Synopsis \- .\" Man page generated from reStructeredText. Retrieve the client configuration from the central puppet server and apply it to the local host. @@ -10,17 +9,19 @@ .SH USAGE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 .TP .B puppetd [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] [\-\-disable] [\-\-enable] [\-h|\-\-help] [\-\-fqdn ] [\-l|\-\-logdest syslog||console] -[\-o|\-\-onetime] [\-\-serve ] [\-t|\-\-test] +[\-o|\-\-onetime] [\-\-serve ] [\-t|\-\-test] [\-\-noop] [\-V|\-\-version] [\-v|\-\-verbose] [\-w|\-\-waitforcert ] - -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION This is the main puppet client. Its job is to retrieve the local @@ -68,8 +69,8 @@ an argument. See the configuration file documentation at -http://reductivelabs.com/projects/puppet/reference/configref.html for -the full list of acceptable parameters. A commented list of all +\fI\%http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference\fP for the +full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppetd with \'\-\-genconfig\'. @@ -79,6 +80,7 @@ debug: Enable full debugging. +.INDENT 0.0 .TP .B disable: Disable working on the local system. This puts a lock file @@ -88,11 +90,13 @@ configuration to override the local state until everything is tested and committed. +.UNINDENT +puppetd+ uses the same lock file while it is running, so no more than one +puppetd+ process is working at a time. +puppetd+ exits after executing this. +.INDENT 0.0 .TP .B enable: Enable working on the local system. This removes any lock @@ -100,8 +104,10 @@ again (although it will continue to use its normal scheduling, so it might not start for another half hour). +.UNINDENT +puppetd+ exits after executing this. +.INDENT 0.0 .TP .B fqdn: Set the fully\-qualified domain name of the client. This is @@ -109,8 +115,10 @@ override the discovered hostname. If you need to use this flag, it is generally an indication of a setup problem. +.UNINDENT help: Print this help message +.INDENT 0.0 .TP .B logdest: Where to send messages. Choose between syslog, the @@ -145,13 +153,21 @@ .TP .B test: Enable the most common options used for testing. These are -+onetime+, +verbose+, +ignorecache, and ++onetime+, +verbose+, +ignorecache, +no\-daemonize+, and +no\-usecacheonfailure+. + +.TP +.B noop: Use +noop+ mode where the daemon runs in a no\-op or +dry\-run mode. This is useful for seeing what changes +Puppet will make without actually executing the changes. + +.UNINDENT verbose: Turn on verbose reporting. version: Print the puppet version number and exit. +.INDENT 0.0 .TP .B waitforcert: This option only matters for daemons that do not yet have @@ -162,14 +178,15 @@ client. You can turn off waiting for certificates by specifying a time of 0. +.UNINDENT .SH EXAMPLE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 puppetd \-\-server puppet.domain.com - -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH AUTHOR Luke Kanies @@ -180,5 +197,5 @@ Public License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:31. +.\" diff -Nru puppet-0.25.1/man/man8/puppetdoc.8 puppet-0.25.4/man/man8/puppetdoc.8 --- puppet-0.25.1/man/man8/puppetdoc.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/puppetdoc.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. .SH SYNOPSIS @@ -10,44 +9,98 @@ .SH USAGE +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 -.\" visit_block_quote -puppetdoc [\-a|\-\-all] [\-h|\-\-help] [\-m|\-\-mode [\-r|\-\-reference <[type]|configuration|..>] - +.TP +.B puppetdoc [\-a|\-\-all] [\-h|\-\-help] [\-o|\-\-outputdir ] [\-m|\-\-mode ] +[\-r|\-\-reference <[type]|configuration|..>] [manifest\-file] -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION -This command generates a restructured\-text document describing all -installed Puppet types or all allowable arguments to puppet executables. -It is largely meant for internal use and is used to generate the -reference document available on the Reductive Labs web site. +If mode is not \'rdoc\', then this command generates a restructured\-text +document describing all installed Puppet types or all allowable +arguments to puppet executables. It is largely meant for internal use +and is used to generate the reference document available on the +Reductive Labs web site. + +In \'rdoc\' mode, this command generates an html RDoc hierarchy describing +the manifests that are in \'manifestdir\' and \'modulepath\' configuration +directives. The generated documentation directory is doc by default but +can be changed with the \'outputdir\' option. + +If the command is started with \'manifest\-file\' command\-line arguments, +puppetdoc generate a single manifest documentation that is output on +stdout. .SH OPTIONS -all: Output the docs for all of the reference types. +.INDENT 0.0 + +.TP +.B all: Output the docs for all of the reference types. In \'rdoc\' +modes, this also outputs documentation for all resources +.UNINDENT help: Print this help message +.INDENT 0.0 + +.TP +.B outputdir: Specifies the directory where to output the rdoc +documentation in \'rdoc\' mode. + .TP .B mode: Determine the output mode. Valid modes are \'text\', \'trac\', -and \'pdf\'. Note that \'trac\' mode only works on Reductive Labs -servers. The default mode is \'text\'. +\'pdf\', \'markdown\' and \'rdoc\'. The \'pdf\' and \'markdown\' modes +create PDF or Markdown formatted files in the /tmp directory. +Note that \'trac\' mode only works on Reductive Labs servers. +The default mode is \'text\'. In \'rdoc\' mode you must provide +\'manifests\-path\' .TP .B reference: Build a particular reference. Get a list of references by running +puppetdoc \-\-list+. +.UNINDENT .SH EXAMPLE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 $ puppetdoc \-r type > /tmp/type_reference.rst +.UNINDENT +.UNINDENT +or + +.INDENT 0.0 +.INDENT 3.5 +$ puppetdoc \-\-outputdir /tmp/rdoc \-\-mode rdoc /path/to/manifests + +.UNINDENT +.UNINDENT +or + +.INDENT 0.0 +.INDENT 3.5 +$ puppetdoc /etc/puppet/manifests/site.pp + +.UNINDENT +.UNINDENT +or + +.INDENT 0.0 +.INDENT 3.5 +$ puppetdoc \-m markdown \-r configuration -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH AUTHOR Luke Kanies @@ -58,5 +111,5 @@ Public License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:24. +.\" diff -Nru puppet-0.25.1/man/man8/puppetmasterd.8 puppet-0.25.4/man/man8/puppetmasterd.8 --- puppet-0.25.1/man/man8/puppetmasterd.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/puppetmasterd.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. .SH SYNOPSIS @@ -10,16 +9,17 @@ .SH USAGE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 .TP .B puppetmasterd [\-D|\-\-daemonize|\-\-no\-daemonize] [\-d|\-\-debug] [\-h|\-\-help] -[\-l|\-\-logdest |console|syslog] [\-\-nobucket] [\-\-nonodes] -[\-v|\-\-verbose] [\-V|\-\-version] - +[\-l|\-\-logdest |console|syslog] [\-v|\-\-verbose] [\-V|\-\-version] -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION This is the puppet central daemon. @@ -32,8 +32,8 @@ argument. See the configuration file documentation at -http://reductivelabs.com/projects/puppet/reference/configref.html for -the full list of acceptable parameters. A commented list of all +\fI\%http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference\fP for the +full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppetmasterdd with \'\-\-genconfig\'. @@ -45,6 +45,7 @@ help: Print this help message. +.INDENT 0.0 .TP .B logdest: Where to send messages. Choose between syslog, the @@ -52,27 +53,19 @@ syslog, or the console if debugging or verbosity is enabled. -nobucket: Do not function as a file bucket. - - -.TP -.B nonodes: Do not use individual node designations; each node will -receive the result of evaluating the entire configuration. - -noreports: Do not start the reports server. - +.UNINDENT verbose: Enable verbosity. version: Print the puppet version number and exit. .SH EXAMPLE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 puppetmasterd - -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH AUTHOR Luke Kanies @@ -83,5 +76,5 @@ License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:31. +.\" diff -Nru puppet-0.25.1/man/man8/puppetqd.8 puppet-0.25.4/man/man8/puppetqd.8 --- puppet-0.25.1/man/man8/puppetqd.8 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/man/man8/puppetqd.8 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,60 @@ +.TH Synopsis "" "" "" +.SH NAME +Synopsis \- +.\" Man page generated from reStructeredText. +Retrieve serialized records from a queue and process them in order. + + +.SH USAGE +.INDENT 0.0 +.INDENT 3.5 +puppetqd [\-d|\-\-debug] [\-v|\-\-verbose] + +.UNINDENT +.UNINDENT + +.SH DESCRIPTION +This is a simple application that just processes entities in a queue as +they are recieved. + + +.SH OPTIONS +Note that any configuration parameter that\'s valid in the configuration +file is also a valid long argument. For example, \'server\' is a valid +configuration parameter, so you can specify \'\-\-server \' as +an argument. + +See the configuration file documentation at +\fI\%http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference\fP for the +full list of acceptable parameters. A commented list of all +configuration options can also be generated by running puppetd with +\'\-\-genconfig\'. + +debug: Enable full debugging. + +help: Print this help message + +verbose: Turn on verbose reporting. + +version: Print the puppet version number and exit. + + +.SH EXAMPLE +.INDENT 0.0 +.INDENT 3.5 +puppetqd + +.UNINDENT +.UNINDENT + +.SH AUTHOR +Luke Kanies + + +.SH COPYRIGHT +Copyright (c) 2009 Reductive Labs, LLC Licensed under the GNU Public +License + + +.\" Generated by docutils manpage writer on 2009-12-30 19:32. +.\" diff -Nru puppet-0.25.1/man/man8/puppetrun.8 puppet-0.25.4/man/man8/puppetrun.8 --- puppet-0.25.1/man/man8/puppetrun.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/puppetrun.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. .SH SYNOPSIS @@ -9,16 +8,18 @@ .SH USAGE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 .TP .B puppetrun [\-a|\-\-all] [\-c|\-\-class ] [\-d|\-\-debug] [\-f|\-\-foreground] [\-h|\-\-help] [\-\-host ] [\-\-no\-fqdn] [\-\-ignoreschedules] -[\-t|\-\-tag ] [\-\-test] - +[\-t|\-\-tag ] [\-\-test] [\-p|\-\-ping] -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION This script can be used to connect to a set of machines running @@ -75,11 +76,12 @@ argument. See the configuration file documentation at -http://reductivelabs.com/projects/puppet/reference/configref.html for +\fI\%http://reductivelabs.com/projects/puppet/reference/configref.html\fP for the full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppetmasterdd with \'\-\-genconfig\'. +.INDENT 0.0 .TP .B all: Connect to all available hosts. Requires LDAP support @@ -90,16 +92,20 @@ .B class: Specify a class of machines to which to connect. This only works if you have LDAP configured, at the moment. +.UNINDENT debug: Enable full debugging. +.INDENT 0.0 .TP .B foreground: Run each configuration in the foreground; that is, when connecting to a host, do not return until the host has finished its run. The default is false. +.UNINDENT help: Print this help message +.INDENT 0.0 .TP .B host: A specific host to which to connect. This flag can be @@ -129,14 +135,21 @@ actually connect. This option requires LDAP support at this point. +.UNINDENT +ping: -.SH EXAMPLE -.\" visit_block_quote -sudo puppetrun \-p 10 \-\-host host1 \-\-host host2 \-t remotefile \-t webserver +.nf +Do a ICMP echo against the target host. Skip hosts that don\'t respond to ping. +.fi +.SH EXAMPLE +.INDENT 0.0 +.INDENT 3.5 +sudo puppetrun \-p 10 \-\-host host1 \-\-host host2 \-t remotefile \-t webserver -.\" depart_block_quote +.UNINDENT +.UNINDENT .SH AUTHOR Luke Kanies @@ -147,5 +160,5 @@ License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:31. +.\" diff -Nru puppet-0.25.1/man/man8/ralsh.8 puppet-0.25.4/man/man8/ralsh.8 --- puppet-0.25.1/man/man8/ralsh.8 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/man/man8/ralsh.8 2010-01-29 21:32:27.000000000 +0000 @@ -1,7 +1,6 @@ .TH "" "" "" .SH NAME - \- - + \- .\" Man page generated from reStructeredText. vim: softtabstop=4 shiftwidth=4 expandtab @@ -11,15 +10,17 @@ .SH USAGE - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 +.INDENT 0.0 .TP .B ralsh [\-h|\-\-help] [\-d|\-\-debug] [\-v|\-\-verbose] [\-e|\-\-edit] [\-H|\-\-host ] [\-p|\-\-param ] [\-t|\-\-types] type - -.\" depart_block_quote +.UNINDENT +.UNINDENT +.UNINDENT .SH DESCRIPTION This command provides simple facilities for converting current system @@ -44,8 +45,8 @@ argument. See the configuration file documentation at -http://reductivelabs.com/projects/puppet/reference/configref.html for -the full list of acceptable parameters. A commented list of all +\fI\%http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference\fP for the +full list of acceptable parameters. A commented list of all configuration options can also be generated by running puppet with \'\-\-genconfig\'. @@ -53,60 +54,52 @@ edit: - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 Write the results of the query to a file, open the file in an editor, and read the file back in as an executable Puppet manifest. - -.\" depart_block_quote +.UNINDENT +.UNINDENT host: - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 When specified, connect to the resource server on the named host and retrieve the list of resouces of the type specified. - -.\" depart_block_quote +.UNINDENT +.UNINDENT help: - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 Print this help message. - -.\" depart_block_quote +.UNINDENT +.UNINDENT param: - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 Add more parameters to be outputted from queries. - -.\" depart_block_quote +.UNINDENT +.UNINDENT types: - -.\" visit_block_quote +.INDENT 0.0 +.INDENT 3.5 List all available types. - -.\" depart_block_quote +.UNINDENT +.UNINDENT verbose: Print extra information. .SH EXAMPLE -This example uses -.\" visit_literal -ralsh -.\" depart_literal - to return Puppet configuration for the user - -.\" visit_literal -luke -.\" depart_literal -: +This example uses \fBralsh\fP to return Puppet configuration for the user +\fBluke\fP: .nf @@ -131,5 +124,5 @@ Public License -.\" Generated by docutils manpage writer on 2008-05-05 09:33. -.\" +.\" Generated by docutils manpage writer on 2009-12-30 19:24. +.\" diff -Nru puppet-0.25.1/Rakefile puppet-0.25.4/Rakefile --- puppet-0.25.1/Rakefile 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/Rakefile 2010-01-29 21:32:27.000000000 +0000 @@ -20,6 +20,7 @@ 'man/**/*', 'examples/**/*', 'ext/**/*', + 'tasks/**/*', 'test/**/*', 'spec/**/*' ] @@ -34,6 +35,7 @@ sh %{rake -T} end +desc "Create the tarball and the gem - use when releasing" task :puppetpackages => [:create_gem, :package] desc "Run the specs under spec/" @@ -41,13 +43,14 @@ require 'spec' require 'spec/rake/spectask' begin - require 'rcov' +# require 'rcov' rescue LoadError end Spec::Rake::SpecTask.new do |t| t.spec_opts = ['--format','s', '--loadby','mtime'] t.spec_files = FileList['spec/**/*.rb'] + t.fail_on_error = false if defined?(Rcov) t.rcov = true t.rcov_opts = ['--exclude', 'spec/*,test/*,results/*,/usr/lib/*,/usr/local/lib/*'] diff -Nru puppet-0.25.1/spec/integration/bin/puppetmasterd.rb puppet-0.25.4/spec/integration/bin/puppetmasterd.rb --- puppet-0.25.1/spec/integration/bin/puppetmasterd.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/integration/bin/puppetmasterd.rb 2010-01-29 21:32:27.000000000 +0000 @@ -51,7 +51,8 @@ args = arguments + addl_args bin = File.join(File.dirname(__FILE__), "..", "..", "..", "sbin", "puppetmasterd") - output = %x{#{bin} #{args}}.chomp + lib = File.join(File.dirname(__FILE__), "..", "..", "..", "lib") + output = %x{/usr/bin/env ruby -I #{lib} #{bin} #{args}}.chomp end def stop @@ -72,7 +73,7 @@ it "should be serving status information over xmlrpc" do start - sleep 0.5 + sleep 5 client = Puppet::Network::Client.status.new(:Server => "localhost", :Port => @@port) diff -Nru puppet-0.25.1/spec/integration/defaults.rb puppet-0.25.4/spec/integration/defaults.rb --- puppet-0.25.1/spec/integration/defaults.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/integration/defaults.rb 2010-01-29 21:32:27.000000000 +0000 @@ -29,6 +29,17 @@ end end + describe "when setting the :catalog_format" do + it "should log a deprecation notice" do + Puppet.expects(:warning) + Puppet.settings[:catalog_format] = 'marshal' + end + it "should copy the value to :preferred_serialization_format" do + Puppet.settings[:catalog_format] = 'marshal' + Puppet.settings[:preferred_serialization_format].should == 'marshal' + end + end + it "should have a clientyamldir setting" do Puppet.settings[:clientyamldir].should_not be_nil end @@ -204,4 +215,12 @@ Puppet.settings[:report_server].should == "report_server" end end + + it "should have a 'prerun_command' that defaults to the empty string" do + Puppet.settings[:prerun_command].should == "" + end + + it "should have a 'postrun_command' that defaults to the empty string" do + Puppet.settings[:postrun_command].should == "" + end end diff -Nru puppet-0.25.1/spec/integration/file_serving/metadata.rb puppet-0.25.4/spec/integration/file_serving/metadata.rb --- puppet-0.25.1/spec/integration/file_serving/metadata.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/integration/file_serving/metadata.rb 2010-01-29 21:32:27.000000000 +0000 @@ -7,6 +7,7 @@ require 'puppet/file_serving/metadata' require 'shared_behaviours/file_serving' +require 'puppet/indirector/file_metadata/file_server' describe Puppet::FileServing::Metadata, " when finding files" do it_should_behave_like "Puppet::FileServing::Files" diff -Nru puppet-0.25.1/spec/integration/indirector/file_content/file_server.rb puppet-0.25.4/spec/integration/indirector/file_content/file_server.rb --- puppet-0.25.1/spec/integration/indirector/file_content/file_server.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/integration/indirector/file_content/file_server.rb 2010-01-29 21:32:27.000000000 +0000 @@ -29,9 +29,10 @@ file = File.join(modpath, "lib", "file.rb") File.open(file, "w") { |f| f.puts "1" } + Puppet.settings[:modulepath] = "/no/such/file" + env = Puppet::Node::Environment.new("foo") env.stubs(:modulepath).returns [path] - Puppet.settings[:modulepath] = "/no/such/file" result = Puppet::FileServing::Content.search("plugins", :environment => "foo", :recurse => true) diff -Nru puppet-0.25.1/spec/integration/ssl/certificate_request.rb puppet-0.25.4/spec/integration/ssl/certificate_request.rb --- puppet-0.25.1/spec/integration/ssl/certificate_request.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/integration/ssl/certificate_request.rb 2010-01-29 21:32:27.000000000 +0000 @@ -22,6 +22,8 @@ Puppet.settings[:confdir] = @dir Puppet.settings[:vardir] = @dir + Puppet::SSL::Host.ca_location = :none + @csr = Puppet::SSL::CertificateRequest.new("luke.madstop.com") @key = OpenSSL::PKey::RSA.new(512) diff -Nru puppet-0.25.1/spec/integration/type/file.rb puppet-0.25.4/spec/integration/type/file.rb --- puppet-0.25.1/spec/integration/type/file.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/integration/type/file.rb 2010-01-29 21:32:27.000000000 +0000 @@ -223,7 +223,7 @@ end it "should not recursively manage files managed by a more specific explicit file" do - dir = tmpfile("file_source_integration_source") + dir = tmpfile("recursion_vs_explicit_1") subdir = File.join(dir, "subdir") file = File.join(subdir, "file") @@ -242,6 +242,25 @@ (File.stat(file).mode & 007777).should == 0644 end + + it "should recursively manage files even if there is an explicit file whose name is a prefix of the managed file" do + dir = tmpfile("recursion_vs_explicit_2") + + managed = File.join(dir, "file") + generated = File.join(dir, "file_with_a_name_starting_with_the_word_file") + + FileUtils.mkdir_p(dir) + File.open(managed, "w") { |f| f.puts "" } + File.open(generated, "w") { |f| f.puts "" } + + @catalog = Puppet::Resource::Catalog.new + @catalog.add_resource Puppet::Type::File.new(:name => dir, :recurse => true, :backup => false, :mode => "755") + @catalog.add_resource Puppet::Type::File.new(:name => managed, :recurse => true, :backup => false, :mode => "644") + + @catalog.apply + + (File.stat(generated).mode & 007777).should == 0755 + end end describe "when generating resources" do diff -Nru puppet-0.25.1/spec/shared_behaviours/file_serving.rb puppet-0.25.4/spec/shared_behaviours/file_serving.rb --- puppet-0.25.1/spec/shared_behaviours/file_serving.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/shared_behaviours/file_serving.rb 2010-01-29 21:32:27.000000000 +0000 @@ -26,7 +26,7 @@ it "should use the file_server terminus when the 'puppet' URI scheme is used, no host name is present, and the process name is 'puppet'" do uri = "puppet:///fakemod/my/file" - Puppet::Node::Environment.stubs(:new).returns(stub("env", :name => "testing", :module => nil)) + Puppet::Node::Environment.stubs(:new).returns(stub("env", :name => "testing", :module => nil, :modulepath => [])) Puppet.settings.stubs(:value).returns "" Puppet.settings.stubs(:value).with(:name).returns("puppet") Puppet.settings.stubs(:value).with(:fileserverconfig).returns("/whatever") diff -Nru puppet-0.25.1/spec/spec_helper.rb puppet-0.25.4/spec/spec_helper.rb --- puppet-0.25.1/spec/spec_helper.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/spec_helper.rb 2010-01-29 21:32:27.000000000 +0000 @@ -18,7 +18,7 @@ require 'puppettest' require 'puppettest/runnable_test' require 'mocha' -gem 'rspec', '=1.2.2' +gem 'rspec', '>=1.2.2' require 'spec/autorun' # So everyone else doesn't have to include this base constant. diff -Nru puppet-0.25.1/spec/unit/application/puppetdoc.rb puppet-0.25.4/spec/unit/application/puppetdoc.rb --- puppet-0.25.1/spec/unit/application/puppetdoc.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/application/puppetdoc.rb 2010-01-29 21:32:27.000000000 +0000 @@ -290,16 +290,16 @@ @puppetdoc.manifest = false Puppet.stubs(:info) Puppet.stubs(:[]).with(:trace).returns(false) - Puppet.stubs(:[]).with(:modulepath).returns('modules') - Puppet.stubs(:[]).with(:manifestdir).returns('manifests') + @env = stub 'env' + Puppet::Node::Environment.stubs(:new).returns(@env) + @env.stubs(:modulepath).returns(['modules']) + @env.stubs(:[]).with(:manifest).returns('manifests/site.pp') @puppetdoc.options.stubs(:[]).with(:all).returns(false) @puppetdoc.options.stubs(:[]).with(:outputdir).returns('doc') Puppet.settings.stubs(:[]=).with(:document_all, false) Puppet.settings.stubs(:setdefaults) Puppet::Util::RDoc.stubs(:rdoc) @puppetdoc.stubs(:exit) - File.stubs(:expand_path).with('modules').returns('modules') - File.stubs(:expand_path).with('manifests').returns('manifests') @old = ARGV.dup ARGV.clear end @@ -331,6 +331,15 @@ Puppet::Util::RDoc.expects(:manifestdoc) @puppetdoc.rdoc end + + it "should get modulepath and manifestdir values from the environment" do + @env.expects(:modulepath).returns(['envmodules1','envmodules2']) + @env.expects(:[]).with(:manifest).returns('envmanifests/site.pp') + + Puppet::Util::RDoc.expects(:rdoc).with('doc', ['envmodules1','envmodules2','envmanifests']) + + @puppetdoc.rdoc + end end describe "in the other modes" do diff -Nru puppet-0.25.1/spec/unit/application/puppetd.rb puppet-0.25.4/spec/unit/application/puppetd.rb --- puppet-0.25.1/spec/unit/application/puppetd.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/application/puppetd.rb 2010-01-29 21:32:27.000000000 +0000 @@ -173,6 +173,7 @@ Puppet.stubs(:info) FileTest.stubs(:exists?).returns(true) Puppet.stubs(:[]) + Puppet.stubs(:[]).with(:libdir).returns("/dev/null/lib") Puppet.settings.stubs(:print_config?) Puppet.settings.stubs(:print_config) Puppet::SSL::Host.stubs(:ca_location=) diff -Nru puppet-0.25.1/spec/unit/application/puppetmasterd.rb puppet-0.25.4/spec/unit/application/puppetmasterd.rb --- puppet-0.25.1/spec/unit/application/puppetmasterd.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/application/puppetmasterd.rb 2010-01-29 21:32:27.000000000 +0000 @@ -237,6 +237,7 @@ it "should dispatch to parseonly if parseonly is set" do Puppet.stubs(:[]).with(:parseonly).returns(true) + @puppetmasterd.options[:node] = nil @puppetmasterd.get_command.should == :parseonly end diff -Nru puppet-0.25.1/spec/unit/application/puppet.rb puppet-0.25.4/spec/unit/application/puppet.rb --- puppet-0.25.1/spec/unit/application/puppet.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/application/puppet.rb 2010-01-29 21:32:27.000000000 +0000 @@ -173,6 +173,9 @@ describe "the main command" do before :each do Puppet.stubs(:[]) + Puppet.settings.stubs(:use) + Puppet.stubs(:[]).with(:prerun_command).returns "" + Puppet.stubs(:[]).with(:postrun_command).returns "" Puppet.stubs(:[]).with(:trace).returns(true) @puppet.options.stubs(:[]) @@ -277,6 +280,16 @@ @puppet.main end + it "should call the prerun and postrun commands on a Configurer instance" do + configurer = stub 'configurer' + + Puppet::Configurer.expects(:new).returns configurer + configurer.expects(:execute_prerun_command) + configurer.expects(:execute_postrun_command) + + @puppet.main + end + it "should apply the catalog" do @catalog.expects(:apply) @@ -332,70 +345,51 @@ end describe "the 'apply' command" do - confine "PSON library is missing; cannot test applying catalogs" => Puppet.features.pson? - - before do - #Puppet::Resource::Catalog.stubs(:pson_create).returns Puppet::Resource::Catalog.new - PSON.stubs(:parse).returns Puppet::Resource::Catalog.new - end - it "should read the catalog in from disk if a file name is provided" do @puppet.options[:catalog] = "/my/catalog.pson" - File.expects(:read).with("/my/catalog.pson").returns "something" - + Puppet::Resource::Catalog.stubs(:convert_from).with(:pson,'something').returns Puppet::Resource::Catalog.new @puppet.apply end it "should read the catalog in from stdin if '-' is provided" do @puppet.options[:catalog] = "-" - $stdin.expects(:read).returns "something" - + Puppet::Resource::Catalog.stubs(:convert_from).with(:pson,'something').returns Puppet::Resource::Catalog.new @puppet.apply end - it "should deserialize the catalog from pson" do + it "should deserialize the catalog from the default format" do @puppet.options[:catalog] = "/my/catalog.pson" - - File.expects(:read).returns "something" - PSON.expects(:parse).with("something").returns Puppet::Resource::Catalog.new - + File.stubs(:read).with("/my/catalog.pson").returns "something" + Puppet::Resource::Catalog.stubs(:default_format).returns :rot13_piglatin + Puppet::Resource::Catalog.stubs(:convert_from).with(:rot13_piglatin,'something').returns Puppet::Resource::Catalog.new @puppet.apply end it "should fail helpfully if deserializing fails" do @puppet.options[:catalog] = "/my/catalog.pson" - - File.expects(:read).returns "something" - PSON.expects(:parse).raises ArgumentError - + File.stubs(:read).with("/my/catalog.pson").returns "something syntacically invalid" lambda { @puppet.apply }.should raise_error(Puppet::Error) end it "should convert plain data structures into a catalog if deserialization does not do so" do @puppet.options[:catalog] = "/my/catalog.pson" - - File.expects(:read).returns "something" - PSON.expects(:parse).with("something").returns({:foo => "bar"}) + File.stubs(:read).with("/my/catalog.pson").returns "something" + Puppet::Resource::Catalog.stubs(:convert_from).with(:pson,"something").returns({:foo => "bar"}) Puppet::Resource::Catalog.expects(:pson_create).with({:foo => "bar"}).returns(Puppet::Resource::Catalog.new) - @puppet.apply end it "should convert the catalog to a RAL catalog and use a Configurer instance to apply it" do @puppet.options[:catalog] = "/my/catalog.pson" - - File.expects(:read).returns "something" - + File.stubs(:read).with("/my/catalog.pson").returns "something" catalog = Puppet::Resource::Catalog.new - PSON.expects(:parse).returns catalog - + Puppet::Resource::Catalog.stubs(:convert_from).with(:pson,'something').returns catalog catalog.expects(:to_ral).returns "mycatalog" configurer = stub 'configurer' Puppet::Configurer.expects(:new).returns configurer - configurer.expects(:run).with(:catalog => "mycatalog") @puppet.apply diff -Nru puppet-0.25.1/spec/unit/application/puppetrun.rb puppet-0.25.4/spec/unit/application/puppetrun.rb --- puppet-0.25.1/spec/unit/application/puppetrun.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/application/puppetrun.rb 2010-01-29 21:32:27.000000000 +0000 @@ -144,11 +144,21 @@ Puppet.stubs(:[]).with(:node_terminus).returns("ldap") end + it "should pass the fqdn option to search" do + @puppetrun.options.stubs(:[]).with(:fqdn).returns(:something) + @puppetrun.options.stubs(:[]).with(:all).returns(true) + @puppetrun.stubs(:puts) + + Puppet::Node.expects(:search).with("whatever",:fqdn => :something).returns([]) + + @puppetrun.run_setup + end + it "should search for all nodes if --all" do @puppetrun.options.stubs(:[]).with(:all).returns(true) @puppetrun.stubs(:puts) - Puppet::Node.expects(:search).with("whatever").returns([]) + Puppet::Node.expects(:search).with("whatever",:fqdn => nil).returns([]) @puppetrun.run_setup end @@ -158,7 +168,7 @@ @puppetrun.stubs(:puts) @puppetrun.classes = ['class'] - Puppet::Node.expects(:search).with("whatever", :class => "class").returns([]) + Puppet::Node.expects(:search).with("whatever", :class => "class", :fqdn => nil).returns([]) @puppetrun.run_setup end diff -Nru puppet-0.25.1/spec/unit/application/ralsh.rb puppet-0.25.4/spec/unit/application/ralsh.rb --- puppet-0.25.1/spec/unit/application/ralsh.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/application/ralsh.rb 2010-01-29 21:32:27.000000000 +0000 @@ -132,17 +132,34 @@ describe "when running" do + def set_args(args) + (ARGV.clear << args).flatten! + end + + def push_args(*args) + @args_stack ||= [] + @args_stack << ARGV.dup + set_args(args) + end + + def pop_args + set_args(@args_stack.pop) + end + before :each do @type = stub_everything 'type', :properties => [] - ARGV.stubs(:shift).returns("type") - ARGV.stubs(:length).returns(1).then.returns(0) + push_args('type') Puppet::Type.stubs(:type).returns(@type) end - it "should raise an error if no type is given" do - ARGV.stubs(:length).returns(0) + after :each do + pop_args + end + it "should raise an error if no type is given" do + push_args lambda { @ralsh.main }.should raise_error + pop_args end it "should raise an error when editing a remote host" do @@ -186,11 +203,10 @@ end it "should describe the given resource" do - ARGV.stubs(:shift).returns("type").then.returns('name') - ARGV.stubs(:length).returns(1).then.returns(1).then.returns(0) + push_args('type','name') @client.expects(:describe).returns(stub_everything) - @ralsh.main + pop_args end end @@ -208,30 +224,31 @@ describe 'but with a given name' do before :each do - ARGV.stubs(:shift).returns("type").then.returns('name') - ARGV.stubs(:length).returns(1).then.returns(1).then.returns(0) - @object = stub_everything 'object', :to_trans => stub_everything('transportable') - @type.stubs(:new).returns(@object) - @object.stubs(:retrieve) + push_args('type','name') + @type.stubs(:new).returns(:bob) end - it "should retrieve a specific instance" do - @type.expects(:new).returns(@object) - @object.expects(:retrieve) + after :each do + pop_args + end - @ralsh.main + it "should retrieve a specific instance if it exists" do + pending end - it "should add given parameters to object" do - ARGV.stubs(:each).yields('param=temp') - ARGV.stubs(:length).returns(1).then.returns(1).then.returns(1) - Puppet::Resource::Catalog.stubs(:new).returns(stub_everything) - @object.expects(:[]=).with('param','temp') + it "should create a stub instance if it doesn't exist" do + pending + end + + it "should add given parameters to the object" do + push_args('type','name','param=temp') + pending + @object.expects(:[]=).with('param','temp') @ralsh.main + pop_args end end end - end end diff -Nru puppet-0.25.1/spec/unit/configurer/fact_handler.rb puppet-0.25.4/spec/unit/configurer/fact_handler.rb --- puppet-0.25.1/spec/unit/configurer/fact_handler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/configurer/fact_handler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -97,6 +97,7 @@ # I couldn't get marshal to work for this, only yaml, so we hard-code yaml. it "should serialize and CGI escape the fact values for uploading" do facts = stub 'facts' + facts.expects(:support_format?).with(:b64_zlib_yaml).returns true facts.expects(:render).returns "my text" text = CGI.escape("my text") @@ -107,6 +108,7 @@ it "should properly accept facts containing a '+'" do facts = stub 'facts' + facts.expects(:support_format?).with(:b64_zlib_yaml).returns true facts.expects(:render).returns "my+text" text = "my%2Btext" @@ -115,8 +117,9 @@ @facthandler.facts_for_uploading.should == {:facts_format => :b64_zlib_yaml, :facts => text} end - it "should hard-code yaml as the serialization" do + it "use compressed yaml as the serialization if zlib is supported" do facts = stub 'facts' + facts.expects(:support_format?).with(:b64_zlib_yaml).returns true facts.expects(:render).with(:b64_zlib_yaml).returns "my text" text = CGI.escape("my text") @@ -125,6 +128,17 @@ @facthandler.facts_for_uploading end + it "should use yaml as the serialization if zlib is not supported" do + facts = stub 'facts' + facts.expects(:support_format?).with(:b64_zlib_yaml).returns false + facts.expects(:render).with(:yaml).returns "my text" + text = CGI.escape("my text") + + @facthandler.expects(:find_facts).returns facts + + @facthandler.facts_for_uploading + end + describe "when reloading Facter" do before do Facter.stubs(:clear) diff -Nru puppet-0.25.1/spec/unit/configurer.rb puppet-0.25.4/spec/unit/configurer.rb --- puppet-0.25.1/spec/unit/configurer.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/configurer.rb 2010-01-29 21:32:27.000000000 +0000 @@ -7,6 +7,11 @@ require 'puppet/configurer' describe Puppet::Configurer do + before do + Puppet.settings.stubs(:use).returns(true) + @agent = Puppet::Configurer.new + end + it "should include the Plugin Handler module" do Puppet::Configurer.ancestors.should be_include(Puppet::Configurer::PluginHandler) end @@ -19,6 +24,52 @@ Puppet.settings.expects(:value).with(:puppetdlockfile).returns("/my/lock") Puppet::Configurer.lockfile_path.should == "/my/lock" end + + describe "when executing a pre-run hook" do + it "should do nothing if the hook is set to an empty string" do + Puppet.settings[:prerun_command] = "" + Puppet::Util.expects(:exec).never + + @agent.execute_prerun_command + end + + it "should execute any pre-run command provided via the 'prerun_command' setting" do + Puppet.settings[:prerun_command] = "/my/command" + Puppet::Util.expects(:execute).with { |args| args[0] == "/my/command" } + + @agent.execute_prerun_command + end + + it "should fail if the command fails" do + Puppet.settings[:prerun_command] = "/my/command" + Puppet::Util.expects(:execute).raises Puppet::ExecutionFailure + + lambda { @agent.execute_prerun_command }.should raise_error(Puppet::Configurer::CommandHookError) + end + end + + describe "when executing a post-run hook" do + it "should do nothing if the hook is set to an empty string" do + Puppet.settings[:postrun_command] = "" + Puppet::Util.expects(:exec).never + + @agent.execute_postrun_command + end + + it "should execute any post-run command provided via the 'postrun_command' setting" do + Puppet.settings[:postrun_command] = "/my/command" + Puppet::Util.expects(:execute).with { |args| args[0] == "/my/command" } + + @agent.execute_postrun_command + end + + it "should fail if the command fails" do + Puppet.settings[:postrun_command] = "/my/command" + Puppet::Util.expects(:execute).raises Puppet::ExecutionFailure + + lambda { @agent.execute_postrun_command }.should raise_error(Puppet::Configurer::CommandHookError) + end + end end describe Puppet::Configurer, "when executing a catalog run" do @@ -74,6 +125,12 @@ catalog.expects(:apply).never # because we're not yielding @agent.run end + + it "should execute post-run hooks after the run" do + @agent.expects(:execute_postrun_command) + + @agent.run + end end describe Puppet::Configurer, "when retrieving a catalog" do @@ -183,6 +240,12 @@ @agent.convert_catalog(@oldcatalog, 10).should equal(@catalog) end + it "should finalize the catalog" do + @catalog.expects(:finalize) + + @agent.convert_catalog(@oldcatalog, 10) + end + it "should record the passed retrieval time with the RAL catalog" do @catalog.expects(:retrieval_duration=).with 10 @@ -207,6 +270,9 @@ Puppet.settings.stubs(:use).returns(true) @agent = Puppet::Configurer.new @agent.stubs(:dostorage) + @agent.stubs(:download_fact_plugins) + @agent.stubs(:download_plugins) + @agent.stubs(:execute_prerun_command) @facts = {"one" => "two", "three" => "four"} end @@ -217,16 +283,19 @@ end it "should download fact plugins" do - @agent.stubs(:dostorage) @agent.expects(:download_fact_plugins) @agent.prepare end it "should download plugins" do - @agent.stubs(:dostorage) @agent.expects(:download_plugins) @agent.prepare end + + it "should perform the pre-run commands" do + @agent.expects(:execute_prerun_command) + @agent.prepare + end end diff -Nru puppet-0.25.1/spec/unit/file_serving/metadata.rb puppet-0.25.4/spec/unit/file_serving/metadata.rb --- puppet-0.25.1/spec/unit/file_serving/metadata.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/file_serving/metadata.rb 2010-01-29 21:32:27.000000000 +0000 @@ -20,6 +20,84 @@ it "should have a method that triggers attribute collection" do Puppet::FileServing::Metadata.new("/foo/bar").should respond_to(:collect) end + + it "should support pson serialization" do + Puppet::FileServing::Metadata.new("/foo/bar").should respond_to(:to_pson) + end + + it "should support to_pson_data_hash" do + Puppet::FileServing::Metadata.new("/foo/bar").should respond_to(:to_pson_data_hash) + end + + it "should support pson deserialization" do + Puppet::FileServing::Metadata.should respond_to(:from_pson) + end + + describe "when serializing" do + before do + @metadata = Puppet::FileServing::Metadata.new("/foo/bar") + end + it "should perform pson serialization by calling to_pson on it's pson_data_hash" do + pdh = mock "data hash" + pdh_as_pson = mock "data as pson" + @metadata.expects(:to_pson_data_hash).returns pdh + pdh.expects(:to_pson).returns pdh_as_pson + @metadata.to_pson.should == pdh_as_pson + end + + it "should serialize as FileMetadata" do + @metadata.to_pson_data_hash['document_type'].should == "FileMetadata" + end + + it "the data should include the path, relative_path, links, owner, group, mode, checksum, type, and destination" do + @metadata.to_pson_data_hash['data'].keys.sort.should == %w{ path relative_path links owner group mode checksum type destination }.sort + end + + it "should pass the path in the hash verbatum" do + @metadata.to_pson_data_hash['data']['path'] == @metadata.path + end + + it "should pass the relative_path in the hash verbatum" do + @metadata.to_pson_data_hash['data']['relative_path'] == @metadata.relative_path + end + + it "should pass the links in the hash verbatum" do + @metadata.to_pson_data_hash['data']['links'] == @metadata.links + end + + it "should pass the path owner in the hash verbatum" do + @metadata.to_pson_data_hash['data']['owner'] == @metadata.owner + end + + it "should pass the group in the hash verbatum" do + @metadata.to_pson_data_hash['data']['group'] == @metadata.group + end + + it "should pass the mode in the hash verbatum" do + @metadata.to_pson_data_hash['data']['mode'] == @metadata.mode + end + + it "should pass the ftype in the hash verbatum as the 'type'" do + @metadata.to_pson_data_hash['data']['type'] == @metadata.ftype + end + + it "should pass the destination verbatum" do + @metadata.to_pson_data_hash['data']['destination'] == @metadata.destination + end + + it "should pass the checksum in the hash as a nested hash" do + @metadata.to_pson_data_hash['data']['checksum'].should be_is_a(Hash) + end + + it "should pass the checksum_type in the hash verbatum as the checksum's type" do + @metadata.to_pson_data_hash['data']['checksum']['type'] == @metadata.checksum_type + end + + it "should pass the checksum in the hash verbatum as the checksum's value" do + @metadata.to_pson_data_hash['data']['checksum']['value'] == @metadata.checksum + end + + end end describe Puppet::FileServing::Metadata, " when finding the file to use for setting attributes" do @@ -29,6 +107,10 @@ # Use a link because it's easier to test -- no checksumming @stat = stub "stat", :uid => 10, :gid => 20, :mode => 0755, :ftype => "link" + + # Not quite. We don't want to checksum links, but we must because they might be being followed. + @checksum = Digest::MD5.hexdigest("some content\n") # Remove these when :managed links are no longer checksumed. + @metadata.stubs(:md5_file).returns(@checksum) # end it "should accept a base path path to which the file should be relative" do @@ -139,6 +221,9 @@ @stat.stubs(:ftype).returns("link") File.expects(:readlink).with("/my/file").returns("/path/to/link") @metadata.collect + + @checksum = Digest::MD5.hexdigest("some content\n") # Remove these when :managed links are no longer checksumed. + @file.stubs(:md5_file).returns(@checksum) # end it "should read links instead of returning their checksums" do @@ -146,29 +231,56 @@ end it "should produce tab-separated mode, type, owner, group, and destination for xmlrpc" do - @metadata.attributes_with_tabs.should == "#{0755.to_s}\tlink\t10\t20\t/path/to/link" + pending "We'd like this to be true, but we need to always collect the checksum because in the server/client/server round trip we lose the distintion between manage and follow." + @metadata.attributes_with_tabs.should == "#{0755}\tlink\t10\t20\t/path/to/link" + end + + it "should produce tab-separated mode, type, owner, group, checksum, and destination for xmlrpc" do + @metadata.attributes_with_tabs.should == "#{0755}\tlink\t10\t20\t{md5}eb9c2bf0eb63f3a7bc0ea37ef18aeba5\t/path/to/link" end end end describe Puppet::FileServing::Metadata, " when pointing to a link" do - it "should store the destination of the link in :destination if links are :manage" do - file = Puppet::FileServing::Metadata.new("/base/path/my/file", :links => :manage) - - File.expects(:lstat).with("/base/path/my/file").returns stub("stat", :uid => 1, :gid => 2, :ftype => "link", :mode => 0755) - File.expects(:readlink).with("/base/path/my/file").returns "/some/other/path" + describe "when links are managed" do + before do + @file = Puppet::FileServing::Metadata.new("/base/path/my/file", :links => :manage) + File.expects(:lstat).with("/base/path/my/file").returns stub("stat", :uid => 1, :gid => 2, :ftype => "link", :mode => 0755) + File.expects(:readlink).with("/base/path/my/file").returns "/some/other/path" - file.collect - file.destination.should == "/some/other/path" + @checksum = Digest::MD5.hexdigest("some content\n") # Remove these when :managed links are no longer checksumed. + @file.stubs(:md5_file).returns(@checksum) # + end + it "should store the destination of the link in :destination if links are :manage" do + @file.collect + @file.destination.should == "/some/other/path" + end + it "should not collect the checksum if links are :manage" do + pending "We'd like this to be true, but we need to always collect the checksum because in the server/client/server round trip we lose the distintion between manage and follow." + @file.collect + @file.checksum.should be_nil + end + it "should collect the checksum if links are :manage" do # see pending note above + @file.collect + @file.checksum.should == "{md5}#{@checksum}" + end end - it "should not collect the checksum" do - file = Puppet::FileServing::Metadata.new("/base/path/my/file", :links => :manage) - - File.expects(:lstat).with("/base/path/my/file").returns stub("stat", :uid => 1, :gid => 2, :ftype => "link", :mode => 0755) - File.expects(:readlink).with("/base/path/my/file").returns "/some/other/path" - - file.collect - file.checksum.should be_nil + describe "when links are followed" do + before do + @file = Puppet::FileServing::Metadata.new("/base/path/my/file", :links => :follow) + File.expects(:stat).with("/base/path/my/file").returns stub("stat", :uid => 1, :gid => 2, :ftype => "file", :mode => 0755) + File.expects(:readlink).with("/base/path/my/file").never + @checksum = Digest::MD5.hexdigest("some content\n") + @file.stubs(:md5_file).returns(@checksum) + end + it "should not store the destination of the link in :destination if links are :follow" do + @file.collect + @file.destination.should be_nil + end + it "should collect the checksum if links are :follow" do + @file.collect + @file.checksum.should == "{md5}#{@checksum}" + end end end diff -Nru puppet-0.25.1/spec/unit/file_serving/mount/file.rb puppet-0.25.4/spec/unit/file_serving/mount/file.rb --- puppet-0.25.1/spec/unit/file_serving/mount/file.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/file_serving/mount/file.rb 2010-01-29 21:32:27.000000000 +0000 @@ -107,6 +107,14 @@ @mount.complete_path("/my/path", nil).should be_nil end + it "should write a log message if the file is absent" do + FileTest.stubs(:exist?).returns(false) + + Puppet.expects(:info).with("File does not exist or is not accessible: /mount/my/path") + + @mount.complete_path("/my/path", nil) + end + it "should return the file path if the file is present" do FileTest.stubs(:exist?).with("/my/path").returns(true) @mount.complete_path("/my/path", nil).should == "/mount/my/path" diff -Nru puppet-0.25.1/spec/unit/indirector/catalog/active_record.rb puppet-0.25.4/spec/unit/indirector/catalog/active_record.rb --- puppet-0.25.1/spec/unit/indirector/catalog/active_record.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/indirector/catalog/active_record.rb 2010-01-29 21:32:27.000000000 +0000 @@ -76,9 +76,12 @@ describe "when saving an instance" do before do - @host = stub 'host', :name => "foo", :save => nil, :merge_resources => nil, :last_compile= => nil + @host = stub 'host', :name => "foo", :save => nil, :merge_resources => nil, :last_compile= => nil, :ip= => nil, :environment= => nil @host.stubs(:railsmark).yields + @node = stub_everything 'node', :parameters => {} + Puppet::Node.stubs(:find).returns(@node) + Puppet::Rails::Host.stubs(:find_by_name).returns @host @catalog = Puppet::Resource::Catalog.new("foo") @request = stub 'request', :key => "foo", :instance => @catalog @@ -105,6 +108,22 @@ @terminus.save(@request) end + it "should set host ip if we could find a matching node" do + @node.stubs(:parameters).returns({"ipaddress" => "192.168.0.1"}) + + @host.expects(:ip=).with '192.168.0.1' + + @terminus.save(@request) + end + + it "should set host environment if we could find a matching node" do + @node.stubs(:environment).returns("myenv") + + @host.expects(:environment=).with 'myenv' + + @terminus.save(@request) + end + it "should set the last compile time on the host" do now = Time.now Time.expects(:now).returns now diff -Nru puppet-0.25.1/spec/unit/indirector/catalog/compiler.rb puppet-0.25.4/spec/unit/indirector/catalog/compiler.rb --- puppet-0.25.1/spec/unit/indirector/catalog/compiler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/indirector/catalog/compiler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -61,7 +61,7 @@ describe "when finding catalogs" do before do Facter.stubs(:value).returns("whatever") - env = stub 'environment', :name => "yay" + env = stub 'environment', :name => "yay", :modulepath => [] Puppet::Node::Environment.stubs(:new).returns(env) @compiler = Puppet::Resource::Catalog::Compiler.new @@ -111,6 +111,7 @@ end it "should extract and save any facts from the request" do + Puppet::Node.expects(:find).with(@name).returns @node @compiler.expects(:extract_facts_from_request).with(@request) @compiler.interpreter.stubs(:compile) @compiler.find(@request) diff -Nru puppet-0.25.1/spec/unit/indirector/indirection.rb puppet-0.25.4/spec/unit/indirector/indirection.rb --- puppet-0.25.1/spec/unit/indirector/indirection.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/indirector/indirection.rb 2010-01-29 21:32:27.000000000 +0000 @@ -536,7 +536,7 @@ @indirection.expire("/my/key") end - it "should log that it is expiring any found instance" do + it "should log when expiring a found instance" do @cache.expects(:find).returns @cached @cache.stubs(:save) @@ -545,33 +545,44 @@ @indirection.expire("/my/key") end - it "should set the cached instance's expiration to a time in the past" do - @cache.expects(:find).returns @cached - @cache.stubs(:save) + describe "and the terminus supports removal of cache items with destroy" do + it "should destroy the cached instance" do + @cache.expects(:find).returns @cached + @cache.expects(:destroy).with { |r| r.method == :destroy and r.key == "/my/key" } + @cache.expects(:save).never + @indirection.expire("/my/key") + end + end - @cached.expects(:expiration=).with { |t| t < Time.now } + describe "and the terminus does not support removal of cache items with destroy" do + it "should set the cached instance's expiration to a time in the past" do + @cache.expects(:find).returns @cached + @cache.stubs(:save) - @indirection.expire("/my/key") - end + @cached.expects(:expiration=).with { |t| t < Time.now } - it "should save the now expired instance back into the cache" do - @cache.expects(:find).returns @cached + @indirection.expire("/my/key") + end - @cached.expects(:expiration=).with { |t| t < Time.now } + it "should save the now expired instance back into the cache" do + @cache.expects(:find).returns @cached - @cache.expects(:save) + @cached.expects(:expiration=).with { |t| t < Time.now } - @indirection.expire("/my/key") - end + @cache.expects(:save) - it "should use a request to save the expired resource to the cache" do - @cache.expects(:find).returns @cached + @indirection.expire("/my/key") + end - @cached.expects(:expiration=).with { |t| t < Time.now } + it "should use a request to save the expired resource to the cache" do + @cache.expects(:find).returns @cached - @cache.expects(:save).with { |r| r.is_a?(Puppet::Indirector::Request) and r.instance == @cached and r.method == :save }.returns(@cached) + @cached.expects(:expiration=).with { |t| t < Time.now } - @indirection.expire("/my/key") + @cache.expects(:save).with { |r| r.is_a?(Puppet::Indirector::Request) and r.instance == @cached and r.method == :save }.returns(@cached) + + @indirection.expire("/my/key") + end end end end diff -Nru puppet-0.25.1/spec/unit/indirector/node/ldap.rb puppet-0.25.4/spec/unit/indirector/node/ldap.rb --- puppet-0.25.1/spec/unit/indirector/node/ldap.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/indirector/node/ldap.rb 2010-01-29 21:32:27.000000000 +0000 @@ -38,7 +38,7 @@ # This heavily tests our entry2hash method, so we don't have to stub out the stupid entry information any more. describe "when an ldap entry is found" do before do - @entry = stub 'entry', :dn => 'cn=mynode.domain.com,ou=hosts,dc=madstop,dc=com', :vals => %w{}, :to_hash => {} + @entry = stub 'entry', :dn => 'cn=mynode,ou=hosts,dc=madstop,dc=com', :vals => %w{}, :to_hash => {} @searcher.stubs(:ldapsearch).yields @entry end @@ -46,8 +46,12 @@ @searcher.entry2hash(@entry).should be_instance_of(Hash) end - it "should add the entry's common name to the hash" do - @searcher.entry2hash(@entry)[:name].should == "mynode.domain.com" + it "should add the entry's common name to the hash if fqdn if false" do + @searcher.entry2hash(@entry,fqdn = false)[:name].should == "mynode" + end + + it "should add the entry's fqdn name to the hash if fqdn if true" do + @searcher.entry2hash(@entry,fqdn = true)[:name].should == "mynode.madstop.com" end it "should add all of the entry's classes to the hash" do @@ -341,13 +345,13 @@ it "should process each found entry" do # .yields can't be used to yield multiple values :/ @searcher.expects(:ldapsearch).yields("one") - @searcher.expects(:entry2hash).with("one").returns(:name => "foo") + @searcher.expects(:entry2hash).with("one",nil).returns(:name => "foo") @searcher.search @request end it "should return a node for each processed entry with the name from the entry" do @searcher.expects(:ldapsearch).yields("whatever") - @searcher.expects(:entry2hash).with("whatever").returns(:name => "foo") + @searcher.expects(:entry2hash).with("whatever",nil).returns(:name => "foo") result = @searcher.search(@request) result[0].should be_instance_of(Puppet::Node) result[0].name.should == "foo" @@ -358,7 +362,17 @@ Puppet::Node.expects(:new).with("foo").returns node node.expects(:fact_merge) @searcher.stubs(:ldapsearch).yields("one") - @searcher.stubs(:entry2hash).with("one").returns(:name => "foo") + @searcher.stubs(:entry2hash).with("one",nil).returns(:name => "foo") + @searcher.search(@request) + end + + it "should pass the request's fqdn option to entry2hash" do + node = mock 'node' + @options[:fqdn] = :hello + Puppet::Node.stubs(:new).with("foo").returns node + node.stubs(:fact_merge) + @searcher.stubs(:ldapsearch).yields("one") + @searcher.expects(:entry2hash).with("one",:hello).returns(:name => "foo") @searcher.search(@request) end end diff -Nru puppet-0.25.1/spec/unit/network/authstore.rb puppet-0.25.4/spec/unit/network/authstore.rb --- puppet-0.25.1/spec/unit/network/authstore.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/network/authstore.rb 2010-01-29 21:32:27.000000000 +0000 @@ -83,6 +83,181 @@ end end + [ + "02001:0000:1234:0000:0000:C1C0:ABCD:0876", + "2001:0000:1234:0000:00001:C1C0:ABCD:0876", + " 2001:0000:1234:0000:0000:C1C0:ABCD:0876  0", + "2001:0000:1234: 0000:0000:C1C0:ABCD:0876", + "3ffe:0b00:0000:0001:0000:0000:000a", + "FF02:0000:0000:0000:0000:0000:0000:0000:0001", + "3ffe:b00::1::a", + "1:2:3::4:5::7:8", + "12345::6:7:8", + "1::5:400.2.3.4", + "1::5:260.2.3.4", + "1::5:256.2.3.4", + "1::5:1.256.3.4", + "1::5:1.2.256.4", + "1::5:1.2.3.256", + "1::5:300.2.3.4", + "1::5:1.300.3.4", + "1::5:1.2.300.4", + "1::5:1.2.3.300", + "1::5:900.2.3.4", + "1::5:1.900.3.4", + "1::5:1.2.900.4", + "1::5:1.2.3.900", + "1::5:300.300.300.300", + "1::5:3000.30.30.30", + "1::400.2.3.4", + "1::260.2.3.4", + "1::256.2.3.4", + "1::1.256.3.4", + "1::1.2.256.4", + "1::1.2.3.256", + "1::300.2.3.4", + "1::1.300.3.4", + "1::1.2.300.4", + "1::1.2.3.300", + "1::900.2.3.4", + "1::1.900.3.4", + "1::1.2.900.4", + "1::1.2.3.900", + "1::300.300.300.300", + "1::3000.30.30.30", + "::400.2.3.4", + "::260.2.3.4", + "::256.2.3.4", + "::1.256.3.4", + "::1.2.256.4", + "::1.2.3.256", + "::300.2.3.4", + "::1.300.3.4", + "::1.2.300.4", + "::1.2.3.300", + "::900.2.3.4", + "::1.900.3.4", + "::1.2.900.4", + "::1.2.3.900", + "::300.300.300.300", + "::3000.30.30.30", + "2001:DB8:0:0:8:800:200C:417A:221", # unicast, full + "FF01::101::2" # multicast, compressed + ].each { |invalid_ip| + describe "when the pattern is an invalid IPv6 address such as #{invalid_ip}" do + it "should raise an exception" do + lambda { Puppet::Network::AuthStore::Declaration.new(:allow,invalid_ip) }.should raise_error + end + end + } + + [ + "1.2.3.4", + "2001:0000:1234:0000:0000:C1C0:ABCD:0876", + "3ffe:0b00:0000:0000:0001:0000:0000:000a", + "FF02:0000:0000:0000:0000:0000:0000:0001", + "0000:0000:0000:0000:0000:0000:0000:0001", + "0000:0000:0000:0000:0000:0000:0000:0000", + "::ffff:192.168.1.26", + "2::10", + "ff02::1", + "fe80::", + "2002::", + "2001:db8::", + "2001:0db8:1234::", + "::ffff:0:0", + "::1", + "::ffff:192.168.1.1", + "1:2:3:4:5:6:7:8", + "1:2:3:4:5:6::8", + "1:2:3:4:5::8", + "1:2:3:4::8", + "1:2:3::8", + "1:2::8", + "1::8", + "1::2:3:4:5:6:7", + "1::2:3:4:5:6", + "1::2:3:4:5", + "1::2:3:4", + "1::2:3", + "1::8", + "::2:3:4:5:6:7:8", + "::2:3:4:5:6:7", + "::2:3:4:5:6", + "::2:3:4:5", + "::2:3:4", + "::2:3", + "::8", + "1:2:3:4:5:6::", + "1:2:3:4:5::", + "1:2:3:4::", + "1:2:3::", + "1:2::", + "1::", + "1:2:3:4:5::7:8", + "1:2:3:4::7:8", + "1:2:3::7:8", + "1:2::7:8", + "1::7:8", + "1:2:3:4:5:6:1.2.3.4", + "1:2:3:4:5::1.2.3.4", + "1:2:3:4::1.2.3.4", + "1:2:3::1.2.3.4", + "1:2::1.2.3.4", + "1::1.2.3.4", + "1:2:3:4::5:1.2.3.4", + "1:2:3::5:1.2.3.4", + "1:2::5:1.2.3.4", + "1::5:1.2.3.4", + "1::5:11.22.33.44", + "fe80::217:f2ff:254.7.237.98", + "fe80::217:f2ff:fe07:ed62", + "2001:DB8:0:0:8:800:200C:417A", # unicast, full + "FF01:0:0:0:0:0:0:101", # multicast, full + "0:0:0:0:0:0:0:1", # loopback, full + "0:0:0:0:0:0:0:0", # unspecified, full + "2001:DB8::8:800:200C:417A", # unicast, compressed + "FF01::101", # multicast, compressed + "::1", # loopback, compressed, non-routable + "::", # unspecified, compressed, non-routable + "0:0:0:0:0:0:13.1.68.3", # IPv4-compatible IPv6 address, full, deprecated + "0:0:0:0:0:FFFF:129.144.52.38", # IPv4-mapped IPv6 address, full + "::13.1.68.3", # IPv4-compatible IPv6 address, compressed, deprecated + "::FFFF:129.144.52.38", # IPv4-mapped IPv6 address, compressed + "2001:0DB8:0000:CD30:0000:0000:0000:0000/60", # full, with prefix + "2001:0DB8::CD30:0:0:0:0/60", # compressed, with prefix + "2001:0DB8:0:CD30::/60", # compressed, with prefix #2 + "::/128", # compressed, unspecified address type, non-routable + "::1/128", # compressed, loopback address type, non-routable + "FF00::/8", # compressed, multicast address type + "FE80::/10", # compressed, link-local unicast, non-routable + "FEC0::/10", # compressed, site-local unicast, deprecated + "127.0.0.1", # standard IPv4, loopback, non-routable + "0.0.0.0", # standard IPv4, unspecified, non-routable + "255.255.255.255", # standard IPv4 + "fe80:0000:0000:0000:0204:61ff:fe9d:f156", + "fe80:0:0:0:204:61ff:fe9d:f156", + "fe80::204:61ff:fe9d:f156", + "fe80:0000:0000:0000:0204:61ff:254.157.241.086", + "fe80:0:0:0:204:61ff:254.157.241.86", + "fe80::204:61ff:254.157.241.86", + "::1", + "fe80::", + "fe80::1" + ].each { |ip| + describe "when the pattern is a valid IP such as #{ip}" do + before :each do + @declaration = Puppet::Network::AuthStore::Declaration.new(:allow,ip) + end + it "should match the specified IP" do + @declaration.should be_match('www.testsite.org',ip) + end + it "should not match other IPs" do + @declaration.should_not be_match('www.testsite.org','200.101.99.98') + end + end unless ip =~ /:.*\./ # Hybrid IPs aren't supported by ruby's ipaddr + } + { 'spirit.mars.nasa.gov' => 'a PQDN', 'ratchet.2ndsiteinc.com' => 'a PQDN with digits', @@ -103,6 +278,28 @@ end } + ['abc.12seps.edu.phisher.biz','www.google.com','slashdot.org'].each { |host| + (1...(host.split('.').length)).each { |n| + describe "when the pattern is #{"*."+host.split('.')[-n,n].join('.')}" do + before :each do + @pattern = "*."+host.split('.')[-n,n].join('.') + @declaration = Puppet::Network::AuthStore::Declaration.new(:allow,@pattern) + end + it "should match #{host}" do + @declaration.should be_match(host,'1.2.3.4') + end + it "should not match www.testsite.gov" do + @declaration.should_not be_match('www.testsite.gov','200.101.99.98') + end + it "should not match hosts that differ in the first non-wildcard segment" do + other = host.split('.') + other[-n].succ! + @declaration.should_not be_match(other.join('.'),'1.2.3.4') + end + end + } + } + describe "when the pattern is a FQDN" do before :each do @host = 'spirit.mars.nasa.gov.' diff -Nru puppet-0.25.1/spec/unit/network/format_handler.rb puppet-0.25.4/spec/unit/network/format_handler.rb --- puppet-0.25.1/spec/unit/network/format_handler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/network/format_handler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -49,15 +49,35 @@ FormatTester.supported_formats.should == [:four, :two, :three, :one] end - it "should always put the preferred serialization format first if it is supported" do - one = stub 'supported', :supported? => true, :name => :one, :weight => 1 - two = stub 'supported', :supported? => true, :name => :two, :weight => 6 - - Puppet.settings.expects(:value).with(:preferred_serialization_format).returns :one - Puppet::Network::FormatHandler.stubs(:formats).returns [:one, :two] - Puppet::Network::FormatHandler.stubs(:format).with(:one).returns one - Puppet::Network::FormatHandler.stubs(:format).with(:two).returns two - FormatTester.supported_formats.should == [:one, :two] + + describe "with a preferred serialization format setting" do + before do + one = stub 'supported', :supported? => true, :name => :one, :weight => 1 + two = stub 'supported', :supported? => true, :name => :two, :weight => 6 + Puppet::Network::FormatHandler.stubs(:formats).returns [:one, :two] + Puppet::Network::FormatHandler.stubs(:format).with(:one).returns one + Puppet::Network::FormatHandler.stubs(:format).with(:two).returns two + end + describe "that is supported" do + before do + Puppet.settings.expects(:value).with(:preferred_serialization_format).returns :one + end + it "should return the preferred serialization format first" do + FormatTester.supported_formats.should == [:one, :two] + end + end + describe "that is not supported" do + before do + Puppet.settings.expects(:value).with(:preferred_serialization_format).returns :unsupported + end + it "should still return the default format first" do + FormatTester.supported_formats.should == [:two, :one] + end + it "should log a warning" do + Puppet.expects(:warning) + FormatTester.supported_formats + end + end end it "should return the first format as the default format" do diff -Nru puppet-0.25.1/spec/unit/network/formats.rb puppet-0.25.4/spec/unit/network/formats.rb --- puppet-0.25.1/spec/unit/network/formats.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/network/formats.rb 2010-01-29 21:32:27.000000000 +0000 @@ -91,6 +91,9 @@ end describe "base64 compressed yaml" do + yaml = Puppet::Network::FormatHandler.format(:b64_zlib_yaml) + confine "We must have zlib" => Puppet.features.zlib? + before do @yaml = Puppet::Network::FormatHandler.format(:b64_zlib_yaml) end @@ -173,6 +176,34 @@ it "should fixup incorrect yaml to correct" do @yaml.fixup("&id004 !ruby/object:Puppet::Relationship ?").should == "? &id004 !ruby/object:Puppet::Relationship" end + + describe "when zlib is disabled" do + before do + Puppet[:zlib] = false + end + + it "use_zlib? should return false" do + @yaml.use_zlib?.should == false + end + + it "should refuse to encode" do + lambda{ @yaml.encode("foo") }.should raise_error + end + + it "should refuse to decode" do + lambda{ @yaml.decode("foo") }.should raise_error + end + end + + describe "when zlib is not installed" do + it "use_zlib? should return false" do + Puppet[:zlib] = true + Puppet.features.expects(:zlib?).returns(false) + + @yaml.use_zlib?.should == false + end + end + end it "should include a marshal format" do diff -Nru puppet-0.25.1/spec/unit/network/http/handler.rb puppet-0.25.4/spec/unit/network/http/handler.rb --- puppet-0.25.1/spec/unit/network/http/handler.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/network/http/handler.rb 2010-01-29 21:32:27.000000000 +0000 @@ -230,6 +230,16 @@ @handler.do_find(@irequest, @request, @response) end + it "should write a log message when no model instance can be found" do + @model_class.stubs(:name).returns "my name" + @model_class.stubs(:find).returns(nil) + + Puppet.expects(:info).with("Could not find my_handler for 'my_result'") + + @handler.do_find(@irequest, @request, @response) + end + + it "should serialize the result in with the appropriate format" do @model_instance = stub('model instance') diff -Nru puppet-0.25.1/spec/unit/network/http/webrick.rb puppet-0.25.4/spec/unit/network/http/webrick.rb --- puppet-0.25.1/spec/unit/network/http/webrick.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/network/http/webrick.rb 2010-01-29 21:32:27.000000000 +0000 @@ -15,7 +15,7 @@ describe Puppet::Network::HTTP::WEBrick, "when turning on listening" do before do - @mock_webrick = stub('webrick', :[] => {}) + @mock_webrick = stub('webrick', :[] => {}, :listeners => [], :status => :Running) [:mount, :start, :shutdown].each {|meth| @mock_webrick.stubs(meth)} WEBrick::HTTPServer.stubs(:new).returns(@mock_webrick) @server = Puppet::Network::HTTP::WEBrick.new @@ -162,7 +162,7 @@ describe Puppet::Network::HTTP::WEBrick, "when turning off listening" do before do - @mock_webrick = stub('webrick', :[] => {}) + @mock_webrick = stub('webrick', :[] => {}, :listeners => [], :status => :Running) [:mount, :start, :shutdown].each {|meth| @mock_webrick.stubs(meth)} WEBrick::HTTPServer.stubs(:new).returns(@mock_webrick) @server = Puppet::Network::HTTP::WEBrick.new diff -Nru puppet-0.25.1/spec/unit/network/rest_authconfig.rb puppet-0.25.4/spec/unit/network/rest_authconfig.rb --- puppet-0.25.1/spec/unit/network/rest_authconfig.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/network/rest_authconfig.rb 2010-01-29 21:32:27.000000000 +0000 @@ -84,7 +84,7 @@ end DEFAULT_ACL.each do |acl| - it "should insert #{acl} if not present" do + it "should insert #{acl[:acl]} if not present" do @authconfig.rights.stubs(:[]).returns(true) @authconfig.rights.stubs(:[]).with(acl[:acl]).returns(nil) @@ -93,7 +93,7 @@ @authconfig.insert_default_acl end - it "should not insert #{acl} if present" do + it "should not insert #{acl[:acl]} if present" do @authconfig.rights.stubs(:[]).returns(true) @authconfig.rights.stubs(:[]).with(acl).returns(true) diff -Nru puppet-0.25.1/spec/unit/network/rights.rb puppet-0.25.4/spec/unit/network/rights.rb --- puppet-0.25.1/spec/unit/network/rights.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/network/rights.rb 2010-01-29 21:32:27.000000000 +0000 @@ -391,7 +391,7 @@ end it "should match as a regex" do - @acl.match?("this shoud work.rb").should_not be_nil + @acl.match?("this should work.rb").should_not be_nil end it "should return nil if no match" do diff -Nru puppet-0.25.1/spec/unit/node/environment.rb puppet-0.25.4/spec/unit/node/environment.rb --- puppet-0.25.1/spec/unit/node/environment.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/node/environment.rb 2010-01-29 21:32:27.000000000 +0000 @@ -22,6 +22,10 @@ Puppet::Node::Environment.attr_ttl(:modules).should == Integer(Puppet[:filetimeout]) end + it "should use the filetimeout for the ttl for the manifestdir" do + Puppet::Node::Environment.attr_ttl(:manifestdir).should == Integer(Puppet[:filetimeout]) + end + it "should use the default environment if no name is provided while initializing an environment" do Puppet.settings.expects(:value).with(:environment).returns("one") Puppet::Node::Environment.new().name.should == :one @@ -39,45 +43,57 @@ Puppet::Node::Environment.new(:one).to_s.should == "one" end - it "should consider its module path to be the environment-specific modulepath setting" do - FileTest.stubs(:directory?).returns true - env = Puppet::Node::Environment.new("testing") - module_path = %w{/one /two}.join(File::PATH_SEPARATOR) - env.expects(:[]).with(:modulepath).returns module_path + [:modulepath, :manifestdir].each do |setting| + it "should validate the #{setting} directories" do + path = %w{/one /two}.join(File::PATH_SEPARATOR) + + env = Puppet::Node::Environment.new("testing") + env.stubs(:[]).with(setting).returns path + + env.expects(:validate_dirs).with(%w{/one /two}) + + env.send(setting) + end + + it "should return the validated dirs for #{setting}" do + path = %w{/one /two}.join(File::PATH_SEPARATOR) - env.modulepath.should == %w{/one /two} + env = Puppet::Node::Environment.new("testing") + env.stubs(:[]).with(setting).returns path + env.stubs(:validate_dirs).returns %w{/one /two} + + env.send(setting).should == %w{/one /two} + end end it "should prefix the value of the 'PUPPETLIB' environment variable to the module path if present" do - FileTest.stubs(:directory?).returns true Puppet::Util::Execution.withenv("PUPPETLIB" => %w{/l1 /l2}.join(File::PATH_SEPARATOR)) do env = Puppet::Node::Environment.new("testing") module_path = %w{/one /two}.join(File::PATH_SEPARATOR) + env.expects(:validate_dirs).with(%w{/l1 /l2 /one /two}).returns %w{/l1 /l2 /one /two} env.expects(:[]).with(:modulepath).returns module_path env.modulepath.should == %w{/l1 /l2 /one /two} end end - it "should not return non-directories in the module path" do - env = Puppet::Node::Environment.new("testing") - module_path = %w{/one /two}.join(File::PATH_SEPARATOR) - env.expects(:[]).with(:modulepath).returns module_path + describe "when validating modulepath or manifestdir directories" do + it "should not return non-directories" do + env = Puppet::Node::Environment.new("testing") - FileTest.expects(:directory?).with("/one").returns true - FileTest.expects(:directory?).with("/two").returns false + FileTest.expects(:directory?).with("/one").returns true + FileTest.expects(:directory?).with("/two").returns false - env.modulepath.should == %w{/one} - end + env.validate_dirs(%w{/one /two}).should == %w{/one} + end - it "should use the current working directory to fully-qualify unqualified paths" do - FileTest.stubs(:directory?).returns true - env = Puppet::Node::Environment.new("testing") - module_path = %w{/one two}.join(File::PATH_SEPARATOR) - env.expects(:[]).with(:modulepath).returns module_path + it "should use the current working directory to fully-qualify unqualified paths" do + FileTest.stubs(:directory?).returns true + env = Puppet::Node::Environment.new("testing") - two = File.join(Dir.getwd, "two") - env.modulepath.should == ["/one", two] + two = File.join(Dir.getwd, "two") + env.validate_dirs(%w{/one two}).should == ["/one", two] + end end describe "when modeling a specific environment" do @@ -155,7 +171,7 @@ env.expects(:modulepath).returns %w{/a} Dir.expects(:entries).with("/a").returns %w{foo} - env.modules.should be_all{|mod| mod.environment == "testing" } + env.modules.each {|mod| mod.environment.should == env } end it "should cache the module list" do diff -Nru puppet-0.25.1/spec/unit/other/selinux.rb puppet-0.25.4/spec/unit/other/selinux.rb --- puppet-0.25.1/spec/unit/other/selinux.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/other/selinux.rb 2010-01-29 21:32:27.000000000 +0000 @@ -28,7 +28,7 @@ describe Puppet::Type.type(:selboolean), " when manipulating booleans" do before :each do provider_class = Puppet::Type::Selboolean.provider(Puppet::Type::Selboolean.providers[0]) - Puppet::Type::Selboolean.expects(:defaultprovider).returns provider_class + Puppet::Type::Selboolean.stubs(:defaultprovider).returns provider_class @bool = Puppet::Type::Selboolean.new( :name => "foo", @@ -57,7 +57,7 @@ describe Puppet::Type.type(:selmodule), " when checking policy modules" do before :each do provider_class = Puppet::Type::Selmodule.provider(Puppet::Type::Selmodule.providers[0]) - Puppet::Type::Selmodule.expects(:defaultprovider).returns provider_class + Puppet::Type::Selmodule.stubs(:defaultprovider).returns provider_class @module = Puppet::Type::Selmodule.new( :name => "foo", diff -Nru puppet-0.25.1/spec/unit/parameter.rb puppet-0.25.4/spec/unit/parameter.rb --- puppet-0.25.1/spec/unit/parameter.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/parameter.rb 2010-01-29 21:32:27.000000000 +0000 @@ -44,6 +44,14 @@ @parameter.tags.should == %w{one two foo} end + it "should provide source_descriptors" do + @resource.expects(:line).returns 10 + @resource.expects(:file).returns "file" + @resource.expects(:tags).returns %w{one two} + @resource.expects(:version).returns 50 + @parameter.source_descriptors.should == {:tags=>["one", "two", "foo"], :path=>"//foo", :version=>50, :file => "file", :line => 10} + end + describe "when returning the value" do it "should return nil if no value is set" do @parameter.value.should be_nil diff -Nru puppet-0.25.1/spec/unit/parser/ast/leaf.rb puppet-0.25.4/spec/unit/parser/ast/leaf.rb --- puppet-0.25.1/spec/unit/parser/ast/leaf.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/parser/ast/leaf.rb 2010-01-29 21:32:27.000000000 +0000 @@ -72,6 +72,15 @@ end end +describe Puppet::Parser::AST::Variable do + describe "when converting to string" do + it "should transform its value to a variable" do + value = stub 'value', :is_a? => true, :to_s => "myvar" + Puppet::Parser::AST::Variable.new( :value => value ).to_s.should == "\$myvar" + end + end +end + describe Puppet::Parser::AST::Regex do before :each do @scope = stub 'scope' diff -Nru puppet-0.25.1/spec/unit/parser/ast/selector.rb puppet-0.25.4/spec/unit/parser/ast/selector.rb --- puppet-0.25.1/spec/unit/parser/ast/selector.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/parser/ast/selector.rb 2010-01-29 21:32:27.000000000 +0000 @@ -151,6 +151,13 @@ @selector.evaluate(@scope) end end - + end + describe "when converting to string" do + it "should produce a string version of this selector" do + values = Puppet::Parser::AST::ASTArray.new :children => [ Puppet::Parser::AST::ResourceParam.new(:param => "type", :value => "value", :add => false) ] + param = Puppet::Parser::AST::Variable.new :value => "myvar" + selector = Puppet::Parser::AST::Selector.new :param => param, :values => values + selector.to_s.should == "$myvar ? { type => value }" + end end end diff -Nru puppet-0.25.1/spec/unit/parser/lexer.rb puppet-0.25.4/spec/unit/parser/lexer.rb --- puppet-0.25.1/spec/unit/parser/lexer.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/parser/lexer.rb 2010-01-29 21:32:27.000000000 +0000 @@ -5,7 +5,7 @@ require 'puppet/parser/lexer' # This is a special matcher to match easily lexer output -Spec::Matchers.create :be_like do |ary| +Spec::Matchers.define :be_like do |ary| match do |result| r = true result.zip(ary) do |a,b| diff -Nru puppet-0.25.1/spec/unit/parser/resource/reference.rb puppet-0.25.4/spec/unit/parser/resource/reference.rb --- puppet-0.25.1/spec/unit/parser/resource/reference.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/parser/resource/reference.rb 2010-01-29 21:32:27.000000000 +0000 @@ -40,10 +40,22 @@ ref.to_s.should == "File[/tmp/yay]" end - it "should canonize resource references" do + it "should canonize resource reference types" do ref = @type.new(:type => "foo::bar", :title => "/tmp/yay") ref.to_s.should == "Foo::Bar[/tmp/yay]" end + + it "should canonize resource reference values" do + ref = @type.new(:type => "file", :title => "/tmp/yay/") + ref.to_s.should == "File[/tmp/yay]" + end + + it "should canonize resource reference values without order dependencies" do + args = [[:title, "/tmp/yay/"], [:type, "file"]] + ref = @type.new(args) + ref.to_s.should == "File[/tmp/yay]" + end + end describe Puppet::Parser::Resource::Reference, " when modeling defined types" do diff -Nru puppet-0.25.1/spec/unit/parser/resource.rb puppet-0.25.4/spec/unit/parser/resource.rb --- puppet-0.25.1/spec/unit/parser/resource.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/parser/resource.rb 2010-01-29 21:32:27.000000000 +0000 @@ -101,6 +101,17 @@ end end + describe "when refering to a resource with name canonicalization" do + before do + @arguments = {:type => "file", :title => "/path/", :scope => stub('scope', :source => mock('source'))} + end + + it "should canonicalize its own name" do + res = Puppet::Parser::Resource.new(@arguments) + res.ref.should == "File[/path]" + end + end + describe "when evaluating" do before do @type = Puppet::Parser::Resource diff -Nru puppet-0.25.1/spec/unit/property.rb puppet-0.25.4/spec/unit/property.rb --- puppet-0.25.1/spec/unit/property.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/property.rb 2010-01-29 21:32:27.000000000 +0000 @@ -101,6 +101,12 @@ @property.should.must == [:one, :two] end + it "should munge the canonicalization of the value" do + @property.class.to_canonicalize { |x| x.reverse } + @property.value = 'data' + @property.should.must == 'atad' + end + it "should return any set value" do (@property.value = :one).should == :one end diff -Nru puppet-0.25.1/spec/unit/provider/mount/parsed.rb puppet-0.25.4/spec/unit/provider/mount/parsed.rb --- puppet-0.25.1/spec/unit/provider/mount/parsed.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/provider/mount/parsed.rb 2010-01-29 21:32:27.000000000 +0000 @@ -108,6 +108,15 @@ end Puppet::Type.type(:mount).provider(:parsed).default_target.should == should end + + it "should not crash on incomplete lines in fstab" do + parse = @provider_class.parse <<-FSTAB +/dev/incomplete +/dev/device name + FSTAB + + lambda{ @provider_class.to_line(parse[0]) }.should_not raise_error + end end describe provider_class, " when mounting an absent filesystem" do @@ -140,10 +149,12 @@ end it "should write the mount to disk when :flush is called" do + old_text = @provider_class.target_object(@provider_class.default_target).read + @mount.flush text = @provider_class.target_object(@provider_class.default_target).read - text.should == @mount.class.to_line(@mount.property_hash) + "\n" + text.should == old_text + @mount.class.to_line(@mount.property_hash) + "\n" end end diff -Nru puppet-0.25.1/spec/unit/provider/service/debian.rb puppet-0.25.4/spec/unit/provider/service/debian.rb --- puppet-0.25.1/spec/unit/provider/service/debian.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/provider/service/debian.rb 2010-01-29 21:32:27.000000000 +0000 @@ -60,7 +60,7 @@ describe "when checking whether it is enabled" do it "should call Kernel.system() with the appropriate parameters" do - @provider.expects(:system).with("/usr/sbin/invoke-rc.d", "--query", @resource[:name], "start").once + @provider.expects(:system).with("/usr/sbin/invoke-rc.d", "--quiet", "--query", @resource[:name], "start").once @provider.enabled? end diff -Nru puppet-0.25.1/spec/unit/provider/service/init.rb puppet-0.25.4/spec/unit/provider/service/init.rb --- puppet-0.25.1/spec/unit/provider/service/init.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/provider/service/init.rb 2010-01-29 21:32:27.000000000 +0000 @@ -16,12 +16,26 @@ # @resource.stubs(:[]).with(:ensure).returns :enabled @resource.stubs(:[]).with(:path).returns ["/service/path","/alt/service/path"] # @resource.stubs(:ref).returns "Service[myservice]" + File.stubs(:directory?).returns(true) @provider = provider_class.new @provider.resource = @resource end - describe "when serching for the init script" do + + describe "when searching for the init script" do + it "should discard paths that do not exist" do + File.stubs(:exist?).returns(false) + File.stubs(:directory?).returns(false) + @provider.paths.should be_empty + end + + it "should discard paths that are not directories" do + File.stubs(:exist?).returns(true) + File.stubs(:directory?).returns(false) + @provider.paths.should be_empty + end + it "should be able to find the init script in the service path" do File.expects(:stat).with("/service/path/myservice").returns true @provider.initscript.should == "/service/path/myservice" @@ -102,5 +116,6 @@ @provider.restart end end + end end diff -Nru puppet-0.25.1/spec/unit/provider/ssh_authorized_key/parsed.rb puppet-0.25.4/spec/unit/provider/ssh_authorized_key/parsed.rb --- puppet-0.25.1/spec/unit/provider/ssh_authorized_key/parsed.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/provider/ssh_authorized_key/parsed.rb 2010-01-29 21:32:27.000000000 +0000 @@ -33,7 +33,7 @@ end def genkey(key) - @provider.filetype = :ram + @provider.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam) file = @provider.default_target key.flush @@ -78,13 +78,21 @@ @provider.parse_options(optionstr).should == options end + + it "should use '' as name for entries that lack a comment" do + line = "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAut8aOSxenjOqF527dlsdHWV4MNoAsX14l9M297+SQXaQ5Z3BedIxZaoQthkDALlV/25A1COELrg9J2MqJNQc8Xe9XQOIkBQWWinUlD/BXwoOTWEy8C8zSZPHZ3getMMNhGTBO+q/O+qiJx3y5cA4MTbw2zSxukfWC87qWwcZ64UUlegIM056vPsdZWFclS9hsROVEa57YUMrehQ1EGxT4Z5j6zIopufGFiAPjZigq/vqgcAqhAKP6yu4/gwO6S9tatBeEjZ8fafvj1pmvvIplZeMr96gHE7xS3pEEQqnB3nd4RY7AF6j9kFixnsytAUO7STPh/M3pLiVQBN89TvWPQ==" + + @provider.parse(line)[0][:name].should == "" + end end describe provider_class do before :each do @resource = stub("resource", :name => "foo") @resource.stubs(:[]).returns "foo" + @provider = provider_class.new(@resource) + provider_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam) end describe "when flushing" do diff -Nru puppet-0.25.1/spec/unit/provider/sshkey/parsed.rb puppet-0.25.4/spec/unit/provider/sshkey/parsed.rb --- puppet-0.25.1/spec/unit/provider/sshkey/parsed.rb 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/spec/unit/provider/sshkey/parsed.rb 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,38 @@ +#!/usr/bin/env ruby + +require File.dirname(__FILE__) + '/../../../spec_helper' + +provider_class = Puppet::Type.type(:sshkey).provider(:parsed) + +describe provider_class do + before do + @sshkey_class = Puppet::Type.type(:sshkey) + @provider_class = @sshkey_class.provider(:parsed) + @key = 'AAAAB3NzaC1yc2EAAAABIwAAAQEAzwHhxXvIrtfIwrudFqc8yQcIfMudrgpnuh1F3AV6d2BrLgu/yQE7W5UyJMUjfj427sQudRwKW45O0Jsnr33F4mUw+GIMlAAmp9g24/OcrTiB8ZUKIjoPy/cO4coxGi8/NECtRzpD/ZUPFh6OEpyOwJPMb7/EC2Az6Otw4StHdXUYw22zHazBcPFnv6zCgPx1hA7QlQDWTu4YcL0WmTYQCtMUb3FUqrcFtzGDD0ytosgwSd+JyN5vj5UwIABjnNOHPZ62EY1OFixnfqX/+dUwrFSs5tPgBF/KkC6R7tmbUfnBON6RrGEmu+ajOTOLy23qUZB4CQ53V7nyAWhzqSK+hw==' + end + + it "should parse the name from the first field" do + @provider_class.parse_line('test ssh-rsa '+@key)[:name].should == "test" + end + + it "should parse the first component of the first field as the name" do + @provider_class.parse_line('test,alias ssh-rsa '+@key)[:name].should == "test" + end + + it "should parse host_aliases from the remaining components of the first field" do + @provider_class.parse_line('test,alias ssh-rsa '+@key)[:host_aliases].should == ["alias"] + end + + it "should parse multiple host_aliases" do + @provider_class.parse_line('test,alias1,alias2,alias3 ssh-rsa '+@key)[:host_aliases].should == ["alias1","alias2","alias3"] + end + + it "should not drop an empty host_alias" do + @provider_class.parse_line('test,alias, ssh-rsa '+@key)[:host_aliases].should == ["alias",""] + end + + it "should recognise when there are no host aliases" do + @provider_class.parse_line('test ssh-rsa '+@key)[:host_aliases].should == [] + end + +end diff -Nru puppet-0.25.1/spec/unit/rails/resource.rb puppet-0.25.4/spec/unit/rails/resource.rb --- puppet-0.25.1/spec/unit/rails/resource.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/rails/resource.rb 2010-01-29 21:32:27.000000000 +0000 @@ -84,4 +84,24 @@ @resource.merge_parser_resource(@parser) end end + + describe "merge_parameters" do + it "should replace values that have changed" do + @resource = Puppet::Rails::Resource.new + @resource.params_list = [{"name" => "replace", "value" => 1, "id" => 100 }] + + Puppet::Rails::ParamValue.expects(:delete).with([100]) + param_values = stub "param_values" + param_values.expects(:build).with({:value=>nil, :param_name=>nil, :line=>{"replace"=>2}}) + @resource.stubs(:param_values).returns(param_values) + + Puppet::Rails::ParamName.stubs(:accumulate_by_name) + + merge_resource = stub "merge_resource" + merge_resource.expects(:line).returns({ "replace" => 2 }) + merge_resource.stubs(:each).yields([["replace", 2]]) + + @resource.merge_parameters(merge_resource) + end + end end diff -Nru puppet-0.25.1/spec/unit/rails.rb puppet-0.25.4/spec/unit/rails.rb --- puppet-0.25.1/spec/unit/rails.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/rails.rb 2010-01-29 21:32:27.000000000 +0000 @@ -39,13 +39,24 @@ ActiveRecord::Base.stubs(:logger).returns(logger) logger.expects(:level=).with(Logger::DEBUG) + ActiveRecord::Base.stubs(:allow_concurrency=) ActiveRecord::Base.stubs(:verify_active_connections!) ActiveRecord::Base.stubs(:establish_connection) - Puppet::Rails.stubs(:database_arguments) + Puppet::Rails.stubs(:database_arguments).returns({}) Puppet::Rails.connect end + describe "on ActiveRecord 2.1.x" do + confine "ActiveRecord 2.1.x" => (::ActiveRecord::VERSION::MAJOR == 2 and ::ActiveRecord::VERSION::MINOR <= 1) + + it "should set ActiveRecord::Base.allow_concurrency" do + ActiveRecord::Base.expects(:allow_concurrency=).with(true) + + Puppet::Rails.connect + end + end + it "should call ActiveRecord::Base.verify_active_connections!" do ActiveRecord::Base.expects(:verify_active_connections!) @@ -53,7 +64,7 @@ end it "should call ActiveRecord::Base.establish_connection with database_arguments" do - Puppet::Rails.expects(:database_arguments) + Puppet::Rails.expects(:database_arguments).returns({}) ActiveRecord::Base.expects(:establish_connection) Puppet::Rails.connect @@ -63,15 +74,15 @@ describe Puppet::Rails, "when initializing a sqlite3 connection" do confine "Cannot test without ActiveRecord" => Puppet.features.rails? - it "should provide the adapter, log_level, and dbfile arguments" do + it "should provide the adapter, log_level, and database arguments" do Puppet.settings.expects(:value).with(:dbadapter).returns("sqlite3") Puppet.settings.expects(:value).with(:rails_loglevel).returns("testlevel") Puppet.settings.expects(:value).with(:dblocation).returns("testlocation") Puppet::Rails.database_arguments.should == { - :adapter => "sqlite3", + :adapter => "sqlite3", :log_level => "testlevel", - :dbfile => "testlocation" + :database => "testlocation" } end end @@ -79,7 +90,7 @@ describe Puppet::Rails, "when initializing a mysql or postgresql connection" do confine "Cannot test without ActiveRecord" => Puppet.features.rails? - it "should provide the adapter, log_level, and host, username, password, and database arguments" do + it "should provide the adapter, log_level, and host, username, password, database, and reconnect arguments" do Puppet.settings.stubs(:value).with(:dbadapter).returns("mysql") Puppet.settings.stubs(:value).with(:rails_loglevel).returns("testlevel") Puppet.settings.stubs(:value).with(:dbserver).returns("testserver") @@ -94,11 +105,12 @@ :host => "testserver", :username => "testuser", :password => "testpassword", - :database => "testname" + :database => "testname", + :reconnect => true } end - it "should provide the adapter, log_level, and host, username, password, database, and socket arguments" do + it "should provide the adapter, log_level, and host, username, password, database, socket, and reconnect arguments" do Puppet.settings.stubs(:value).with(:dbadapter).returns("mysql") Puppet.settings.stubs(:value).with(:rails_loglevel).returns("testlevel") Puppet.settings.stubs(:value).with(:dbserver).returns("testserver") @@ -114,7 +126,8 @@ :username => "testuser", :password => "testpassword", :database => "testname", - :socket => "testsocket" + :socket => "testsocket", + :reconnect => true } end end diff -Nru puppet-0.25.1/spec/unit/ssl/host.rb puppet-0.25.4/spec/unit/ssl/host.rb --- puppet-0.25.1/spec/unit/ssl/host.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/ssl/host.rb 2010-01-29 21:32:27.000000000 +0000 @@ -90,55 +90,6 @@ Puppet::SSL::Host.localhost.should equal(two) end - it "should be able to verify its certificate matches its key" do - Puppet::SSL::Host.new("foo").should respond_to(:certificate_matches_key?) - end - - it "should consider the certificate invalid if it cannot find a key" do - host = Puppet::SSL::Host.new("foo") - host.expects(:key).returns nil - - host.should_not be_certificate_matches_key - end - - it "should consider the certificate invalid if it cannot find a certificate" do - host = Puppet::SSL::Host.new("foo") - host.expects(:key).returns mock("key") - host.expects(:certificate).returns nil - - host.should_not be_certificate_matches_key - end - - it "should consider the certificate invalid if the SSL certificate's key verification fails" do - host = Puppet::SSL::Host.new("foo") - - key = mock 'key', :content => "private_key" - sslcert = mock 'sslcert' - certificate = mock 'cert', :content => sslcert - - host.stubs(:key).returns key - host.stubs(:certificate).returns certificate - - sslcert.expects(:check_private_key).with("private_key").returns false - - host.should_not be_certificate_matches_key - end - - it "should consider the certificate valid if the SSL certificate's key verification succeeds" do - host = Puppet::SSL::Host.new("foo") - - key = mock 'key', :content => "private_key" - sslcert = mock 'sslcert' - certificate = mock 'cert', :content => sslcert - - host.stubs(:key).returns key - host.stubs(:certificate).returns certificate - - sslcert.expects(:check_private_key).with("private_key").returns true - - host.should be_certificate_matches_key - end - describe "when specifying the CA location" do before do [Puppet::SSL::Key, Puppet::SSL::Certificate, Puppet::SSL::CertificateRequest, Puppet::SSL::CertificateRevocationList].each do |klass| @@ -408,10 +359,11 @@ describe "when managing its certificate" do before do @realcert = mock 'certificate' - @cert = stub 'cert', :content => @realcert + @realcert.stubs(:check_private_key).with('private key').returns true - @host.stubs(:key).returns mock("key") - @host.stubs(:certificate_matches_key?).returns true + @cert = stub 'cert', :content => @realcert, :expired? => false + + @host.stubs(:key).returns stub("key",:content => 'private key' ) end it "should find the CA certificate if it does not have a certificate" do @@ -459,12 +411,22 @@ @host.certificate.should equal(@cert) end - it "should fail if the found certificate does not match the private key" do - @host.expects(:certificate_matches_key?).returns false + it "should immediately expire the cached copy if the found certificate does not match the private key" do + @realcert.expects(:check_private_key).with('private key').returns false + + Puppet::SSL::Certificate.stubs(:find).returns @cert + Puppet::SSL::Certificate.expects(:expire).with("myname") + + @host.certificate + end + + it "should not return a certificate if it does not match the private key" do + @realcert.expects(:check_private_key).with('private key').returns false Puppet::SSL::Certificate.stubs(:find).returns @cert + Puppet::SSL::Certificate.stubs(:expire).with("myname") - lambda { @host.certificate }.should raise_error(Puppet::Error) + @host.certificate.should == nil end it "should return any previously found certificate" do @@ -654,14 +616,14 @@ it "should catch and log errors during CSR saving" do @host.expects(:certificate).times(2).returns(nil).then.returns "foo" - @host.expects(:generate).times(2).raises(RuntimeError).then.returns nil + @host.expects(:generate).raises(RuntimeError).then.returns nil @host.stubs(:sleep) @host.wait_for_cert(1) end it "should sleep and retry after failures saving the CSR if waitforcert is enabled" do @host.expects(:certificate).times(2).returns(nil).then.returns "foo" - @host.expects(:generate).times(2).raises(RuntimeError).then.returns nil + @host.expects(:generate).raises(RuntimeError).then.returns nil @host.expects(:sleep).with(1) @host.wait_for_cert(1) end diff -Nru puppet-0.25.1/spec/unit/transaction.rb puppet-0.25.4/spec/unit/transaction.rb --- puppet-0.25.1/spec/unit/transaction.rb 2010-02-12 16:48:12.000000000 +0000 +++ puppet-0.25.4/spec/unit/transaction.rb 2010-01-29 21:32:27.000000000 +0000 @@ -20,8 +20,8 @@ describe "when generating resources" do it "should finish all resources" do - generator = stub 'generator', :depthfirst? => true - resource = stub 'resource' + generator = stub 'generator', :depthfirst? => true, :tags => [] + resource = stub 'resource', :tag => nil @catalog = Puppet::Resource::Catalog.new @transaction = Puppet::Transaction.new(@catalog) @@ -36,8 +36,8 @@ end it "should skip generated resources that conflict with existing resources" do - generator = mock 'generator' - resource = stub 'resource' + generator = mock 'generator', :tags => [] + resource = stub 'resource', :tag => nil @catalog = Puppet::Resource::Catalog.new @transaction = Puppet::Transaction.new(@catalog) @@ -51,6 +51,21 @@ @transaction.generate_additional_resources(generator, :generate).should be_empty end + + it "should copy all tags to the newly generated resources" do + child = stub 'child' + generator = stub 'resource', :tags => ["one", "two"] + + @catalog = Puppet::Resource::Catalog.new + @transaction = Puppet::Transaction.new(@catalog) + + generator.stubs(:generate).returns [child] + @catalog.stubs(:add_resource) + + child.expects(:tag).with("one", "two") + + @transaction.generate_additional_resources(generator, :generate) + end end describe "when skipping a resource" do @@ -65,6 +80,16 @@ @transaction.skip?(@resource).should be_true end + it "should ask the resource if it's tagged with any of the tags" do + tags = ['one', 'two'] + @transaction.stubs(:ignore_tags?).returns(false) + @transaction.stubs(:tags).returns(tags) + + @resource.expects(:tagged?).with(*tags).returns(true) + + @transaction.missing_tags?(@resource).should be_false + end + it "should skip not scheduled resources" do @transaction.stubs(:scheduled?).returns(false) @transaction.skip?(@resource).should be_true diff -Nru puppet-0.25.1/spec/unit/type/file/content.rb puppet-0.25.4/spec/unit/type/file/content.rb --- puppet-0.25.1/spec/unit/type/file/content.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/type/file/content.rb 2010-01-29 21:32:27.000000000 +0000 @@ -119,6 +119,15 @@ @content.retrieve.should be_nil end + it "should not manage content on links" do + @content = content.new(:resource => @resource) + + stat = mock 'stat', :ftype => "link" + @resource.expects(:stat).returns stat + + @content.retrieve.should be_nil + end + it "should always return the checksum as a string" do @content = content.new(:resource => @resource) @content.stubs(:checksum_type).returns "mtime" @@ -188,6 +197,26 @@ @content.must be_insync("{md5}" + Digest::MD5.hexdigest("some content")) end + describe "and Puppet[:show_diff] is set" do + before do + Puppet[:show_diff] = true + end + + it "should display a diff if the current contents are different from the desired content" do + @content.should = "some content" + @content.expects(:string_file_diff).once + + @content.insync?("other content") + end + + it "should not display a diff if the sum for the current contents is the same as the sum for the desired content" do + @content.should = "some content" + @content.expects(:string_file_diff).never + + @content.insync?("{md5}" + Digest::MD5.hexdigest("some content")) + end + end + describe "and the content is specified via a remote source" do before do @metadata = stub 'metadata' diff -Nru puppet-0.25.1/spec/unit/type/maillist.rb puppet-0.25.4/spec/unit/type/maillist.rb --- puppet-0.25.1/spec/unit/type/maillist.rb 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/spec/unit/type/maillist.rb 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,42 @@ +#!/usr/bin/env ruby + +Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") } + +maillist = Puppet::Type.type(:maillist) + +describe maillist do + before do + @provider_class = Puppet::Type.type(:maillist).provider(:mailman) + + @provider = stub 'provider', :class => @provider_class, :clear => nil + @provider.stubs(:respond_to).with(:aliases).returns(true) + + @provider_class.stubs(:new).returns(@provider) + + Puppet::Type.type(:maillist).stubs(:defaultprovider).returns(@provider_class) + + @maillist = Puppet::Type.type(:maillist).new( :name => 'test' ) + + @catalog = Puppet::Resource::Catalog.new + @maillist.catalog = @catalog + end + + it "should generate aliases unless they already exist" do + # Mail List aliases are careful not to stomp on managed Mail Alias aliases + + # test1 is an unmanaged alias from /etc/aliases + Puppet::Type.type(:mailalias).provider(:aliases).stubs(:target_object).returns( StringIO.new("test1: root\n") ) + + # test2 is a managed alias from the manifest + dupe = Puppet::Type.type(:mailalias).new( :name => 'test2' ) + @catalog.add_resource dupe + + @provider.stubs(:aliases).returns({"test1" => 'this will get included', "test2" => 'this will dropped', "test3" => 'this will get included'}) + + generated = @maillist.generate + generated.map{ |x| x.name }.sort.should == ['test1', 'test3'] + generated.map{ |x| x.class }.should == [Puppet::Type::Mailalias, Puppet::Type::Mailalias] + + end + +end diff -Nru puppet-0.25.1/spec/unit/type/resources.rb puppet-0.25.4/spec/unit/type/resources.rb --- puppet-0.25.1/spec/unit/type/resources.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/type/resources.rb 2010-01-29 21:32:27.000000000 +0000 @@ -8,7 +8,7 @@ describe resources do describe "when initializing" do it "should fail if the specified resource type does not exist" do - Puppet::Type.stubs(:type).with("Resources").returns resources + Puppet::Type.stubs(:type).with { |x| x.to_s.downcase == "resources"}.returns resources Puppet::Type.expects(:type).with("nosuchtype").returns nil lambda { resources.new :name => "nosuchtype" }.should raise_error(Puppet::Error) end @@ -21,4 +21,69 @@ resources.new(:name => "file").resource_type.should == Puppet::Type.type(:file) end end + + describe "#generate" do + before do + @host1 = Puppet::Type.type(:host).new(:name => 'localhost', :ip => '127.0.0.1') + @catalog = Puppet::Resource::Catalog.new + @context = Puppet::Transaction.new(@catalog) + end + + describe "when dealing with non-purging resources" do + before do + @resources = Puppet::Type.type(:resources).new(:name => 'host') + end + + it "should not generate any resource" do + @resources.generate.should be_empty + end + end + + describe "when the catalog contains a purging resource" do + before do + @resources = Puppet::Type.type(:resources).new(:name => 'host', :purge => true) + @purgeable_resource = Puppet::Type.type(:host).new(:name => 'localhost', :ip => '127.0.0.1') + @catalog.add_resource @resources + end + + it "should not generate a duplicate of that resource" do + Puppet::Type.type(:host).stubs(:instances).returns [@host1] + @catalog.add_resource @host1 + @resources.generate.collect { |r| r.ref }.should_not include(@host1.ref) + end + + + describe "when generating a purgeable resource" do + it "should be included in the generated resources" do + Puppet::Type.type(:host).stubs(:instances).returns [@purgeable_resource] + @resources.generate.collect { |r| r.ref }.should include(@purgeable_resource.ref) + end + end + + describe "when the instance's do not have an ensure property" do + it "should not be included in the generated resources" do + @no_ensure_resource = Puppet::Type.type(:exec).new(:name => '/usr/bin/env echo') + Puppet::Type.type(:host).stubs(:instances).returns [@no_ensure_resource] + @resources.generate.collect { |r| r.ref }.should_not include(@no_ensure_resource.ref) + end + end + + describe "when the instance's ensure property does not accept absent" do + it "should not be included in the generated resources" do + @no_absent_resource = Puppet::Type.type(:service).new(:name => 'foobar') + Puppet::Type.type(:host).stubs(:instances).returns [@no_absent_resource] + @resources.generate.collect { |r| r.ref }.should_not include(@no_absent_resource.ref) + end + end + + describe "when checking the instance fails" do + it "should not be included in the generated resources" do + @purgeable_resource = Puppet::Type.type(:host).new(:name => 'foobar') + Puppet::Type.type(:host).stubs(:instances).returns [@purgeable_resource] + @resources.expects(:check).with(@purgeable_resource).returns(false) + @resources.generate.collect { |r| r.ref }.should_not include(@purgeable_resource.ref) + end + end + end + end end diff -Nru puppet-0.25.1/spec/unit/type/service.rb puppet-0.25.4/spec/unit/type/service.rb --- puppet-0.25.1/spec/unit/type/service.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/type/service.rb 2010-01-29 21:32:27.000000000 +0000 @@ -88,20 +88,6 @@ svc.should(:enable).should be_nil end - it "should discard paths that do not exist" do - FileTest.stubs(:exist?).returns(false) - FileTest.stubs(:directory?).returns(false) - svc = Puppet::Type.type(:service).new(:name => "yay", :path => "/one/two") - svc[:path].should be_empty - end - - it "should discard paths that are not directories" do - FileTest.stubs(:exist?).returns(true) - FileTest.stubs(:directory?).returns(false) - svc = Puppet::Type.type(:service).new(:name => "yay", :path => "/one/two") - svc[:path].should be_empty - end - it "should split paths on ':'" do FileTest.stubs(:exist?).returns(true) FileTest.stubs(:directory?).returns(true) diff -Nru puppet-0.25.1/spec/unit/type/tidy.rb puppet-0.25.4/spec/unit/type/tidy.rb --- puppet-0.25.1/spec/unit/type/tidy.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/type/tidy.rb 2010-01-29 21:32:27.000000000 +0000 @@ -7,6 +7,10 @@ describe tidy do before do Puppet.settings.stubs(:use) + + # for an unknown reason some of these specs fails when run individually + # with a failed expectation on File.lstat in the autoloader. + File.stubs(:lstat) end it "should use :lstat when stating a file" do @@ -161,7 +165,7 @@ Puppet::FileServing::Fileset.stubs(:new).returns @fileset end - it "should use a Fileset for recursion" do + it "should use a Fileset for infinite recursion" do Puppet::FileServing::Fileset.expects(:new).with("/what/ever", :recurse => true).returns @fileset @fileset.expects(:files).returns %w{. one two} @tidy.stubs(:tidy?).returns false @@ -169,6 +173,15 @@ @tidy.generate end + it "should use a Fileset for limited recursion" do + @tidy[:recurse] = 42 + Puppet::FileServing::Fileset.expects(:new).with("/what/ever", :recurse => true, :recurselimit => 42).returns @fileset + @fileset.expects(:files).returns %w{. one two} + @tidy.stubs(:tidy?).returns false + + @tidy.generate + end + it "should generate a file resource for every file that should be tidied but not for files that should not be tidied" do @fileset.expects(:files).returns %w{. one two} diff -Nru puppet-0.25.1/spec/unit/type.rb puppet-0.25.4/spec/unit/type.rb --- puppet-0.25.1/spec/unit/type.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/type.rb 2010-01-29 21:32:27.000000000 +0000 @@ -89,6 +89,15 @@ Puppet::Type.type(:mount).new(:name => "foo").version.should == 0 end + it "should provide source_descriptors" do + resource = Puppet::Type.type(:mount).new(:name => "foo") + catalog = Puppet::Resource::Catalog.new + catalog.version = 50 + catalog.add_resource resource + + resource.source_descriptors.should == {:version=>50, :tags=>["mount", "foo"], :path=>"/Mount[foo]"} + end + describe "when choosing a default provider" do it "should choose the provider with the highest specificity" do # Make a fake type diff -Nru puppet-0.25.1/spec/unit/util/autoload.rb puppet-0.25.4/spec/unit/util/autoload.rb --- puppet-0.25.1/spec/unit/util/autoload.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/autoload.rb 2010-01-29 21:32:27.000000000 +0000 @@ -111,6 +111,8 @@ before do @autoload.stubs(:searchpath).returns %w{/a} Dir.stubs(:glob).returns "/path/to/file.rb" + + @autoload.class.stubs(:loaded?).returns(false) end [RuntimeError, LoadError, SyntaxError].each do |error| diff -Nru puppet-0.25.1/spec/unit/util/ldap/connection.rb puppet-0.25.4/spec/unit/util/ldap/connection.rb --- puppet-0.25.1/spec/unit/util/ldap/connection.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/ldap/connection.rb 2010-01-29 21:32:27.000000000 +0000 @@ -8,7 +8,7 @@ require 'puppet/util/ldap/connection' # So our mocks and such all work, even when ldap isn't available. -unless defined?(LDAP::Conn) +unless Puppet.features.ldap? class LDAP class Conn def initialize(*args) diff -Nru puppet-0.25.1/spec/unit/util/log.rb puppet-0.25.4/spec/unit/util/log.rb --- puppet-0.25.1/spec/unit/util/log.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/log.rb 2010-01-29 21:32:27.000000000 +0000 @@ -157,6 +157,20 @@ end end + it "should use the source_descriptors" do + source = stub "source" + source.stubs(:source_descriptors).returns(:tags => ["tag","tag2"], :path => "path", :version => 100) + + log = Puppet::Util::Log.new(:level => "notice", :message => :foo) + log.expects(:tag).with("tag") + log.expects(:tag).with("tag2") + log.expects(:version=).with(100) + + log.source = source + + log.source.should == "path" + end + it "should copy over any version information" do catalog = Puppet::Resource::Catalog.new catalog.version = 25 diff -Nru puppet-0.25.1/spec/unit/util/monkey_patches.rb puppet-0.25.4/spec/unit/util/monkey_patches.rb --- puppet-0.25.1/spec/unit/util/monkey_patches.rb 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/spec/unit/util/monkey_patches.rb 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,103 @@ +#!/usr/bin/env ruby + +Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") } + +require 'puppet/util/monkey_patches' + +describe RDoc do + it "should return the call stack if a script is called directly" do + stack = [ + "/usr/lib/ruby/1.8/rdoc/usage.rb:99:in `usage_no_exit'", + "/usr/lib/ruby/1.8/rdoc/usage.rb:93:in `usage'", + "./puppet/application.rb:295:in `help'", + "./puppet/application.rb:207:in `handle_help'", + "./puppet/application.rb:141:in `send'", + "./puppet/application.rb:141:in `option'", + "/usr/lib/ruby/1.8/optparse.rb:1267:in `call'", + "/usr/lib/ruby/1.8/optparse.rb:1267:in `parse_in_order'", + "/usr/lib/ruby/1.8/optparse.rb:1254:in `catch'", + "/usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'", + "/usr/lib/ruby/1.8/optparse.rb:1248:in `order!'", + "/usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'", + "/usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'", + "./puppet/application.rb:262:in `parse_options'", + "./puppet/application.rb:214:in `run'", + "./puppet/application.rb:306:in `exit_on_fail'", + "./puppet/application.rb:214:in `run'", + "../bin/puppet:71" + ] + + old_dollar_zero = $0 + $0 = "../bin/puppet" + + # Mocha explodes if you try to mock :caller directly + Kernel.expects( :mock_caller ).returns( stack ) + Kernel.instance_eval { alias orig_caller caller } + Kernel.instance_eval { alias caller mock_caller } + + RDoc.caller.must == stack + + $0 = old_dollar_zero + Kernel.instance_eval { alias caller orig_caller } + end + + it "should return a truncated call stack if a script is called from a rubygems stub" do + gem_stack = [ + "/usr/lib/ruby/1.8/rdoc/usage.rb:99:in `usage_no_exit'", + "/usr/lib/ruby/1.8/rdoc/usage.rb:93:in `usage'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:295:in `help'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:207:in `handle_help'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:141:in `send'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:141:in `option'", + "/usr/lib/ruby/1.8/optparse.rb:1267:in `call'", + "/usr/lib/ruby/1.8/optparse.rb:1267:in `parse_in_order'", + "/usr/lib/ruby/1.8/optparse.rb:1254:in `catch'", + "/usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'", + "/usr/lib/ruby/1.8/optparse.rb:1248:in `order!'", + "/usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'", + "/usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:262:in `parse_options'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:214:in `run'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:306:in `exit_on_fail'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:214:in `run'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/bin/puppet:71", + "/usr/bin/puppet:19:in `load'", + "/usr/bin/puppet:19" + ] + + real_stack = [ + "/usr/lib/ruby/1.8/rdoc/usage.rb:99:in `usage_no_exit'", + "/usr/lib/ruby/1.8/rdoc/usage.rb:93:in `usage'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:295:in `help'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:207:in `handle_help'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:141:in `send'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:141:in `option'", + "/usr/lib/ruby/1.8/optparse.rb:1267:in `call'", + "/usr/lib/ruby/1.8/optparse.rb:1267:in `parse_in_order'", + "/usr/lib/ruby/1.8/optparse.rb:1254:in `catch'", + "/usr/lib/ruby/1.8/optparse.rb:1254:in `parse_in_order'", + "/usr/lib/ruby/1.8/optparse.rb:1248:in `order!'", + "/usr/lib/ruby/1.8/optparse.rb:1339:in `permute!'", + "/usr/lib/ruby/1.8/optparse.rb:1360:in `parse!'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:262:in `parse_options'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:214:in `run'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:306:in `exit_on_fail'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/lib/puppet/application.rb:214:in `run'", + "/usr/lib/ruby/gems/1.8/gems/puppet-0.25.1/bin/puppet:71", + ] + + old_dollar_zero = $0 + $0 = '/usr/bin/puppet' + + # Mocha explodes if you try to mock :caller directly + Kernel.expects( :mock_caller ).returns( gem_stack ) + Kernel.instance_eval { alias orig_caller caller } + Kernel.instance_eval { alias caller mock_caller } + + RDoc.caller.must == real_stack + + $0 = old_dollar_zero + Kernel.instance_eval { alias caller orig_caller } + end +end + diff -Nru puppet-0.25.1/spec/unit/util/queue.rb puppet-0.25.4/spec/unit/util/queue.rb --- puppet-0.25.1/spec/unit/util/queue.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/queue.rb 2010-01-29 21:32:27.000000000 +0000 @@ -19,16 +19,24 @@ mod = Puppet::Util::Queue client_classes = { :default => make_test_client_class('Bogus::Default'), :setup => make_test_client_class('Bogus::Setup') } -mod.register_queue_type(client_classes[:default], :default) -mod.register_queue_type(client_classes[:setup], :setup) describe Puppet::Util::Queue do + before :all do + mod.register_queue_type(client_classes[:default], :default) + mod.register_queue_type(client_classes[:setup], :setup) + end + before :each do @class = Class.new do extend mod end end + after :all do + instances = mod.instance_hash(:queue_clients) + [:default, :setup, :bogus, :aardvark, :conflict, :test_a, :test_b].each{ |x| instances.delete(x) } + end + context 'when determining a type name from a class' do it 'should handle a simple one-word class name' do mod.queue_type_from_class(make_test_client_class('Foo')).should == :foo diff -Nru puppet-0.25.1/spec/unit/util/selinux.rb puppet-0.25.4/spec/unit/util/selinux.rb --- puppet-0.25.1/spec/unit/util/selinux.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/selinux.rb 2010-01-29 21:32:27.000000000 +0000 @@ -27,7 +27,12 @@ Selinux.expects(:is_selinux_enabled).returns 0 selinux_support?.should be_false end - end + + it "should return nil if /proc/mounts does not exist" do + File.stubs(:open).with("/proc/mounts").raises("No such file or directory - /proc/mounts") + read_mounts.should == nil + end + end describe "filesystem detection" do before :each do @@ -61,6 +66,42 @@ selinux_label_support?('/mnt/nfs/testfile').should be_false end + it "should follow symlinks when determining file systems" do + self.stubs(:realpath).with('/mnt/symlink/testfile').returns('/mnt/nfs/dest/testfile') + + selinux_label_support?('/mnt/symlink/testfile').should be_false + end + + end + + describe "realpath" do + it "should handle files that don't exist" do + + # Since I'm stubbing Pathname.new for this test, + # I need to also stub the internal calls to Pathname.new, + # which happen in Pathname.dirname and Parthname.basename + # I want those to return real Pathname objects, + # so I'm creating them before the stub is in place. + realpaths = Hash.new {|hash, path| hash[path] = Pathname.new(path) } + paths = ['symlink', '/mnt'] + paths.each { |path| realpaths[path] } + + realpaths['/mnt/symlink'] = stubs "Pathname" + realpaths['/mnt/symlink'].stubs(:realpath).returns(realpaths['/mnt/nfs/dest']) + realpaths['/mnt/symlink'].stubs(:exist?).returns(true) + + realpaths['/mnt/symlink/nonexistant'] = stubs "Pathname" + realpaths['/mnt/symlink/nonexistant'].stubs(:realpath).raises(Errno::ENOENT) + realpaths['/mnt/symlink/nonexistant'].stubs(:exist?).returns(false) + realpaths['/mnt/symlink/nonexistant'].stubs(:dirname).returns(realpaths['/mnt/symlink']) + realpaths['/mnt/symlink/nonexistant'].stubs(:basename).returns(realpaths['nonexistant']) + + realpaths.each do |path, value| + Pathname.stubs(:new).with(path).returns(value) + end + + realpath('/mnt/symlink/nonexistant').should == '/mnt/nfs/dest/nonexistant' + end end describe "get_selinux_current_context" do @@ -153,11 +194,29 @@ end describe "set_selinux_context" do - it "should return nil if there is no SELinux support" do + before :each do + fh = stub 'fh', :close => nil + File.stubs(:open).with("/proc/mounts").returns fh + fh.stubs(:read_nonblock).returns( + "rootfs / rootfs rw 0 0\n"+ + "/dev/root / ext3 rw,relatime,errors=continue,user_xattr,acl,data=ordered 0 0\n"+ + "/dev /dev tmpfs rw,relatime,mode=755 0 0\n"+ + "/proc /proc proc rw,relatime 0 0\n"+ + "/sys /sys sysfs rw,relatime 0 0\n" + ).then.raises EOFError + end + + it "should return nil if there is no SELinux support" do self.expects(:selinux_support?).returns false set_selinux_context("/foo", "user_u:role_r:type_t:s0").should be_nil end + it "should return nil if selinux_label_support returns false" do + self.expects(:selinux_support?).returns true + self.expects(:selinux_label_support?).with("/foo").returns false + set_selinux_context("/foo", "user_u:role_r:type_t:s0").should be_nil + end + it "should use lsetfilecon to set a context" do self.expects(:selinux_support?).returns true Selinux.expects(:lsetfilecon).with("/foo", "user_u:role_r:type_t:s0").returns 0 diff -Nru puppet-0.25.1/spec/unit/util/settings/file_setting.rb puppet-0.25.4/spec/unit/util/settings/file_setting.rb --- puppet-0.25.1/spec/unit/util/settings/file_setting.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/settings/file_setting.rb 2010-01-29 21:32:27.000000000 +0000 @@ -169,18 +169,43 @@ @file.to_resource[:mode].should == 0755 end + it "should not set the mode on a the file if manage_internal_file_permissions is disabled" do + Puppet[:manage_internal_file_permissions] = false + + @file.stubs(:mode).returns(0755) + + @file.to_resource[:mode].should == nil + end + it "should set the owner if running as root and the owner is provided" do Puppet.features.expects(:root?).returns true @file.stubs(:owner).returns "foo" @file.to_resource[:owner].should == "foo" end + it "should not set the owner if manage_internal_file_permissions is disabled" do + Puppet[:manage_internal_file_permissions] = false + Puppet.features.stubs(:root?).returns true + @file.stubs(:owner).returns "foo" + + @file.to_resource[:owner].should == nil + end + it "should set the group if running as root and the group is provided" do Puppet.features.expects(:root?).returns true @file.stubs(:group).returns "foo" @file.to_resource[:group].should == "foo" end + it "should not set the group if manage_internal_file_permissions is disabled" do + Puppet[:manage_internal_file_permissions] = false + Puppet.features.stubs(:root?).returns true + @file.stubs(:group).returns "foo" + + @file.to_resource[:group].should == nil + end + + it "should not set owner if not running as root" do Puppet.features.expects(:root?).returns false @file.stubs(:owner).returns "foo" diff -Nru puppet-0.25.1/spec/unit/util/settings.rb puppet-0.25.4/spec/unit/util/settings.rb --- puppet-0.25.1/spec/unit/util/settings.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/settings.rb 2010-01-29 21:32:27.000000000 +0000 @@ -579,6 +579,25 @@ # and we should now have the new value in memory @settings[:two].should == "disk-replace" end + + it "should retain in-memory values if the file has a syntax error" do + # Init the value + text = "[main]\none = initial-value\n" + @settings.expects(:read_file).returns(text) + @settings.parse + @settings[:one].should == "initial-value" + + # Now replace the value with something bogus + text = "[main]\nkenny = killed-by-what-follows\n1 is 2, blah blah florp\n" + @settings.expects(:read_file).returns(text) + @settings.parse + + # The originally-overridden value should not be replaced with the default + @settings[:one].should == "initial-value" + + # and we should not have the new value in memory + @settings[:kenny].should be_nil + end end it "should provide a method for creating a catalog of resources from its configuration" do diff -Nru puppet-0.25.1/spec/unit/util/tagging.rb puppet-0.25.4/spec/unit/util/tagging.rb --- puppet-0.25.1/spec/unit/util/tagging.rb 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/spec/unit/util/tagging.rb 2010-01-29 21:32:27.000000000 +0000 @@ -89,4 +89,14 @@ it "should indicate when the object is not tagged with a provided tag" do @tagger.should_not be_tagged("one") end + + it "should indicate when the object is tagged with any tag in an array" do + @tagger.tag("one") + @tagger.should be_tagged("one","two","three") + end + + it "should indicate when the object is not tagged with any tag in an array" do + @tagger.tag("one") + @tagger.should_not be_tagged("two","three") + end end diff -Nru puppet-0.25.1/tasks/rake/gem.rake puppet-0.25.4/tasks/rake/gem.rake --- puppet-0.25.1/tasks/rake/gem.rake 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/tasks/rake/gem.rake 2010-01-29 21:32:27.000000000 +0000 @@ -1,3 +1,5 @@ +require 'ftools' + GEM_FILES = FileList[ '[A-Z]*', 'install.rb', @@ -7,18 +9,27 @@ 'man/**/*', 'examples/**/*', 'ext/**/*', + 'tasks/**/*', 'test/**/*', 'spec/**/*' ] +EXECUTABLES = FileList[ + 'bin/**/*', + 'sbin/**/*' +] + +SBIN = Dir.glob("sbin/*") + spec = Gem::Specification.new do |spec| spec.platform = Gem::Platform::RUBY spec.name = 'puppet' spec.files = GEM_FILES.to_a - spec.executables = %w{puppetca puppetd puppetmasterd puppetqd puppetrun filebucket pi puppet puppetdoc ralsh} + spec.executables = EXECUTABLES.gsub(/sbin\/|bin\//, '').to_a spec.version = Puppet::PUPPETVERSION spec.add_dependency('facter', '>= 1.5.1') spec.summary = 'Puppet, an automated configuration management tool' + spec.description = 'Puppet, an automated configuration management tool' spec.author = 'Reductive Labs' spec.email = 'puppet@reductivelabs.com' spec.homepage = 'http://reductivelabs.com' @@ -32,14 +43,17 @@ desc "Prepare binaries for gem creation" task :prepare_gem do - sh "mv sbin/* bin" + SBIN.each do |f| + File.copy(f,"bin") + end end desc "Create the gem" task :create_gem => :prepare_gem do - sh "mkdir -p pkg" + Dir.mkdir("pkg") rescue nil Gem::Builder.new(spec).build - sh "mv *.gem pkg" - sh "rm bin/*" - sh "git reset --hard" + File.move("puppet-#{Puppet::PUPPETVERSION}.gem", "pkg") + SBIN.each do |f| + File.unlink("bin/" + f.gsub(/sbin\//, '')) + end end diff -Nru puppet-0.25.1/tasks/rake/git_workflow.rake puppet-0.25.4/tasks/rake/git_workflow.rake --- puppet-0.25.1/tasks/rake/git_workflow.rake 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/tasks/rake/git_workflow.rake 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,121 @@ +# This set of tasks helps automate the workflow as described on +# http://reductivelabs.com/trac/puppet/wiki/Development/DevelopmentLifecycle + + +def find_start(start) +# This is a case statement, as we might want to map certain +# git tags to starting points that are not currently in git. + case start + when nil?: + when @next_release: return "master" + else return start + end +end + +desc "Set up git for working with Puppet" +task :git_setup do + # This should be changed as new versions get released + @next_release = '0.26.x' + @remote = {} + default_remote = {} + default_remote[:url] = 'git://github.com/reductivelabs/puppet' + default_remote[:name] = 'origin' + @remote[:name] = %x{git config puppet.defaultremote}.chomp + @remote[:name] = @remote[:name].empty? ? default_remote[:name] : @remote[:name] + @remote[:url] = default_remote[:url] if @remote[:name] == default_remote[:name] + default_fetch = '+refs/heads/*:refs/remotes/puppet/*' + @remote[:fetch] = %x{git config puppet.#{@remote[:name]}.fetch}.chomp + @remote[:fetch] = @remote[:fetch].empty? ? default_fetch : @remote[:fetch] +end + +desc "Start work on a feature" +task :start_feature, [:feature,:remote,:branch] => :git_setup do |t, args| + args.with_defaults(:remote => @remote[:name]) + args.with_defaults(:branch => @next_release) + start_at = find_start(args.branch) + branch = "feature/#{start_at}/#{args.feature}" + sh "git checkout -b #{branch} #{start_at}" do |ok, res| + if ! ok + raise < :git_setup do |t, args| + args.with_defaults(:remote => @remote[:name]) + args.with_defaults(:branch => @next_release) + start_at = find_start(args.branch) + branch = "tickets/#{start_at}/#{args.ticket}" + sh "git checkout -b #{branch} #{start_at}" do |ok, res| + unless ok + raise < 0 + raise "Patches already exist matching '00*.patch'; clean up first" + end + + unless %x{git status} =~ /On branch (.+)/ + raise "Could not get branch from 'git status'" + end + branch = $1 + + unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$} + raise "Branch name does not follow // model; cannot autodetect parent branch" + end + + type, parent, name = $1, $2, $3 + + # Create all of the patches + sh "git format-patch -C -M -s -n --subject-prefix='PATCH/puppet' #{parent}..HEAD" + + # And then mail them out. + + # If we've got more than one patch, add --compose + if Dir.glob("00*.patch").length > 1 + compose = "--compose" + else + compose = "" + end + + # Now send the mail. + sh "git send-email #{compose} --no-signed-off-by-cc --suppress-from --to puppet-dev@googlegroups.com 00*.patch" + + # Finally, clean up the patches + sh "rm 00*.patch" +end + diff -Nru puppet-0.25.1/tasks/rake/mail_patches.rake puppet-0.25.4/tasks/rake/mail_patches.rake --- puppet-0.25.1/tasks/rake/mail_patches.rake 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/tasks/rake/mail_patches.rake 1970-01-01 01:00:00.000000000 +0100 @@ -1,35 +0,0 @@ -desc "Send patch information to the puppet-dev list" -task :mail_patches do - if Dir.glob("00*.patch").length > 0 - raise "Patches already exist matching '00*.patch'; clean up first" - end - - unless %x{git status} =~ /On branch (.+)/ - raise "Could not get branch from 'git status'" - end - branch = $1 - - unless branch =~ %r{^([^\/]+)/([^\/]+)/([^\/]+)$} - raise "Branch name does not follow // model; cannot autodetect parent branch" - end - - type, parent, name = $1, $2, $3 - - # Create all of the patches - sh "git format-patch -C -M -s -n --subject-prefix='PATCH/puppet' #{parent}..HEAD" - - # And then mail them out. - - # If we've got more than one patch, add --compose - if Dir.glob("00*.patch").length > 1 - compose = "--compose" - else - compose = "" - end - - # Now send the mail. - sh "git send-email #{compose} --no-signed-off-by-cc --suppress-from --to puppet-dev@googlegroups.com 00*.patch" - - # Finally, clean up the patches - sh "rm 00*.patch" -end diff -Nru puppet-0.25.1/tasks/rake/sign.rake puppet-0.25.4/tasks/rake/sign.rake --- puppet-0.25.1/tasks/rake/sign.rake 1970-01-01 01:00:00.000000000 +0100 +++ puppet-0.25.4/tasks/rake/sign.rake 2010-01-29 21:32:27.000000000 +0000 @@ -0,0 +1,14 @@ +desc "Sign to the package with the Reductive Labs release key" +task :sign_packages do + +version = Puppet::PUPPETVERSION + +# Sign package + +sh "gpg --homedir $HOME/release_key --detach-sign --output pkg/puppet-#{version}.tar.gz.sign --armor pkg/puppet-#{version}.tar.gz" + +# Sign gem + +sh "gpg --homedir $HOME/release_key --detach-sign --output pkg/puppet-#{version}.gem.sign --armor pkg/puppet-#{version}.gem" + +end diff -Nru puppet-0.25.1/test/data/providers/ssh_authorized_key/parsed/authorized_keys puppet-0.25.4/test/data/providers/ssh_authorized_key/parsed/authorized_keys --- puppet-0.25.1/test/data/providers/ssh_authorized_key/parsed/authorized_keys 2009-10-27 06:38:18.000000000 +0000 +++ puppet-0.25.4/test/data/providers/ssh_authorized_key/parsed/authorized_keys 2010-01-29 21:32:27.000000000 +0000 @@ -4,3 +4,4 @@ from="192.168.1.1, www.reductivelabs.com",command="/bin/false",no-pty,no-port-forwarding ssh-dss AAAAB3NzaC1kc3MAAACBAJkupmdsJSDXfUy5EU5NTRBDr9Woo3w0YnB8KmnJW9ghU8C7SkWPB1fIHVe+esFfd3qWBseb83PoFX63geZJAg6bjV4/Rdn1zEoa9EO2QyUdYUen4+rpsh3vVKZ6HFNsn3+W5+kPYgE1F/N4INqkbjY3sqCkP/W1BL9+sbVVbuJFAAAAFQCfjWDk5XhvGUkPjNWWVqltBYzHtwAAAIEAg/XL7ky7x9Ad5banzPFAfmM+DGFe0A/JEbLDjKmr5KBM5x4RFohtEvZ8ECuVGUOqBWdgAjyYwsG4oRVjLnKrf/rgmbNRzSFgEWkcAye3BVwk7Dt6hh4knEl+mNfOLq+FH0011UhecOiqTcESMzQDtgQ1vJh2VchElBLjl3x/ZugAAACAAh5jGQC338t5ObP8trSlOefkx0sXmmEzUbo3Mt8mGUuGJPx8m+X0L8Xd+l5rQxytqE3SmV/RD+6REqBuPqHM8RQuqAzfjdOeg/Ajdggx1CRMTVhltZsgQoxO30cz9Qo0SdPoL+Jp1fLuaLZq7m/RmsWYvoLT3jebBlpvvQE8YlI= Francois Deppierraz ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Vi+TdC3iOGYcIo5vGTvC9P9rjHl9RxCuZmSfn+YDFQ35RXf0waijtjp9I7GYh6R4hBjA5z0u/Pzi95LET5NfRM0Gdc0DJyvBI7K+ALBxIT383Iz6Yz4iKxe1TEJgHGM2he4+7BHkjc3kdIZqIpZjucCk4VsXSxujO4MKKvtaKK2l+kahlLQHHw/vZkDpIgL52iGVsjW9l8RLJaKHZ4mDHJN/Q/Rzn2W4EvcdHUzwhvGMwZlm8clDwITBrSsawYtnivJrQSYcmTRqJuS8wprNDrLIhTGjrwFg5WpruUuMt6fLuCqwe6TeEL+nh3DQ4g554c5aRp3oU6LGBKTvNZGWQ== francois@korn ssh-dss AAAAB3NzaC1kc3MAAACBAMPpCYnjywOemd8LqbbmC+bePNR3/H1rXsiFwjSLhYE3bbOpvclvOzN1DruFc34m0FopVnMkP+aubjdIYF8pijl+5hg9ggB7Kno2dl0Dd1rGN/swvmhA8OpLAQv7Qt7UnXKVho3as08zYZsrHxYFu0wlnkdbsv4cy4aXyQKd4MPVAAAAFQDSyQFWg8Qt3wU05buhZ10psoR7tQAAAIEAmAhguXwUnI3P2FF5NAW/mpJUmUERdL4pyZARUyAgpf7ezwrh9TJqrvGTQNBF97Xqaivyncm5JWQdMIsTBxEFaXZGkmBta02KnWcn447qvIh7iv8XpNL6M9flCkBEZOJ4t9El0ytTSHHaiCz8A20Et+E8evWyi1kXkFDt8ML2dGgAAACBAK0X4ympbdEjgV/ZyOc+BU22u7vOnfSOUJmyar4Ax1MIDNnoyNWKnGvxRutydQcQOKQHZEU0fE8MhPFn6nLF6CoVfEl/oz0EYz3hjV4WPFpHrF5DY/rhvNj8iuneKJ5P0dy/rG6m5qey25PnHyGFVoIRlkHJvBCJT40dHs40YEjI francois@korn +ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAut8aOSxenjOqF527dlsdHWV4MNoAsX14l9M297+SQXaQ5Z3BedIxZaoQthkDALlV/25A1COELrg9J2MqJNQc8Xe9XQOIkBQWWinUlD/BXwoOTWEy8C8zSZPHZ3getMMNhGTBO+q/O+qiJx3y5cA4MTbw2zSxukfWC87qWwcZ64UUlegIM056vPsdZWFclS9hsROVEa57YUMrehQ1EGxT4Z5j6zIopufGFiAPjZigq/vqgcAqhAKP6yu4/gwO6S9tatBeEjZ8fafvj1pmvvIplZeMr96gHE7xS3pEEQqnB3nd4RY7AF6j9kFixnsytAUO7STPh/M3pLiVQBN89TvWPQ==