summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Add shellquote() function.Thomas Bellman2009-08-081-0/+41
| | | | | | | | | | This adds a new function shellquote() which can be used for quoting arguments in shell commands used in the exec type. This only supports Unixoid operating systems. Other systems would likely require some other quoting. Signed-off-by: Thomas Bellman <bellman@nsc.liu.se>
* Fixes #2499. Allows execs to specify an array for the returns parameterNigel Kersten2009-08-081-6/+7
|
* Updated fix for #2481James Turnbull2009-08-051-3/+5
|
* Revert "Fxied #2481 - Added status and restart overrides for Red Hat service ↵James Turnbull2009-08-051-4/+4
| | | | | | provider." This reverts commit 967eb9f52938d8849b99686bf2c0b9da9a183399.
* Logs now assume resource params have metadataLuke Kanies2009-08-031-1/+1
| | | | | | | | | | | We were previously not assuming they had it, because I figured there were just a couple that didn't. On closer inspection, none of them did. The previous commit fixed that, so this commit fixes the assumption. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding metadata delegation from param to resourceLuke Kanies2009-08-032-13/+19
| | | | | | | | | | This is for file, line, version, and tags, with the parameter name added to the tags. This is mostly so logs generated by the parameters work better. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding many tests for #2371, and slightly refactoringLuke Kanies2009-08-031-19/+19
| | | | | | | | This mostly focuses on adding all of the detailed tests for this new code, but it also cleans the code up just a little bit. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixes for Redmine 2371.Steven Jenkins2009-08-032-125/+89
| | | | | | | | | | | This changes the condition checking of handlebucket, as well as moves it (and remove_backup) into a separate module. It additionally refactors common code out of handlebucket into separate private methods. Some new RSpec tests which use mock and stubs are added as well, including removing the old test/ral/type/filebucket.rb tests since they are already covered by RSpec tests.
* Fixes #2464, #2457. Deprecate reportserver for report_server. Add ↵Nigel Kersten2009-08-042-2/+17
| | | | report_port setting. Add tests.
* Fixing #2484 - "format missing" messages are betterLuke Kanies2009-08-041-2/+2
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixes #2483 - Log only copies metadata from RAL objectsLuke Kanies2009-08-041-9/+14
| | | | | | | | | | | | | | | | | | | We were previously trying to figure out what data was available based on what methods existed, but that caught a different method profile from modules. This fixes it so we only look for this data from Puppet::Type or Puppet::Parameter instances. I had to add the ability to skip data that's not available, since File's 'ensure' parameter doesn't have 'file' data, I assume because of the metaprogramming we do around the 'file' value for 'ensure'. It's a workaround for now, and there's a test in there to verify it, anyway. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #2486 - Missing require 'monitor' in parser_support.rbJames Turnbull2009-08-041-0/+1
|
* Fxied #2481 - Added status and restart overrides for Red Hat service provider.James Turnbull2009-08-031-4/+4
|
* rack: SSL Env vars can be in Request.env or ENVChristian Hofstaedtler2009-08-033-8/+26
| | | | | | | Fix #2386, by checking either Request.env or ENV for the SSL environment variables. This is necessary as Passenger 2.2.3 changed the location of these vars, even though the Rack spec says nothing about ENV or these variables.
* rack: don't directly use the forbidden HTTP_CONTENT_TYPE env var (fixes rack ↵Christian Hofstaedtler2009-08-031-1/+1
| | | | specification conformance)
* Cleaning up tests for #2469Luke Kanies2009-08-031-32/+15
| | | | | | | This is a small refactor of the filebucket type, and a larger refactor of the tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* default server in remote filebucketsTill Maas2009-08-031-23/+31
| | | | | | | | | | | | With the path parameter set to false, the server defaults to Puppet[:server]. This allows to use a remote filebucket without syncing the servername there with the one used on the config file. To use the default server, this manifest can be used: filebucket { main: path => false } A related bug report is: http://projects.reductivelabs.com/issues/2456
* Fixed #2294 - Classes sometimes cannot be foundMarkus Roberts2009-08-031-52/+63
| | | | | | | | | | | | | | | | | | | | | | | | This patch should fix the race condition causing ticket 2294; it extends the loading logic so that: * initial load attempts are processed (as before), * recursive load attempts return immediately (as before), * but subsequent concurrent load attempts from different threads wait on a semaphore (condition variable) and then retry (e.g. use the now-valid results of the first thread). This is a slight modification of the solution I'd originally proposed, to prevent a deadlock that could have arisen if three or more threads simultaneously attempted to load the same item. Though it solves the bug as reported, it has room for improvement: * Failures aren't cached, so repeated attempts will be made to import invalid items each time they are encountered * It doesn't address any of the underlying referential ambiguity (module vs. filename) * The threading logic should probably be refactored into a separate class (as a start I encapsulated it in an ad hoc singleton class, so at least it isn't cluttering up the load method) Signed-off-by: Markus Roberts <Markus@reality.com>
* Adding #2477 - puppet can apply provided catalogsLuke Kanies2009-08-022-9/+45
| | | | | | | | | | | | This provides the other half of #2440 - you can compile catalogs into json with puppetmasterd, and now you can take those json catalogs and apply them. This allows you to use whatever mechanism you want to ship the catalogs around. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing problems my Feature refactor causedLuke Kanies2009-08-021-3/+4
| | | | | | | | | The problems were that I wasn't propagating return values sufficiently, such that false values didn't travel enough, and the 'name' attribute was necessary in the private method but wasn't actually passed in. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing tests broken by caching autoload resultsLuke Kanies2009-08-021-1/+1
| | | | | | | | | These tests tried to load something, verified the loads didn't work, and then created the thing to load. This is a bit silly, so I just removed those sections of the tests. Signed-off-by: Luke Kanies <luke@madstop.com>
* Migrating Feature tests to specLuke Kanies2009-08-021-15/+21
| | | | | | | | | | This was to fix a failing test/unit test. Test coverage is now a bit better, more maintainable, and I refactored the code just slightly to make it a bit cleaner. Signed-off-by: Luke Kanies <luke@madstop.com>
* Logging the configuration version we're applyingLuke Kanies2009-08-011-0/+2
| | | | | | | This is just an additional info log in the transaction, and is only done if the version is non-nil. Signed-off-by: Luke Kanies <luke@madstop.com>
* Configuration version information is now in logsLuke Kanies2009-08-012-1/+11
| | | | | | | | | | The log instances have file, line, and config version information, although it's not currently printed. It's available in the reports, and you can strip it out with your own processors. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding support for an external catalog versionLuke Kanies2009-08-012-2/+16
| | | | | | | | This allows you to specify a command used to determine the catalog version. Also added an integration test to verify the version cascades. Signed-off-by: Luke Kanies <luke@madstop.com>
* Implement node matching with regexesBrice Figureau2009-08-016-572/+604
| | | | | | | This patch enhance AST::HostName to support regexes, and modifies the parser to allow regex to be used as node name. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>]
* Make sure node are referenced by their namesBrice Figureau2009-08-016-579/+600
| | | | | | | | | This patch uses the unused AST::HostName as the only way to reference a node in the AST nodes array. The AST::HostName respect the hash properties of the underlying string, to keep the O(1) hash properties. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Enhance selector and case statements to match with regexpBrice Figureau2009-08-015-617/+652
| | | | | | | | | | | | | | | | | | | | | | | | | The case and selector statements define ephemeral vars, like 'if'. Usage: case statement: $var = "foobar" case $var { "foo": { notify { "got a foo": } } /(.*)bar$/: { notify{ "hey we got a $1": } } } and for selector: $val = $test ? { /^match.*$/ => "matched", default => "default" } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2033 - Allow regexp in if expressionBrice Figureau2009-08-015-635/+692
| | | | | | | | | | | | | | | | | | | This changeset introduces regexp in if expression with the use of the =~ (match) and !~ (not match) operator. Usage: if $uname =~ /Linux|Debian/ { ... } Moreover this patch creates ephemeral variables ($0 to $9) in the current scope which contains the regex captures: if $uname =~ /(Linux|Debian)/ { notice("this is a $1 system") } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add AST::Regex, an AST leaf node representing a regexBrice Figureau2009-08-013-38/+93
| | | | | | Add a regex rule (unused for the moment) to the parser. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add regexes and regex match operators to the parserBrice Figureau2009-08-012-775/+773
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Add regex, match and not match token to the lexerBrice Figureau2009-08-011-0/+7
| | | | | | | | | | The lexer recognizes regex delimited by / as in: /^$/ The match operator is defined by =~ The not match operator is defined by !~ Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Allow variable $0 to $9 to be interpolated, if ephemeralBrice Figureau2009-08-011-2/+7
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Implement ephemeral scope variablesBrice Figureau2009-08-012-19/+44
| | | | | | | | | | Those variables have been created to be short lived and used mainly to define temporary special variables. They do not persist after a call to unset_ephemeral_var. Also Scope#set_ephemeral_from can be used to promote a regexp MatchData to ephemeral values. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Modifying the REST client error to make server errors more clearLuke Kanies2009-08-011-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixes #2472. Load Facter facts when ralsh is invoked, plus test.Nigel Kersten2009-08-011-0/+2
|
* Fixes #2461. Provide new and old code paths for macosx_productversion_major ↵Nigel Kersten2009-07-311-1/+12
| | | | with deprecation warning
* Fixing #2440 - catalogs can now be compiled on demandLuke Kanies2009-07-311-1/+27
| | | | | | | | | This uses the locally cached yaml facts and prints the catalog in json. It's meant to be used one-time, but you have to use puppetmasterd since we assume it's the executable correctly configured for compilation. Signed-off-by: Luke Kanies <luke@madstop.com>
* Exiting from app failures instead of raisingLuke Kanies2009-07-311-5/+16
| | | | | | | This protects the user from seeing stack traces in normal situations. It makes sense here because this is explicitly for user interactions. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2465 - Default auth information is confusing with no auth.confBrice Figureau2009-07-301-1/+1
| | | | Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2459 - puppetdoc added namespace classes as RDoc modules instead of classesBrice Figureau2009-07-302-1/+9
| | | | | | | | | | | | | Puppetdoc while parsing a class name creates intermediate RDoc classes to form a hierarchy. Due to a coding error, those intermediate classes were created as RDoc modules. Later, when puppetdoc was parsing the definition of one of this class, it wasn't finding it in RDoc list of classes (since it was recorded as a module). Puppetdoc was then creating documentation for two objects of the same name. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2448 - fix the broken runit provider and testsBrice Figureau2009-07-291-0/+10
| | | | | | | The runit provider was broken when the daemontools provider was enhanced.This patch aims to fix this. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #2405 - Mount parameter "dump" doesn't accept all valid values on FreeBSDJames Turnbull2009-07-291-2/+7
|
* Fixes #2362. Do not validate users/groups when supplied with numeric uid/gidsNigel Kersten2009-07-292-0/+12
|
* Fix #2454 - Definition named after a module don't show in puppetdocBrice Figureau2009-07-281-2/+0
| | | | | | | | RDoc#find_local_symbol can return a module. So if you have a defition of the same name as the module in which it is defined we weren't producing documentation for it. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2453 - puppetdoc mixes long class names that look alikeBrice Figureau2009-07-281-2/+14
| | | | | | | | | | The issue is that RDoc (the engine producing the documentation) is buggy: With a class named: A::C and a class named: D::A::E Then RDoc was attaching E under the root ::A and not D::A. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2422 & #2433 - make sure puppetdoc transform AST::Leaf boolean correctlyBrice Figureau2009-07-255-25/+35
| | | | | | | | | | AST nodes don't have a valid to_s that is producing a correct representation of said node. This patch adds some of the AST node to_s to produce correct values that can be used verbatim by puppetdoc to render the documentation. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixing #2296 - overlapping recursions work againLuke Kanies2009-07-251-1/+29
| | | | | | | | | | | | This fixes the behaviour when you have file recursions that overlap - we again correctly use the most specific information. It's still a bit expensive when you do this, but at least it behaves correctly, and it should be a rare circumstance. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2423 - no more strange dependency cyclesLuke Kanies2009-07-251-1/+5
| | | | | | | | | | | | | | | We were getting strange dependency cycles because our class structure mirrored our scope structure. We can't change the scope structure without switching from a dynamically scoped language to a lexically scoped language, which is too big of a change to make right now. Instead, I'm changing the resource graph so that all classes default to just having an edge to the 'main' graph. This will be a behaviour change for many, in that you were getting automatic dependencies from this old behaviour, but it will bring consistency. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2443: Adding debugging guidance to dep cycle errorsLuke Kanies2009-07-251-1/+1
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>