summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fixing #961 - closing the http connection after every xmlrpc callLuke Kanies2009-02-123-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>
* Refactoring the XMLRPC::Client error-handlingLuke Kanies2009-02-122-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>
* Fixed #1959 - Added column protection for environment schema migrationJames Turnbull2009-02-122-2/+8
|
* Fixing #1869 - autoloaded files should never leak exceptionsLuke Kanies2009-02-123-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>
* Fixing #1543 - Nagios parse errors no longer kill PuppetLuke Kanies2009-02-114-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>
* Moving the transaction specs to the right pathLuke Kanies2009-02-111-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Refixing #1420 - _naginator_name is only used for servicesLuke Kanies2009-02-112-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>
* Fixed #1884 - exported defines are collected by the exporting hostLuke Kanies2009-02-115-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>
* Cleaning up the AST::Resource code a bitLuke Kanies2009-02-101-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>
* Fix #1691 - Realize fails with array of Resource ReferencesBrice Figureau2009-02-113-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>
* Fix #1682 - Resource titles are not flattened as they shouldBrice Figureau2009-02-112-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>
* Fix #1922 - Functions squash all arguments into a single hashBrice Figureau2009-02-112-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>
* Fixed #1538 - Yumrepo sets permissions wrongly on files in /etc/yum.repos.dJames Turnbull2009-02-113-1/+7
|
* Fixed #1936 - Added /* */ support to the vim fileJames Turnbull2009-02-112-0/+3
|
* Prefetching, and thus purging, Nagios resources now worksLuke Kanies2009-02-116-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>
* Adding some basic tests for the Naginator provider base classLuke Kanies2009-02-111-0/+50
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing a redundant instance prefect call.Luke Kanies2009-02-111-4/+0
| | | | | | | | | | | For some reason, Puppet::Type#evaluate was calling 'prefetch' on instances that support it, but prefetching is only a class-level functionality, normally -- in fact, it makes no sense unless done at the class level. This patch just removes the code. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1912 - gid still works with no 'should' value.Luke Kanies2009-02-113-0/+12
| | | | | | This makes 'ralsh' work again with users. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing the Rakefile to use 'git format-patch'.Luke Kanies2009-02-111-1/+1
| | | | | | | | Some releases of git no longer install hundreds of binaries, so the 'git-format-patch' binary is unavailable. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1920 - user passwords no longer allow ':'Luke Kanies2009-02-113-1/+17
| | | | | | | | | I wanted to include a snide remark in the error, but... Now you just get an exception when creating the user if the password includes this character. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding README.rst fileJames Turnbull2009-02-101-0/+38
|
* Added Reductive Labs build libraryJames Turnbull2009-02-103-0/+805
|
* Change the way the tags and params are handled in railsBrice Figureau2009-02-064-41/+105
| | | | | | | | | | | | | The rationale behind this patch is that it takes a lots of time to let rails unserialize the ParamValue and ResourceTag object on each compilation, just to throw them away the second after. The idea is to fetch directly (and batched host per host) the parameters and tags from the database and then returns them as hash. This allows the no-modification case to takes at least 2 times less than before. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add methods to return hash instead of objects to params and tagsBrice Figureau2009-02-062-12/+49
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Rails serialization module to help serialize/unserialize some Puppet ObjectsBrice Figureau2009-02-061-0/+18
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #1852 - Correct behaviour when no SELinux bindingsJames Turnbull2009-01-273-0/+16
|
* Merge commit 'turnbull/0.24.x' into 0.24.xLuke Kanies2009-01-072-3/+23
|\
| * Updated Red Hat spec file 0.24.7James Turnbull2008-12-162-3/+23
| |
* | Updated to version 0.24.7Luke Kanies2008-12-161-1/+1
|/
* Not using a temporary file when locking files for writing.Luke Kanies2008-12-153-49/+15
| | | | | | | | | | The temporary file was not actually useful, because we could never really get atomic renames, for annoying, complicated reasons. This hopefully finally fixes #1812. Signed-off-by: Luke Kanies <luke@madstop.com>
* Modifying the corruption-checking test.Luke Kanies2008-12-152-27/+3
| | | | | | | | | It is now more likely to fail if there's a problem, since the yaml should be corrupt, causing a yaml failure. Also removing the equivalent test from the Storage module. Signed-off-by: Luke Kanies <luke@madstop.com>
* Issue 1804 VDev with the same devices should be in syncAndrew Shafer2008-12-155-16/+158
| | | | | Added VDev and MultiVDev properties to the ZPool type to handle logic Vdevs with the same devices are now in sync even if the order changes
* Documentation fixesJames Turnbull2008-12-1324-130/+181
|
* Fixing #1812 (hopefully) - adding read and write locks to yaml.Luke Kanies2008-12-122-10/+26
| | | | | | | | It's obviously not really possible to test that this fixes it, but I'm confident that the locks work, and now we're using them, so it *should*. Signed-off-by: Luke Kanies <luke@madstop.com>
* Preparing to fix #1812 - Moving locking code to a moduleLuke Kanies2008-12-127-71/+237
| | | | | | | This moves the locking code out of Puppet::Util into a separate module, to make the code cleaner. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #1815 - puppetdoc --all crash on resource overrideBrice Figureau2008-12-101-1/+1
|
* Fix ZFS autorequire testAndrew Shafer2008-12-081-19/+19
| | | | Couldn't find a default provider because the world is not my laptop
* Add a unique name to objects so we can determine uniqueness when read back inJohn Ferlito2008-12-093-1/+9
| | | | | | | | | | | | | | | | | The nagios object definitions have been updated to correlate with Nagios 3.0.6. In Nagios it is possible to have multiple service checks with the same service_description. eg I could have an check with a service_description of 'SSH' for multiple hosts. So in puppet we can't use it as a unique name for the resource. This patch modifies the code to use $name as the unique name. For some types eg command_name $name ends up in the config and thus we can tell which puppet resources match to which nagios ones. For other types like service there is no direct mapping from $name to a nagios attibute. So we use a custom attribute called _naginator_name. Signed-off-by: John Ferlito <johnf@inodes.org>
* Fix launchd service test on non-OSX platformsJames Turnbull2008-12-091-1/+1
|
* Fix the spec tests to work on other platforms, do the confine around OS X ↵Nigel Kersten2008-12-094-89/+85
| | | | versions more sanely
* remove unnecessary mk_resource_methods callNigel Kersten2008-12-091-2/+0
|
* CHANGELOG updatesJames Turnbull2008-12-092-5/+51
|
* Add a unique name to objects so we can determine uniqueness when read back inJohn Ferlito2008-12-093-74/+117
| | | | | | | | | | | | | | | | | The nagios object definitions have been updated to correlate with Nagios 3.0.6. In Nagios it is possible to have multiple service checks with the same service_description. eg I could have an check with a service_description of 'SSH' for multiple hosts. So in puppet we can't use it as a unique name for the resource. This patch modifies the code to use $name as the unique name. For some types eg command_name $name ends up in the config and thus we can tell which puppet resources match to which nagios ones. For other types like service there is no direct mapping from $name to a nagios attibute. So we use a custom attribute called _naginator_name. Signed-off-by: John Ferlito <johnf@inodes.org>
* Bug #1803 Zfs should auto require the ancestor file systemsAndrew Shafer2008-12-082-0/+23
|
* Refactor #1802 Use 'zfs get -H -o value' instead of parsing output for valueAndrew Shafer2008-12-082-14/+3
| | | | just simplifying code
* Fixing #1800 - tidy now correctly ignores missing files and directoriesLuke Kanies2008-12-082-1/+16
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1794 - returning sync when it is already initializedLuke Kanies2008-12-081-0/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1750 again - All of the properties and now :ensure check replace?Luke Kanies2008-12-082-0/+25
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix rake abort when there is a matching confineBrice Figureau2008-12-081-1/+1
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* spec tests for type and provider and some code cleanup to adhere to DRYNigel Kersten2008-12-064-160/+416
|