summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixed #1472 -- defined, exported resources in the current compile now get ↵Luke Kanies2008-09-251-1/+2
| | | | | | | | | expanded correctly. This was working for defined resources in the db, but not in the current compile. I just had to mark the resources as non-exported.
* Fixed #1045 - Multiple metaparams all get added to resources.Luke Kanies2008-09-241-1/+1
| | | | | | | The problem was that I was using a 'return' in a loop where I should have been using a 'next'. Signed-off-by: Luke Kanies <luke@madstop.com>
* Add an append (+=) variable operator:Brice Figureau2008-09-215-716/+760
| | | | | | | | | | | | | | | | | | | The append variable operator can be used to append something to a variable defined in a parent scope, containing either a string or an array. The main use is to append array elements in classes to a variable globally defined in a node. Example: $ssh_users = ['brice', 'admin1'] class backup { $ssh_users += ['backup_operator'] ... } Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixed #1488 - Moved individual functions out of functions.rb intoJames Turnbull2008-08-2613-217/+208
| | | | | the lib/puppet/parser/functions directory. New functions should be created in this directory.
* Fix leaking LoadedFile when adding templates to be watchedAndrew Shafer2008-08-231-13/+18
|
* Fix #1502 - abysmal storeconfig performance - part2Brice Figureau2008-08-171-2/+10
| | | | | | | | | | | | | | Resource parameters whose values are a resource reference (ie require, notify...) where always DELETEd/INSERTed because the code comparing resource reference compared object instances instead of their values (since Puppet::Parser::Resource::Reference doesn't override == ), leading to storeconfig performance issues. The correct fix would have been to define == in Puppet::Parser::Resource::Reference but that might introduce some side effects I don't know. Hence, the fix introduces a local compare() method that knows how to compare Puppet::Parser::Resource::Reference. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
* Fixes #1274 - allow class names to start with numbersJames Turnbull2008-08-171-1/+1
|
* Added tests for TemplateWrapper's use of Scope#to_hash.Luke Kanies2008-08-091-11/+10
| | | | | | We should deprecate the method_missing stuff in 0.25. Signed-off-by: Luke Kanies <luke@madstop.com>
* Expose all puppet variables as instance member variables of the template ↵Daniel Pittman2008-08-012-13/+59
| | | | | | | | | | | | | | | | | wrapper. This helps resolve redmine #1427, by providing a safe mechanism to access variables. * Implement Puppet::Parser::Scope#to_hash, which returns a hash containing all the variable bindings in the current and, optionally, parent scope. * Use that to set instance member variables into Puppet::Parser::Templatewrapper * Report the time taken for variable binding at debug level, to help identify any performance regression that is encountered in the real world. * Rename the @scope and @file members of the template wrapper, to avoid clashing with a scope variable exposed within puppet. Signed-off-by: Daniel Pittman <daniel@rimspace.net> (cherry picked from commit ba220b41e4f509f2632e2664d332e49b20a70ea7)
* Fixed #1396 - Added sha1 function from DavidS to coreJames Turnbull2008-07-082-1/+9
|
* Issue 1215Andrew Shafer2008-06-131-17/+2
| | | | | | Removed logic to reuse parser and log on server when there is a parsing error. Now we just make a new parser and if there is an error, raise it up, which will result in errors on the client logs.
* Fixing #1242 -- lack of storeconfigs only produces warning, not exception.Luke Kanies2008-05-263-6/+12
| | | | | Exporting or collecting resources no longer raises an exception when no storeconfigs is enabled, it just produces a warning.
* Put function in ticket #311 in correct locationJames Turnbull2008-05-241-0/+16
|
* Correcting whitespace in the templatewrapper code.Luke Kanies2008-05-131-6/+6
| | | | Also slightly modified the wording of some of the tests.
* Adding has_variable? support, fixing ticket #1177Adam Jacob2008-05-131-0/+9
|
* Clarifying the exception when there's a syntax error but a valid parser.Luke Kanies2008-05-121-1/+1
| | | | This is related to #1215.
* Fixing an error message to be more clearLuke Kanies2008-05-011-1/+1
|
* Fix for ticket #1209James Turnbull2008-04-301-1/+1
|
* Modified the 'master' handler to use the Catalog class toLuke Kanies2008-04-111-0/+6
| | | | | | | | | | compile node configurations, rather than using the Configuration handler, which was never used directly. I removed the Configuration handler as a result. Modified the 'master' handler (responsible for sending configurations to clients) to always return Time.now as its compile date, so configurations will always get recompiled.
* Fixed #1184 -- definitions now autoload correctly all of the time.Luke Kanies2008-04-101-2/+6
|
* Found an array that leaked pretty quickly between reparsingLuke Kanies2008-03-211-9/+12
| | | | | | | | | | 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).
* Always duplicating resource defaults in the parser, so thatLuke Kanies2008-03-062-21/+17
| | | | | | stacked metaparameter values do not result in all resources that receive a given default also getting those stacked values.
* Fixing the fact that resources that model defined resourcesLuke Kanies2008-02-291-0/+7
| | | | | were getting finished multiple times, which meant they got multiple copies of metaparams.
* Fixed #1047 -- Puppet's parser no longer changes the orderLuke Kanies2008-02-281-21/+3
| | | | | | in which statements are evaluated, which means that case statements can now set variables that are used by other variables.
* Fixed #1063 -- the master correctly logs syntax errors whenLuke Kanies2008-02-281-1/+5
| | | | reparsing during a single run.
* Fixing #1092 by no longer using the resource reference toLuke Kanies2008-02-281-3/+2
| | | | | | 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.
* Fixing #1085, I think -- I was not returning a resourceLuke Kanies2008-02-252-4/+8
| | | | | | 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.
* Fixing #1084 -- the node catalog asks the individualLuke Kanies2008-02-251-0/+9
| | | | | | resources whether they're isomorphic, and they in turn ask the resource types (or default to true for defined resource types).
* Corrected #1040 fix - this should now be right - trace was after raiseJames Turnbull2008-02-251-3/+1
|
* Second attempt fix address ticket #1040James Turnbull2008-02-191-3/+6
|
* Attempt to fix #1040 - catching errors in compilationJames Turnbull2008-02-191-1/+5
|
* Fixed #1003 -- Applying DavidS's patch to fix searching forLuke Kanies2008-02-131-1/+1
| | | | tags in sql.
* Fixed #968 again, this time with tests -- parseonly works,Luke Kanies2008-02-134-27/+32
| | | | | including not compiling the configurations, and also storeconfigs is no longer required during parse-testing.
* Merge commit 'bartv/pending/fix-997' into 0.24.xLuke Kanies2008-02-121-2/+6
|\
| * Fix bug #997, only evaluate non-virtual definitionsBart Vanbrabant2008-01-221-2/+6
| |
* | Moving the ast node tests to rspec (which I could haveLuke Kanies2008-02-125-38/+24
| | | | | | | | | | | | | | *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.
* | Removing the last remaining vestiges of GRATR --Luke Kanies2008-02-111-3/+3
| | | | | | | | removing the bangs from 'add_vertex!' and 'add_edge!'.
* | Changing the name of the Compile class to Compiler,Luke Kanies2008-02-1112-32/+32
| | | | | | | | | | since it's stupid to have a class named after a verb.
* | Refactoring the interface between the Compile classLuke Kanies2008-02-111-3/+1
| | | | | | | | | | and the AST::Node class to match that to the definitions and AST classes.
* | Changing some methods in the Compile class toLuke Kanies2008-02-115-27/+27
| | | | | | | | | | be more internally consistent (switched store_resource to add_resource, and store_override to add_override).
* | Fixed #1030 - class and definition evaluation has been significantlyLuke Kanies2008-02-113-28/+27
| | | | | | | | | | | | refactored, fixing this problem and making the whole interplay between the classes, definitions, and nodes, and the Compile class much cleaner.
* | Converting the Compile class to use a Node::Catalog instanceLuke Kanies2008-02-112-57/+11
| | | | | | | | | | as its resource container, instead of having its own behaviour around resource uniqueness.
* | Moving all of the tests for Puppet::Parser::Compile toLuke Kanies2008-02-113-20/+17
| | | | | | | | | | | | rspec, so I can refactor the class to more heavily rely on a Node::Catalog instead of doing its own resource container management.
* | More AST refactoring -- each of the code wrapping classesLuke Kanies2008-02-086-266/+256
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Refactoring the AST classes just a bit. I realized thatLuke Kanies2008-02-0822-110/+68
| | | | | | | | | | | | 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.
* | Removing some obsolete code from the AST base classLuke Kanies2008-02-081-39/+3
| |
* | Ceasing autoloading ast files; loading them manually insteadLuke Kanies2008-02-081-7/+21
| |
* | Merge commit 'bartv/pending/fix-933' into 0.24.xLuke Kanies2008-02-051-0/+2
|\ \
| * | Store a resource before adding relations to it otherwise activerecord willBart Vanbrabant2008-02-031-0/+2
| |/ | | | | | | complain. This fixes #933
* | Fixing #1017 -- environment-specific modulepath is noLuke Kanies2008-02-041-1/+1
| | | | | | | | longer ignored. (Cherry-picked from master.)