summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2009-02-28Using the FileCollection where appropriate.Luke Kanies14-12/+60
This commit just replaces the :file and :line accessors with the use of the new FileCollection Lookup module. This should mean that we've normalized all file names in a given process, which *might* have drastic RAM improvements. For initial simplicity, I've gone with a single global collection of file names, but it's built so it's easy to use individual file collections instead. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-28Adding a FileCollection and a lookup module for it.Luke Kanies4-0/+122
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-28 Fixed #1963 - Failing to read /proc/mounts for selinux kills file downloadsJames Turnbull2-1/+5
2009-02-27Fixed #2025 - gentoo service provider handle only default init levelJames Turnbull2-1/+3
2009-02-26Fixed #1910 - updated logcheckJames Turnbull2-1/+4
2009-02-25Updated useradd.rb managehome confine to include other RH-like distributionsJames Turnbull1-1/+1
2009-02-22Use Puppet.debug instead of own debug flagPeter Meier1-7/+5
It's better to use puppet's logging environment than an own. Especially if the default is quite verbose and can't be set by config flag.
2009-02-20Fixing #558 - File checksums no longer refer to 'nosum'Luke Kanies1-34/+0
It was only used in a method that apparently was not in use any more. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-18Fixing #1871 once and for all - contents are never printedLuke Kanies3-8/+43
They were still being printed in noop mode. The fix was to use is_to_s and should_to_s methods, rather than 'change_to_s'. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-15Minor fix to launchd testsJames Turnbull1-2/+2
2009-02-15Fix #1972 - ActiveRecord fixes resulted in broken testsBrice Figureau1-3/+4
Fix #1930 was not complete, with some typos and misuse of unused code paths in the regular puppetmaster use case. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-15Fix spec test for launchd service provider to work with new service status ↵Nigel Kersten1-1/+9
method and add two new status tests. Now ensures that given the correct input, the correct status for the launchd service is returned.
2009-02-14Fixing a test I broke in commit:"897539e857b0da9145f15648b6aa2ef124ec1a19".Luke Kanies1-3/+0
I hadn't removed the call to 'prefetch' on the instance in the test. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14Removing a no-longer-valid test.Luke Kanies1-40/+0
The fix for #1884 removed this no-longer-needed feature, so this test is now unnecessary. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14Fixing password validation to support symbols.Luke Kanies2-5/+9
My fix for #1920 broke when you set :absent or :present. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14Only backing up within parsedfile when managing filesLuke Kanies3-8/+19
I was getting failing tests because I was using non-files for testing and they didn't back up the same, not surprisingly. This moves the 'backup' method to the :flat filetype and then only backs up if the filetype supports it. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14Fixing a syntax error in the up2date providerLuke Kanies1-1/+1
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14Fixing a test broken by a log demotionLuke Kanies1-2/+2
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-14Cleaned up variable names to be more sane, clarified error messages and ↵James Turnbull2-6/+9
fixed incorrect use of 'value' variable rather than 'member'.
2009-02-14Provide dscl -url output support for OS X 10.4 clients using the ↵Nigel Kersten1-36/+120
directoryservice provider. We refactored the directoryservice provider in puppet 0.24.7 to use the -plist option so that output could be parsed more easily to resolve a bug with values with spaces in the name. We missed that 10.4 does not support this flag, so this patch adds -url output support back in for OS X 10.4 clients only as well as a new -url output parser that copes with spaces. 10.5 clients continue to use the -plist method. Also includes some miscellaneous cleanup of methods and removal of extraneous comments. Signed-off-by: Nigel Kersten <nigelk@google.com> Don't use sw_vers to determine OS X versions, use the Facter value instead. This relies upon another patch to ralsh to ensure that facts are loaded.
2009-02-14Fix launchd service provider so it is backwards compatible with OS X 10.4 as ↵Nigel Kersten1-4/+13
well Clean up fix to launchd service provider to be more concise
2009-02-14Updated Augeas type codeJames Turnbull1-3/+5
2009-02-14Removed site from Puppet VIM syntaxJames Turnbull1-1/+1
2009-02-14Fixed #1831 - Added sprintf functionJames Turnbull3-0/+61
2009-02-14Fixed #1830 - Added regsubst functionJames Turnbull3-0/+183
2009-02-14Bug 1948: Add logic and testing for the command parsing logicBryan Kearney2-9/+19
2009-02-13Updated up2date and service confines to add support for Oracle EL and VMJames Turnbull3-3/+7
2009-02-12Fixing #1964 - Facts get loaded from pluginsLuke Kanies2-4/+26
Applying slightly modified patch. Also added tests. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12Adding tests for Puppet::Indirector::Facts::Facter.loadfactsLuke Kanies1-2/+9
I just copied the tests from the master branch, changed as necessary. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13Adding a post-processor for Nagios names.Luke Kanies1-2/+3
This is a brutal hack until Puppet correctly supports multiple primary keys. It basically just comments out _naginator_name before writing to disk, and uncomments it when reading. This allows Puppet to use it while Nagios ignores it. Yes, a stupid hack, but it appears to work. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13Revert "Refixing #1420 - _naginator_name is only used for services"Luke Kanies1-10/+15
This reverts commit efb5cc50c42bc27aec9409e723e3a717ed58c0a8. Conflicts: CHANGELOG
2009-02-13Fixing #1541 - ParsedFile only backs up files once per transactionLuke Kanies4-7/+50
This moves responsibility for backups from the filetype to the consumer of the filetype, but only ParsedFile actually uses filetypes. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13Removing the apparently obsolete netinfo filetype.Luke Kanies2-134/+0
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13Migrated FileType tests to spec, and fleshed them out a bit.Luke Kanies3-94/+119
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-13Bug #1948: Added patch by jab to support the correct ins syntax. Updated the ↵Bryan Kearney3-18/+41
test cases as well
2009-02-12Fixing #961 - closing the http connection after every xmlrpc callLuke Kanies3-1/+29
There were apparently some circumstances that resulted in the connection not being closed; this just closes it every time if it's still open after the rpc call is complete. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12Refactoring the XMLRPC::Client error-handlingLuke Kanies2-60/+254
I split it all into smaller, manageable chunks, and used methods for each step, instead of having one huge call. Note that I made all of the tests first, then refactored the code, so I'm confident there's no behavior change. I don't know that this is actually a lot cleaner, but it seems that way to me. I'm open to skipping this, but I think it makes the whole thing a lot cleaner. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-12Fixed #1959 - Added column protection for environment schema migrationJames Turnbull2-2/+8
2009-02-12Fixing #1869 - autoloaded files should never leak exceptionsLuke Kanies3-2/+43
Ruby's exception hierarchy is a bit strange, in that only exceptions that sub RuntimeError are caught by default. This patch explicitly catches the base class, Exception, which means that LoadError, SyntaxError, and any RuntimeErrors will all be caught. This is done for both load() and loadall(); load() uses Kernel.load, but loadall() uses Kernel.require. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11Fixing #1543 - Nagios parse errors no longer kill PuppetLuke Kanies4-65/+50
The problem wasn't actually transactions, it was how exceptions were raised in Naginator. Well, parse errors actually resulted in an 'exit', rather than an exception, and the exceptions that Naginator was raising were not caught by a normal begin block (SyntaxError, rather than RuntimeError). This commit raises a RuntimeError-derived error rather than exiting. It also adds some context to the error when Puppet catches it. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11Moving the transaction specs to the right pathLuke Kanies1-1/+1
Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11Refixing #1420 - _naginator_name is only used for servicesLuke Kanies2-15/+12
According to: http://nagios.sourceforge.net/docs/3_0/customobjectvars.html the special underscore parameters are only supported on hosts, contacts, and services. This commit reverts most of the changes that set Nagios types to use such a parameter as the namevar. The original commit should have been broken into two commits: one to reorganize the file, and the other to make these changes. As it was, the revert was much harder than it should have been. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11Fixed #1884 - exported defines are collected by the exporting hostLuke Kanies5-11/+25
This was caused by the fix to #1472. That fix unexported any resources collected from the local catalog. The crux of this fix is that it separates 'exported' and 'virtual' a bit more. It also removes no-longer-needed functionality where resources copied their virtual or exported bits from the enclosing define or class. This is now obsolete because we don't evaluate virtual defined resources. The crux of this commit is that defined resources can stay exported even though they're evaluated, and that exported state won't inherit to contained resources such that those then don't get evaluated. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-10Cleaning up the AST::Resource code a bitLuke Kanies1-20/+21
Mostly renaming 'obj' to 'resource', since the whole 'obj' thing is a holdover from before we had the term 'resource'. Also pulling a bit of code out of a loop, since it didn't need to be there. Signed-off-by: Luke Kanies <luke@madstop.com>
2009-02-11Fix #1691 - Realize fails with array of Resource ReferencesBrice Figureau3-1/+53
The following snippet: realize( File["/tmp/a","/tmp/b"] ) is parsed into: AST::Function @name=realize @arguments= AST::ASTArray @children = [ AST::ResourceReference @title= AST::ASTArray @children = [ String(/tmp/a), String(/tmp/b) ] ] When evaluated: ResourceReference gives -> [ File[/tmp/a], File[/tmp/b] ] which means the function arguments are: [[File[/tmp/a], File[/tmp/b]] after evaluating the @arguments ASTArray of AST::Functions. Then the collector complains that it can't find the resource because it is not supposed to work on non-flattened resource array. The fix is to flatten in the realize function (although it can be done more generally in the AST::Function evaluation) before the resources are given to the Collector. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-11Fix #1682 - Resource titles are not flattened as they shouldBrice Figureau2-1/+91
The following manifest: $groups = ["foo", "bar"] $type_groups = ["baz", "quux"] $user_groups = [$groups, $type_groups] notify{ $user_groups: } which outputs: notice: foo notice: //Notify[foobar]/message: defined 'message' as 'foo' notice: baz notice: //Notify[bazquux]/message: defined 'message' as 'baz' is not equivalent to $user_groups = [ ["foo", "bar"], ["baz", "quux"] ] notify{ $user_groups: } which outputs: notice: foo notice: //Notify[foo]/message: defined 'message' as 'foo' notice: baz notice: //Notify[baz]/message: defined 'message' as 'baz' notice: bar notice: //Notify[bar]/message: defined 'message' as 'bar' notice: quux notice: //Notify[quux]/message: defined 'message' as 'quux' Obviously the second one manages to flatten the arrays and not the first one. This changeset adds flattening to the resource titles evaluations in order to be consitent in all cases. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-11Fix #1922 - Functions squash all arguments into a single hashBrice Figureau2-3/+4
Revert "Fix #1682 - ASTArray should flatten product of evaluation of its children" This reverts commit c7ccc4ba7c42d56595564491ae578a1604c628d1. Bug #1824 and #1922 proved the fix for #1682 and #1691 was wrong. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
2009-02-11Fixed #1538 - Yumrepo sets permissions wrongly on files in /etc/yum.repos.dJames Turnbull3-1/+7
2009-02-11Fixed #1936 - Added /* */ support to the vim fileJames Turnbull2-0/+3
2009-02-11Prefetching, and thus purging, Nagios resources now worksLuke Kanies6-56/+129
*only* if you use the default configuration file locations. In the end, this was a relatively minor change; most of the actual diff centers around making the code more readable so I could think my way into the fix, and adding tests for cases that were either untested or refactored slightly. Signed-off-by: Luke Kanies <luke@madstop.com>