summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2.7.x'Nick Lewis2011-08-242-13/+22
|\ | | | | | | | | | | | | | | | | | | Conflicts: lib/puppet/feature/base.rb lib/puppet/file_serving/configuration.rb spec/unit/indirector/ssl_file_spec.rb spec/unit/parser/functions/extlookup_spec.rb spec/unit/resource/catalog_spec.rb test/language/ast/variable.rb
| * (#8268) Require windows drive letters in absolute file pathsJosh Cooper2011-08-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | When testing whether a file path is absolute, the regexp was only handling POSIX style file paths. This commit requires Windows style file paths to start with a drive letter. A future commit will refacter the various places we do path validation to support both Windows drive letters and UNC paths. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com> (cherry picked from commit 45ae5b4a9ced26dfcd3e324391f9a26cb02bf93d)
| * Merge pull request #48 from ↵Matt Robinson2011-08-181-3/+0
| |\ | | | | | | | | | | | | daniel-pittman/maint/2.7.x/strip-incorrect-rights-statements Maint/2.7.x/strip incorrect rights statements
| | * maint: remove inaccurate copyright and license statements.Daniel Pittman2011-08-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For a while Luke, and other authors, injected a created tag, copyright statement, and "All rights reserved" into every new file they added to the Puppet project. This isn't really true, and we have a global license covering the code, so we have now stripped out all those old tags. Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
| * | Maint: Fix line wrapping in create_resources functionnfagerlund2011-08-181-2/+4
| |/ | | | | | | | | This is a cosmetic commit improving the line wrapping in the create_resources function's documentation string.
| * Maint: Improve create_resources function's doc stringnfagerlund2011-08-171-10/+20
| | | | | | | | | | | | | | The create_resources function's doc string was not particularly clear and had incorrect markdown formatting. This commit adds a more complete example which demonstrates the necessary hash format, and changes the doc string to a heredoc to simplify escaping.
* | Merge branch '2.7.x'Matt Robinson2011-08-151-8/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.x: (25 commits) (#4411) Explain that runinterval = 0 does not mean "never run" Maint: Fix missing option text in puppet agent and arrange options alphabetically (#8302) Improve documentation of exec providers (#7853) Clarify and complete docs for the tagmail report processor Maint: Mention that audit metaparameter will accept "all" Maint: Adjust wording for file type's content parameter Maint: Fix poor documentation for versioncmp function. maint: Fix case sensitive require maint: Add inspect app options to help maint: Fix inspect help Increment lib/puppet.rb VERSION string Updated CHANGELOG for 2.7.3rc1 (#4762) Ensure that clients on the moon can successfully connect. Add document outlining preferred contribution methods Add document outlining preferred contribution methods Add document outlining preferred contribution methods Revert "Merge branch 'vcsrepo'" Revert "Merge branch 'vcsrepo'" Updating CHANGELOG for 2.7.2rc3 (#8704) Give better errors for invalid fileserver.conf ... Manually Resolved Conflicts: lib/puppet/parser/functions/versioncmp.rb spec/integration/node/facts_spec.rb
| * Maint: Fix poor documentation for versioncmp function.nfagerlund2011-08-091-6/+9
| | | | | | | | | | | | The versioncmp function's documentation was missing punctuation and was unnecessarily vague. This commit clarifies the return data and makes the documentation more legible at a glance.
| * Merge branch '2.7rc' into 2.7.xMichael Stahnke2011-07-253-0/+78
| |\
| * | (#8032) Add containment to create_resourcesJeff McCune2011-07-101-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this change native resource types declared using the create_resources() function are not contained within the class scope of the function call. As a result, resources were "floating off" in the graph, disconnected from the rest of the relationship edges. With this change, the scope is preserved and native resources are contained by the class the function call is executed from. Reviewed-by: Dan Bode <dan@puppetlabs.com>
| * | Clean up indentation, whitespace, and commented out codeJacob Helwig2011-06-281-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | The mis-indented code, extra newlines, and commented out code were noticed while investigating the order dependent test failure fixed in 4365c8ba. Reviewed-by: Max Martin <max@puppetlabs.com>
* | | (#8814) Update fqdn_rand for ruby 1.9.2 rand bug.Nan Liu2011-08-111-1/+1
| | | | | | | | | | | | | | | | | | Ruby 1.9.2 does not accept a string for rand function, so rand('1') fails even though this works in Ruby 1.8.x and the string is implicitly converted to a number. We added to_i to avoid this bug.
* | | (#8268) Require windows drive letters in absolute file pathsJosh Cooper2011-07-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When testing whether a file path is absolute, the regexp was only handling POSIX style file paths. This commit requires Windows style file paths to start with a drive letter. A future commit will refacter the various places we do path validation to support both Windows drive letters and UNC paths. Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
* | | Scope[] now returns nil for undefined variablesLuke Kanies2011-07-154-12/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that we have the 'include?' method, this feature is unnecessary, and it makes sense to convert to more ruby-like behavior. Any code that previously checked whether lookupvar (or the new []) returned :undefined should now check whether 'scope.include?(var)'. Thus, you can have the same behavior, but it takes a bit different code to get it. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Making the Functions module more resilientLuke Kanies2011-07-151-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were previously storing the module name with the environment instances as the key, which meant if the environment instances were removed, we could never get those modules again. Given that the functions weren't reloaded, this meant the functions were gone if we ever reloaded the environment. This makes the Functions environment module resilient across environment reloads, and it also makes the method work correctly when handed either an environment or a string. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Cleaning up indentation in versoncmp functionLuke Kanies2011-07-151-4/+2
| | | | | | | | | | | | | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Improving an error messageLuke Kanies2011-07-151-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Adding Scope#each methodLuke Kanies2011-07-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The capability was already there via to_hash, and Enumerable was already included, but this method was missing. Given the kind of hacking RI is doing, this seemed appropriate. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Adding Scope#include? methodLuke Kanies2011-07-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This is primarily for Hiera/DataLibrary support, but is a decent idea regardless. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Resource type defaults cleanupLuke Kanies2011-07-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is again done to make support for hiera easier. The way we were handling lookup of resource defaults was over-complicated. This does a decent bit of cleanup overall, but primarily focused on resource type defaults and how they get set during compilation. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Adding default environment to ScopeLuke Kanies2011-07-151-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were previously not defaulting to an environment, which is silly given that there's always a default. It just made setup code harder. We now default to the default environment. This makes further testing involving scopes much easier. Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | Adding []/[]= support to ScopeLuke Kanies2011-07-157-37/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interface to scope is much clearer this way anyway, but this is needed to integrate Puppet with Hiera[1]. It just provides hash-like behavior to Scope, which Hiera and others can now easily rely on. I also went through all of the code that used Scope#lookupvar and Scope#setvar and changed it if possible, and at the same time cleaned up a lot of tests that were unnecessarily stubbing (and thus making it difficult to tell if I had actually broken anything). 1 - https://github.com/ripienaar/hiera Signed-off-by: Luke Kanies <luke@puppetlabs.com> Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | (#8032) Add containment to create_resourcesJeff McCune2011-06-211-5/+6
| |/ |/| | | | | | | | | | | | | | | | | | | | | Without this change native resource types declared using the create_resources() function are not contained within the class scope of the function call. As a result, resources were "floating off" in the graph, disconnected from the rest of the relationship edges. With this change, the scope is preserved and native resources are contained by the class the function call is executed from. Reviewed-by: Dan Bode <dan@puppetlabs.com>
* | Clean up indentation, whitespace, and commented out codeJacob Helwig2011-06-171-6/+1
| | | | | | | | | | | | | | | | The mis-indented code, extra newlines, and commented out code were noticed while investigating the order dependent test failure fixed in 4365c8ba. Reviewed-by: Max Martin <max@puppetlabs.com>
* | Merge branch '2.7.x'Max Martin2011-06-022-6/+10
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.x: (40 commits) (#7746) Fix bootstrap issues from #7717 fix. (#7683) Use ronn, when available, to render the output. (#7683) Add a 'man' face and subcommand to Puppet. maint: remove obsolete work-around code from help face. (#7699) Don't duplicate inherited action names on faces. (#7177) Deprecate implicit 'puppet apply' for 2.7.0 (#7717) Layout cleanup for subcommand extraction. #7211: Test unknown options don't shadow unknown actions. #7211: nasty logic error with global Face options taking arguments. #7211: more helpful error messages in various cases. maint: Fix order dependent test failure (#5966) Add support for hostname regular expressions in auth.conf (#7708) Delete extended documentation from configuration reference (#7707) Document signals in puppet agent and puppet master help add puppet master polling step for ticket 7117 (#5318) Always notice changes to manifests when compiling. (#5318) Always notice changes to manifests when compiling. (#7557) Remove Faces Application maint: Fix order dependent spec failure for face indirection (#7690) Don't blow up when listing terminuses available for faces ... Conflicts (resolved manually): acceptance/tests/ticket_7117_broke_env_criteria_authconf.rb
| * Merge branch '2.6.x' into 2.7.xMax Martin2011-06-021-5/+9
| |\ | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.x: (#5318) Always notice changes to manifests when compiling. (#7681) Add an acceptance test for resource refs with array variables Conflicts (manually resolved): lib/puppet/parser/compiler.rb
| | * (#5318) Always notice changes to manifests when compiling.Daniel Pittman2011-05-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we are asked to compile a catalog we need to update the set of known resource types, along with the node declaration, from the pool of manifests on disk. This is, obviously, a per-environment pool of resource types. To reduce the scope of the race where an update to those manifest files on disk can be updated during a compilation, we tried to cache the set of known resources in the current thread at the start of compilation, then flush it after compile finished and used the cache unconditionally if it was set. Theoretically, this would assure us that we would parse the set of manifests once, use them for the entire compile, flush the cache, and then carry on. Practically, this was enforced as described: flush *after* the compile, assume this would mean that it was clear at the start of the next compile. That presumably worked more or less right until a change was made to push extra data into the catalog at the start of the 2.6 series; that made serialization of the catalog depend on the pool of known resource types. When that happened we would reload the cache (and reparse the manifests) during serialization, but after compilation ... and leave that in the thread cache, so the precondition for the compiler was no longer true. It would see the cache as of the end of the previous compile run, not the start of the next compile run. This, in turn, was what made Puppet wait for multiple runs of the agent before showing you a change in your manifests under Passenger, but *not* under Webrick: Passenger would reuse the same thread for the next request, cache in place, while Webrick would create a new thread and (by side-effect) "flush" the cache as the compiler expected. To minimally fix this, with as little change of side-effect as possible, we move the cache flush from after compile runs to before compile runs. This might have minimal memory cost until another compile request runs in the same thread, because we cache the data longer, but most models won't cause that to be too much trouble. Reviewed-By: Matt Robinson <matt@puppetlabs.com>
| * | Merge branch '2.7rc' into 2.7.xNick Lewis2011-05-261-1/+1
| |\ \
| | * | (#7681) Allow array variables as resource referencesNick Lewis2011-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit df088c9ba16dce50c17a79920c1ac186db67b9e9 introduced a regression where $files = ["/tmp/one", "/tmp/two"] file { "/tmp/one": content => "one", } file { "/tmp/two": content => "two", } file { "/tmp/three": content => "three", require => File[$files], } no longer worked. File[$files] was concatenating the elements of $files to create a single title, instead of expanding to multiple File dependencies. Since resource reference titles are implicitly wrapped in an array, if one of the elements of that array is a variable containing an array, the list of titles is a nested array. Prior to the change causing the regression, we would flatten arrays when evaluating them, under certain circumstances. We no longer ever flatten AST arrays when evaluating them, so anywhere that we really do need a flattened array, we have to manually flatten it. ResourceReference expects its list of titles to be a single, flat list of titles, so we have to make it so. Paired-with: Jacob Helwig <jacob@puppetlabs.com>
* | | | Merge branch '2.7.next' into nextPieter van de Bruggen2011-05-183-1261/+952
|\| | |
| * | | (#7523) Refactor the grammar to reduce duplicationNick Lewis2011-05-173-1261/+952
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit unifies some paths in the grammar, which had previously been duplicated to avoid shift/reduce conflicts. Merging these paths together and separating only the conflicting structures leads to a cleaner grammar, with fewer holes. Several bugs are fixed as a result: (#3129) Nested class names beginning with numbers work correctly (#5268) Hyphens in class names work correctly (#5817) Hashes and arrays can now be passed to functions (hashes require parentheses) Additionally, expressions are now legal in most places where they would make sense, when previously only bare rvalues were allowed. Paired-With: Markus Roberts Reviewed-By: Matt Robinson
| * | | Merge branch '2.7.x' into 2.7.nextDaniel Pittman2011-05-061-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: * spec/unit/node/facts_spec.rb Updates: * spec/unit/interface/action{,_builder}_spec.rb => update for 'when_invoked' block being required.
| | * | (#7101) Fix template error messages in Ruby 1.8.5Max Martin2011-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lib/puppet/parser/templatewrapper.rb#script_line was calling .first on a String object, which in Ruby > 1.8.5 will return the entire string, but in 1.8.5 will cause an exception. This change (proposed by Markus Roberts) removes the call to .first and adds a condition for when the template error involves the file not being found. Reviewed-by: Jesse Wolfe
| * | | Merge branch '2.6.next' into 2.7.nextJosh Cooper2011-04-211-0/+2
| |\ \ \ | | | |/ | | |/| | | | | | | | | | | | | | | | | Manually resolved conflicts: lib/puppet/parser/resource.rb lib/puppet/parser/scope.rb spec/unit/parser/scope_spec.rb
| | * | Maint: Fix a #4655 introduced log inconsistencyJesse Wolfe2011-04-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we moved code from the compiler to parser/resource, we lost a conditional that prevented defined resources from gaining containment edges to stages. Adding a stage to a defined resource was usually harmless, but it violated the invariant of "resources should only have exactly one container as their direct parent", producing a 50% chance of a malformed containment path in log messages. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
| | * | (#4655) Allow stage to be set using a default class parameterJacob Helwig2011-04-193-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example: stage{ pre: before => Stage[main] } class someclass ($stage=pre ) { ... } class { someclass: } This transplants adding the edge from the resource to the stage from the compiler into when the resource is evaluated. This moves adding the stage edges to after when the defaults are copied into the resources, making them available. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
| | * | (#5477) Allow watch_file to watch non-existent files, especially site.ppJesse Wolfe2011-03-252-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The watch_file mechanism would refuse to monitor paths to files that didn't exist. This patch makes it possible to watch a file that hasn't been created yet, so when it is created, you manifests will get reparsed. Backported this change to 2.6.x Paired-With: Jacob Helwig <jacob@puppetlabs.com>
| | * | (4576) - if ENC declares invalid class, it is logged at warning.Dan Bode2011-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | used to be at info, so you had to run the master on verbose to see it an ENC was trying to declare a class that could not be loaded.
* | | | Fixed #7481 - Added MIT license to Thomas Bellman's function codeJames Turnbull2011-05-123-0/+78
| | | |
* | | | (#7101) Fix template error messages in Ruby 1.8.5Max Martin2011-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lib/puppet/parser/templatewrapper.rb#script_line was calling .first on a String object, which in Ruby > 1.8.5 will return the entire string, but in 1.8.5 will cause an exception. This change (proposed by Markus Roberts) removes the call to .first and adds a condition for when the template error involves the file not being found. Reviewed-by: Jesse Wolfe
* | | | Maint: Fix a #4655 introduced log inconsistencyJesse Wolfe2011-04-201-0/+2
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we moved code from the compiler to parser/resource, we lost a conditional that prevented defined resources from gaining containment edges to stages. Adding a stage to a defined resource was usually harmless, but it violated the invariant of "resources should only have exactly one container as their direct parent", producing a 50% chance of a malformed containment path in log messages. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* | | Merge branch 'tickets/2.7.x/4655-parameterized-classes-default-stages' into nextJacob Helwig2011-04-193-14/+26
|\ \ \ | |_|/ |/| | | | | | | | * tickets/2.7.x/4655-parameterized-classes-default-stages: (#4655) Allow stage to be set using a default class parameter
| * | (#4655) Allow stage to be set using a default class parameterJacob Helwig2011-04-193-14/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example: stage{ pre: before => Stage[main] } class someclass ($stage=pre ) { ... } class { someclass: } This transplants adding the edge from the resource to the stage from the compiler into when the resource is evaluated. This moves adding the stage edges to after when the defaults are copied into the resources, making them available. Paired-with: Jesse Wolfe <jesse@puppetlabs.com>
* | | Cleanup trailing whitespaceJacob Helwig2011-04-141-2/+2
| | |
* | | (#7111) Clarify scoping deprecation warningJacob Helwig2011-04-141-1/+1
|/ / | | | | | | | | | | | | | | This modifies the deprecation warning to explicitly point out that the specified behavior is deprecated, when it is slated to be removed, along with what the user can do to prepare for its removal. Paired-with: Randall Hansen <randall@puppetlabs.com>
* | Merge branch 'ticket/next/6928' into nextNick Lewis2011-04-131-0/+2
|\ \
| * | Revert "(#6928) Removed --ignoreimport"Nick Lewis2011-04-131-0/+2
| | | | | | | | | | | | | | | | | | | | | This reverts commit 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07. Despite not needing --ignoreimport as an option anymore, it's still used internally and has to stay.
* | | Merge branch 'ticket/next/6928' into nextNick Lewis2011-04-133-8/+6
|\| |
| * | (#6928) Removed --ignoreimportNick Lewis2011-04-131-2/+0
| | | | | | | | | | | | | | | | | | This was only used with --parseonly, which is gone. Paired-With: Jesse Wolfe
| * | (#6928) Remove --parseonlyNick Lewis2011-04-132-6/+6
| | | | | | | | | | | | | | | | | | This has been removed in favor of 'puppet parser validate <manifest>'. Paired-With: Jesse Wolfe