summaryrefslogtreecommitdiffstats
path: root/lib/puppet
Commit message (Collapse)AuthorAgeFilesLines
* Fixes #2258,#2257,#2256. Maintain correct type for integers/booleans, allow ↵Nigel Kersten2009-07-112-7/+39
| | | | correct values, and fix rule array handling
* Added Markdown mode to puppetdoc to output Markdown.James Turnbull2009-07-102-8/+54
| | | | Requires the pandoc binary to function (http://johnmacfarlane.net/pandoc/).
* Allow boolean value for boolean cli parameterBrice Figureau2009-07-101-0/+2
| | | | | | | | This is to fix puppetdoc boolean parameters. Puppetdoc defers sending parameters to Puppet::Util::Setting, and in this case, boolean parameters are stored as a boolean value. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2364 - Associates the correct comment to the right statementBrice Figureau2009-07-102-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the problem that we associate documentation in the lexer and not in the parser (which would be to complex and unmaintenable to do), and since the parser reads new tokens before reducing the current statement (thus creating the AST node), we could sometimes associate comments seen after a statement associated to this one. Ex: 1. $foo = 1 2. # doc of next class 3. class test { When we parse the first line, the parser can reduce this to the correct VarDef only after it lexed the CLASS token. But lexing this token means we already pushed on the comment stack the "doc of next class" comment. That means at the time we create the AST VarDef node, the parser thinks it should associate this documentation to it, which is incorrect. As soon as the parser uses token line number, we can enhance the lexer to allow comments to be associated to current AST node only if the statement line number is greater or equal than the last comment line number. This way it is impossible to associate a comment appearing later in the source than a previous statement. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Make sure the parser sees the correct line numberBrice Figureau2009-07-104-233/+292
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Careful inspection of the parser code show that when we associate a source line number for an AST node, we use the current line number of the currently lexed token. In many case, this is correct, but there are some cases where this is incorrect. Unfortunately due to how LALR parser works the ast node creation of a statement can appear _after_ we lexed another token after the current statement: 1. $foo = 1 2. 3. class test When the parser asks for the class token, it can reduce the assignement statement into the AST VarDef node, because no other grammar rule match. Unfortunately we already lexed the class token so we affect to the VarDef node the line number 3 instead of 1. This is not a real issue for error reporting, but becomes a real concern when we associate documentation comments to AST node for puppetdoc. The solution is to enhance the tokens lexed and returned to the parser to carry their declaration line number. Thus a token value becomes a hash: { :value => tokenvalue, :line } Next, each time we create an AST node, we use the line number of the correct token (ie the foo line number in the previous example). Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2366 - puppetdoc was parsing classes in the wrong orderBrice Figureau2009-07-101-1/+2
| | | | | | | | | | | | It could happend that we were generating doc for subclasses before classes, in which case we were forgotting some parent class instance and recreating them. We ended up generating doc for some classes multiple times, from which some were missing documentation. The fix is to sort the parsed classes alphabetically, which auto- matically puts enclosing class before enclosed classes. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #2367 - Mongrel::HTTPRequest returns a StringIO objectJames Turnbull2009-07-081-1/+1
| | | | | | | | When the PUT body is large enough that Mongrel::HTTPRequest#body returns a StringIO object instead of a String. StringIO#to_s then returns "<StringIO#8236987299>" instead of the string contents. When that string is passed to YAML it returns false which is then passed to save_object without any real time checking. This is a combination of patches from Jordan Curzon and Ricky Zhou.
* Fix #2082 - puppetca shouldn't list revoked certificatesBrice Figureau2009-07-072-2/+19
| | | | | | | | This patch does two things: * it enhance puppetca to list revoked certificates (prefixed by -) * it fixes the ca crl verification which was broken Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2348 - Allow authstore (and REST auth) to match allow/deny against ↵Brice Figureau2009-07-071-3/+10
| | | | | | | | | | | | | | | opaque strings This patch removes the limitation of allow/deny which were only matching ip addresses or hostname (or pattern of). It makes sure any kind of string can be matched (by strict equality) while still keeping the old behaviour. Opaque strings can only contains: alphanumeric characters, - _ and @. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fix #2392 - use Content-Type for REST communicationBrice Figureau2009-07-056-18/+72
| | | | | | | | | | | | | | | | | | | There were two problems: * server->client communications is using Content-Type with the direct format name instead of the format mime-type. * client->server communications is not using Content-Type to send the format of the serialized object. Instead it is using the first member of the Accept header. The Accept header is usually reserved for the other side, ie what the client will accept when the server will respond. This patch makes sure s->c communication contains correct Content-Type headers. This patch also adds a Content-Type header containing the mime-type of the object sent by the client when saving. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #2293 - Added cron syntax X-Y/Z and '7' for sundayJames Turnbull2009-07-051-3/+8
|
* Switching to LoadedCode from ASTSetLuke Kanies2009-07-058-82/+69
| | | | | | | | I also took the opportunity to clean up and simplify the interface to the parts of the parser that interact with this. Mostly it was method renames. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a special class to handle loaded classes/defines/nodesLuke Kanies2009-07-051-0/+85
| | | | | | | | | This class is extracted from the Parser class, and the main driver for it is to enable us to put mutexes around some of the hashes to see if they're the source of a race condition. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2383, an incompatibility with early ruby 1.8 versionsChristian Hofstaedtler2009-07-051-1/+2
| | | | | Earlier ruby 1.8 versions do not have start_with? for Strings. Found by John Barbuto.
* Fixing #2238 In some cases blank? is not available on String.Jordan Curzon2009-07-041-1/+1
| | | | Signed-off-by: Jordan Curzon <curzonj@gmail.com>
* Fixing #2238 - Deal with nil hash keys from mongrel paramsJordan Curzon2009-07-021-0/+2
| | | | | | | | Mongrel::HttpRequest.query_parse outputs a params hash with nil keys given certain query strings. Network::HTTP::Handler.decode_params needs to check the incoming values. Signed-off-by: Jordan Curzon <curzonj@gmail.com>
* Set ENV['PATH'] to an empty string if non-existentNigel Kersten2009-06-281-1/+1
| | | | Signed-off-by: Nigel Kersten <nigelk@google.com>
* Fixing #2197 - daemontools tests now passLuke Kanies2009-06-261-18/+36
| | | | | | | This actually involved a bit of rewriting of the code, but the code's simpler now, too. Signed-off-by: Luke Kanies <luke@madstop.com>
* Change the diff default output to "unified"Stig Sandbeck Mathisen2009-06-261-1/+1
|
* Added missing colon to suntabMartin Englund2009-06-261-1/+2
|
* Fixed #2087 and refactored the code that gets the smf service stateMartin Englund2009-06-261-31/+19
|
* Using the logging utilities to clean up module warningsLuke Kanies2009-06-191-1/+12
| | | | | | | This just makes it easier to add context to warnings and other logs from the module. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #1064 - Deprecating module 'plugins' directoriesLuke Kanies2009-06-191-1/+12
| | | | | | | | | You should now use 'lib' instead of 'plugins'. The old directory still works, but you get a warning for every module that uses it. Signed-off-by: Luke Kanies <luke@madstop.com>
* Removing deprecated :pluginpath settingLuke Kanies2009-06-191-6/+0
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixing #2094 - filebucket failures are clearer nowLuke Kanies2009-06-161-1/+6
| | | | | | We just add a bit of information to the exception. Signed-off-by: Luke Kanies <luke@madstop.com>
* Refactoring part of the file/filebucket integrationLuke Kanies2009-06-141-42/+30
| | | | | | | | | | The goal of this commit is to fix ordering issues that could result when the filebuckets are added to the catalog after the resources that use them. This condition showed up somewhat arbitrarily. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed pi binary so --meta option works and updated documentationDavid Lutterkort2009-06-131-1/+1
| | | | Signed-off-by: James Turnbull <james@lovedthanlost.net>
* Fixing #2323 - Modules use environments correctlyLuke Kanies2009-06-121-1/+1
| | | | | | | | Previously, modules were not using their environments when looking up their paths, which meant that they often found files in the wrong environment. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fixed #2102 - Rails feature update fixed for Debian and UbuntuJames Turnbull2009-06-131-1/+1
|
* Fix #2333 - Make sure lexer skip whitespace on non-tokenBrice Figureau2009-06-121-1/+4
| | | | | | | | | Comments and multi-line comments produces no token per-se during lexing, so the lexer loops to find another token. The issue was that we were not skipping whitespace after finding such non-token. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Updated split function and add split function unit tests (courtesy of Thomas ↵James Turnbull2009-06-121-6/+22
| | | | Bellman)
* * provider/augeas: strip whitespace and ignore blank linesDavid Lutterkort2009-06-121-0/+2
| | | | Signed-off-by: James Turnbull <james@lovedthanlost.net>
* Fixed pi testsJames Turnbull2009-06-121-1/+7
|
* Fixed #2222 - Cleanup pi binary options and --help outputJames Turnbull2009-06-121-14/+4
|
* Fixing #2336 - qualified variables only throw warningsLuke Kanies2009-06-111-2/+4
| | | | | | | | | We were previously throwing exceptions. This also ports all of the tests for variable lookup over to rspec. Signed-off-by: Luke Kanies <luke@madstop.com>
* Fix #2246 - take2: make sure we run the rails tag query only when neededBrice Figureau2009-06-111-1/+8
| | | | | | | | | Adding the tags to the rails collect query can reduce performance because there are 2 more tables to join with. So we make sure to include tags in the query only when it is necessary. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Make sure overriding a tag also produces a tagBrice Figureau2009-06-111-3/+6
| | | | | | | This is so that overriding the "tag" metaparameter ends-up in the resource tags on the server. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Clearn up a parsing error reported by the testsBryan Kearney2009-06-101-2/+2
|
* Fix #1907 (or sort) - 'require' puppet functionBrice Figureau2009-06-101-0/+34
| | | | | | | | This function acts exactly as the 'include' function, but also adds an ordering relation between the included class and the class where the require function is. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* #2332: Remove trailing slashes from path commands in the pluginBryan Kearney2009-06-091-0/+1
|
* Changing the preferred serialization format to jsonLuke Kanies2009-06-062-9/+1
| | | | | | | | | This won't affect most people, but it's a good default to have for those who can support it. Signed-off-by: Luke Kanies <luke@madstop.com> Minor changes to previous commit
* Switching Queueing to using JSON instead of YAMLLuke Kanies2009-06-064-16/+28
| | | | | | This provides about a 75x speedup, so it's totally worth it. The downside is that queueing requires json, but only on the server side.
* Adding JSON support to CatalogsLuke Kanies2009-06-062-0/+68
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Providing JSON support to the Resource classLuke Kanies2009-06-061-3/+69
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a JSON utility module for providing Ruby compatLuke Kanies2009-06-061-0/+13
| | | | | | | This provides the class-method behaviour that Ruby's JSON support expects but that we don't provide. Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding JSON support to Puppet::RelationshipLuke Kanies2009-06-061-1/+32
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a JSON formatLuke Kanies2009-06-062-1/+34
| | | | Also making some log messages more informative.
* Allowing formats to specify the individual method names to useLuke Kanies2009-06-061-22/+28
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Allowing formats to specify the methods they requireLuke Kanies2009-06-061-15/+52
| | | | Signed-off-by: Luke Kanies <luke@madstop.com>
* Adding a "json" featureLuke Kanies2009-06-063-1/+6
| | | | | We have to guarantee that the Rails code is loaded before the JSON code, because Rails includes its own incompatible JSON support.