summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | #7211: more helpful error messages in various cases.Daniel Pittman2011-05-311-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were emitting a bunch of unhelpful failure messages, surrounding invalid actions and especially default actions interacting with the command-line. This cleans those up, to give a helpful, informative, and correct message in all cases. Notably, we no longer report that there is no "default" action when you specify an unknown action on a face. This change revealed some other weaknesses in our unit tests, now correctly, that result in slightly more robust code.
| | * | | (#7708) Delete extended documentation from configuration referencenfagerlund2011-05-271-101/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The auto-generated references are meant to be pithy, dense, and fast -- to be references, not guides. The configuration reference was front-loaded with several pages of explanatory text that properly belongs in the guides on the docs site. This commit removes that text in preparation for a reorganization of the docs. This is a doc string only commit.
| | * | | (#7707) Document signals in puppet agent and puppet master helpnfagerlund2011-05-272-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the signals accepted by the agent and master daemons were only documented in the configuration reference, which didn't make any particular sense. This commit moves their documentation to a blurb in the relevant man pages. This is a doc string only commit.
| | * | | (#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>
| | * | | (#7557) Remove Faces ApplicationMatt Robinson2011-05-261-122/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It used to be that to list the faces available and their actions and options, you had this legacy based face application. This functionality has all been moved into the puppet help face application. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| | * | | Merge branch 'ticket/2.7rc/maint-faces_docs_spec_fixes' into ↵Matt Robinson2011-05-264-27/+24
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ticket/2.7rc/maint-doc_changes_without_failures * ticket/2.7rc/maint-faces_docs_spec_fixes: maint: Fix order dependent spec failure for face indirection (#7690) Don't blow up when listing terminuses available for faces maint: Dedup the loadpath so we don't have to walk it multiple times Maint: Fix ellipses for short descriptions Resolved Conflicts: lib/puppet/interface/documentation.rb
| | | * | | (#7690) Don't blow up when listing terminuses available for facesMatt Robinson2011-05-263-24/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, in order to list the available terminuses for an indirected face we loaded all the the terminuses in order to list them. This meant that if a terminus like active_record didn't have the dependencies it needed, the documentation would raise errors and not list terminuses. <Puppet::Error: Could not autoload filename uninitialized constant Object::ActiveRecord> Now we just list the terminuses available in the load path without trying to load them. The terminus will still raise an error if you try to use it without its dependencies being met. Paired-with: Max Martin <max@puppetlabs.com>
| | | * | | maint: Dedup the loadpath so we don't have to walk it multiple timesMatt Robinson2011-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user's path has duplicate entries, we end up looking at them multiple times. This has bitten people in the past in that if you get a lot of duplication it can make autloading a lot slower. Really the user shouldn't be duplicating their path, but since we can't control that, this is a safe fix to prevent them from having autoload slowness. Paired-with: Max Martin <max@puppetlabs.com>
| | | * | | Maint: Fix ellipses for short descriptionsnfagerlund2011-05-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we were adding ellipsis to any short_description, which was misleading; they were only necessary when we were truncating in the _middle_ of a paragraph. This commit changes the behavior, and updates the tests to show when we expect ellipsis. Paired-with: Matt Robinson <matt@puppetlabs.com>
| | * | | | (#7563) DRY: Remove indirector boilerplate from individual facesnfagerlund2011-05-2612-113/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Termini lists are now being generated in the help templates. This commit removes the hardcoded lists from each of the affected faces.
| | * | | | (#7564) Finish templatesnfagerlund2011-05-265-60/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rebase of the following commits: * (#7563) Add a template for manpages In order to generate manpages in a reasonably maintainable way, we need to format text from the Faces help API for use with Ronn (https://github.com/rtomayko/ronn/). This commit adds a man template to the help templates folder; it has been verified to generate Ronn-friendly input text. It isn't currently called by any applications, but can be demonstrated by exchanging it for face.erb. * (#7634) Change ERB trim mode used in the Faces help API <%= something -%> tags (note the minus) are unavoidably necessary at at least one point in the Faces help templates. ERB objects instantiated with the % trim mode will blow up horribly whenever one of these tags appears. This commit changes the trim mode to `-` and refactors all help templates accordingly. * (#7563) Refactor short help templates This commit attempts to bring the short face and action help templates closer to the goals of fitting cleanly on one screen, fitting the prevailing *nix aesthetic, and being useful without overwhelming the user.
| | * | | | (#7561) Complete help text for all faces and actionsnfagerlund2011-05-2622-257/+628
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Faces help output relies on input from the documentation methods in each of the faces to be documented. This commit calls those methods in each of our faces, with varying levels of detail depending on their complexity.
| | * | | | Maint: Add ellipsis to generated short_descriptions.nfagerlund2011-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto-generated short descriptions cut off at five lines with no indication that they are truncated. This commit adds ellipsis in brackets to indicate incompleteness.
| | * | | | (#6962) Add "arguments" method to help APInfagerlund2011-05-261-0/+2
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since some actions take arguments and some do not, action synopses were incomplete and ambiguous. This commit adds a method for explicitly declaring what argument(s) an action takes, and places the arguments at the appropriate spot in the action's synopsis. By convention, individual arguments should be wrapped in angle brackets.
| * | | | 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>
| * | | | (#5966) Add support for hostname regular expressions in auth.confSiim Põder2011-05-311-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When hosting multiple applications (especially with different security levels), you may not want to allow every client to read all the files required for every other client. Currently it is possible to do this when your host and domain names reasonably reflect that grouping, ex: hostXYZ.someapp.domain.com. However, if you have a more flat naming convention, it is difficult to write these ACLs. This patch adds support for matching hostnames with regular expressions, thus extending the ACLs to allow: path /file_content/secrets/appserver allow /appserver[0-9]+.example.com$/ path /file_content/secrets/otherservice allow /^(test-)crazy[0-9]+.pattern.(com|net)$/ Signed-off-by: Josh Cooper <josh@puppetlabs.com> Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
| * | | | Merge branch 'ticket/2.7.x/maint-faces_docs_spec_fixes' into 2.7.xMatt Robinson2011-05-263-25/+20
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.7.x/maint-faces_docs_spec_fixes: maint: Fix order dependent spec failure for face indirection (#7690) Don't blow up when listing terminuses available for faces maint: Dedup the loadpath so we don't have to walk it multiple times
| | * | | | (#7690) Don't blow up when listing terminuses available for facesMatt Robinson2011-05-263-24/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, in order to list the available terminuses for an indirected face we loaded all the the terminuses in order to list them. This meant that if a terminus like active_record didn't have the dependencies it needed, the documentation would raise errors and not list terminuses. <Puppet::Error: Could not autoload filename uninitialized constant Object::ActiveRecord> Now we just list the terminuses available in the load path without trying to load them. The terminus will still raise an error if you try to use it without its dependencies being met. Paired-with: Max Martin <max@puppetlabs.com>
| | * | | | maint: Dedup the loadpath so we don't have to walk it multiple timesMatt Robinson2011-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user's path has duplicate entries, we end up looking at them multiple times. This has bitten people in the past in that if you get a lot of duplication it can make autloading a lot slower. Really the user shouldn't be duplicating their path, but since we can't control that, this is a safe fix to prevent them from having autoload slowness. Paired-with: Max Martin <max@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>
| * | | | Maint: Fix ellipses for short descriptionsnfagerlund2011-05-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we were adding ellipsis to any short_description, which was misleading; they were only necessary when we were truncating in the _middle_ of a paragraph. This commit changes the behavior, and updates the tests to show when we expect ellipsis. Paired-with: Matt Robinson <matt@puppetlabs.com>
| * | | | (#7563) DRY: Remove indirector boilerplate from individual facesnfagerlund2011-05-2612-113/+0
| | | | | | | | | | | | | | | | | | | | | | | | | Termini lists are now being generated in the help templates. This commit removes the hardcoded lists from each of the affected faces.
| * | | | (#7564) Finish templatesnfagerlund2011-05-265-60/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a rebase of the following commits: * (#7563) Add a template for manpages In order to generate manpages in a reasonably maintainable way, we need to format text from the Faces help API for use with Ronn (https://github.com/rtomayko/ronn/). This commit adds a man template to the help templates folder; it has been verified to generate Ronn-friendly input text. It isn't currently called by any applications, but can be demonstrated by exchanging it for face.erb. * (#7634) Change ERB trim mode used in the Faces help API <%= something -%> tags (note the minus) are unavoidably necessary at at least one point in the Faces help templates. ERB objects instantiated with the % trim mode will blow up horribly whenever one of these tags appears. This commit changes the trim mode to `-` and refactors all help templates accordingly. * (#7563) Refactor short help templates This commit attempts to bring the short face and action help templates closer to the goals of fitting cleanly on one screen, fitting the prevailing *nix aesthetic, and being useful without overwhelming the user.
| * | | | (#7561) Complete help text for all faces and actionsnfagerlund2011-05-2622-257/+628
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Faces help output relies on input from the documentation methods in each of the faces to be documented. This commit calls those methods in each of our faces, with varying levels of detail depending on their complexity.
| * | | | Maint: Add ellipsis to generated short_descriptions.nfagerlund2011-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Auto-generated short descriptions cut off at five lines with no indication that they are truncated. This commit adds ellipsis in brackets to indicate incompleteness.
| * | | | (#6962) Add "arguments" method to help APInfagerlund2011-05-261-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since some actions take arguments and some do not, action synopses were incomplete and ambiguous. This commit adds a method for explicitly declaring what argument(s) an action takes, and places the arguments at the appropriate spot in the action's synopsis. By convention, individual arguments should be wrapped in angle brackets.
| * | | | Added the vcsrepo type and providers to the coreJames Turnbull2011-05-237-0/+763
| | | | |
* | | | | maint: Fix pacman provider to work with Ruby 1.9Matt Robinson2011-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.9 doesn't allow the lambda to walk up the directory structure to require the spec helper This is the same issue as with commit: f6da3339f59bbd9243a03dc1e417b1fed7955c7e Also, you can't call each on a string in Ruby 1.9 directly since it doesn't implicitly do a split on \n like it did in older Rubies, but each_line works all the way back to 1.8.5 Reviewed-by: Nick Lewis <nick@puppetlabs.com>
* | | | | Merge branch '2.7.x'Matt Robinson2011-05-232-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.x: (#7502) Fixed parser spec for ruby 1.8.5 (#7507) Add more 1.9 filters (#6395) Add extpuppet help, eval, and interfaces maint: move trap call to Signal so we can stub it for specs Updated CHANGELOG for 2.7.0rc3 (#7259) Remove ActiveRecord requirement from indirector face spec (#7259) Do not try to load all Terminus classes when configuring the Indirector Adding a sleep state post starting master
| * | | | (#7507) Add more 1.9 filtersJosh Cooper2011-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Additionally we fixed a scoping issue with the File type. Paired-With: Matt Robinson <matt@puppetlabs.com>
| * | | | Merge branch '2.7.next' into 2.7.xMatt Robinson2011-05-1919-1304/+1057
| |\ \ \ \ | | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.next: (42 commits) (#6395) Add extpuppet help, eval, and interfaces Adding a sleep state post starting master maint: fix spec_helper inclusions again. (#7523) Refactor the grammar to reduce duplication (#7114) Fix specs for ssh authorized key parsed provider (#7114) Target returns correct value (#7114) Add integration tests for authorized_key (#7114) Improve unit tests for ssh_authorized_key (#7114) Improve value validation for authorized_key (#7300) Fix instances method of mount provider (#7259) Remove ActiveRecord requirement from indirector face spec (#7259) Do not try to load all Terminus classes when configuring the Indirector (#3836) External nodes should only capture stdout Revert "(#7220) Add the ability to "inherit" options." maint: sync 'authconfig' to 'rest_authconfig' setting adding test for ticket 7139 (#7139) Accept '/' as a valid path in filesets (#7300) Add specs for the mount provider case seems needless here as there is only two opts, also the rest of the file seems to use if so this should make things more consistant (#6845) Mount writes incorrect vfstab entries ...
| * | | | maint: move trap call to Signal so we can stub it for specsMatt Robinson2011-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also removed some monkey patching on Signal that would have theoretically done this without having to explicitly call trap on Signal in order to stub it, but it's not working. This allows us to ctrl+c (send SIGINT) in the middle of a spec run. Paired-with: Josh Cooper <josh@puppetlabs.com>
| * | | | (#7259) Do not try to load all Terminus classes when configuring the IndirectorJacob Helwig2011-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When configuring the Indirector routes, we should only try loading the Terminus classes that are referenced by the configuration. Previously, we were loading all Terminus classes, which would cause errors if we didn't have all of the prerequisites for all of them, even if the ones with missing prerequisites weren't being used by the configuration. Paired-with: Nick Lewis <nick@puppetlabs.com>
* | | | | Added the vcsrepo type and providers to the coreJames Turnbull2011-05-237-0/+763
| | | | |
* | | | | Merge branch '2.7.next' into nextPieter van de Bruggen2011-05-184-1264/+955
|\ \ \ \ \ | | |/ / / | |/| | |
| * | | | Merge branch '2.6.x' into 2.7.nextPieter van de Bruggen2011-05-181-3/+3
| |\ \ \ \ | | | |/ / | | |/| |
| | * | | (#3836) External nodes should only capture stdoutOliver Hookins2011-05-131-3/+3
| | | | | | | | | | | | | | | | | | | | This patch prevents stdout and stderr from being combined by Puppet::Util.execute, when used by Puppet::Indirector::Exec for external nodes.
| * | | | Merge branch 'ticket/2.7.next/7523' into 2.7.nextNick Lewis2011-05-173-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.next' into nextPieter van de Bruggen2011-05-1714-18/+43
|\| | | | |
| * | | | | Merge branch '2.7.x' into 2.7.nextPieter van de Bruggen2011-05-1710-11/+12
| |\ \ \ \ \ | | |/ / / / | |/| | / / | | | |/ / | | |/| |
| | * | | Merge branch 'ticket/2.7.x/7507-filter_19_failures' into 2.7.xMatt Robinson2011-05-171-1/+1
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.7.x/7507-filter_19_failures: (#7507) Add ability to filter Ruby 1.9 spec failures (#7507) Fix when_invoked action specs in Ruby 1.9
| | | * | | (#7507) Fix when_invoked action specs in Ruby 1.9Matt Robinson2011-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ruby 1.9 is strict about argument arity for methods that are metaprogrammatically defined. A ton of specs that were setting up when_invoked didn't pass options even though they should have been. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
| | * | | | (#7297) Fix Puppet::Resource#to_manifest in Ruby 1.9Nick Lewis2011-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method was relying on the implicit join in Ruby 1.8's Array#to_s, eg. [1,2,3].to_s => "123". The behavior in Ruby 1.9 is more akin to Array#inspect, eg. [1,2,3].to_s => "[1, 2, 3]". Since the array we were building was lines to be printed, the latter behavior is incorrect. So we just join into a single string, which prints consistently in all versions of Ruby. Paired-With: Josh Cooper Original patch by Aria Stewart <aredridel@nbtsc.org>
| | * | | | (#7298) require 'English' to provide $CHILD_STATUS in Ruby 1.9Nick Lewis2011-05-161-0/+1
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This had been coming from 'cgi', but in Ruby 1.9, cgi no longer requires English. Since we use $CHILD_STATUS when execing, we need to have it available, so require it manually. This also provides the other named special globals, should we choose to use them. Paired-With: Josh Cooper
| | * | | (#7291) Fix issues with instance_methods in Ruby 1.9Matt Robinson2011-05-165-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instance_methods in Ruby 1.8.7 returns an array of strings, but returns an array of symbols in 1.9.2. This manifested itself when running the tests because in 1.9.2 we were trying to call sub on a sybmol. The original proposed solution was to monkey patch symbols to have a sub method, but this didn't deal with the real issue of need to check whether a method was defined, and actually made it worse. Turns out that checking for the presence of a method in an array that may contain symbols and may contain strings is better done by just calling method_defined? instead. This patch addresses all the places ack turned up the code doing this include? check instead of directly calling method_defined?. Thanks to Alex Sharp ajsharp@gmail.com for pointing out the Ruby 1.9 problems and working toward a solution. Reviewed-by: Nick Lewis <nick@puppetlabs.com>
| | * | | (#7291) Fixed ascii problem with Ruby 1.9.2Matt Robinson2011-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with the previous commit, there was a problem loading a face because Ruby 1.9.2 doesn't like using non-standard ascii characters without declaring the encoding at the top of the file. SyntaxError Exception: /Users/matthewrobinson/work/puppet/lib/puppet/face/resource.rb:10: invalid multibyte char (US-ASCII) Rather than declare the encoding to allow the French word, I've translated it (after having to look it up myself). Reviewed-by: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | (#7291) Fix Ruby 1.9 face failuresMatt Robinson2011-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The certificate face wasn't being loaded, but it wasn't clear from the test failure why: lib/puppet/interface.rb:61:in `[]': Could not find Puppet Face :certificate (Puppet::Error) The problem is that when the certificate face is required you get: SyntaxError Exception: /Users/matthewrobinson/work/puppet/lib/puppet/face/certificate.rb:11: invalid multibyte char (US-ASCII) However this error is caught and logged, but then ignored. This behavior was a decision in #7314 and is currently under review. A space character in the description was ASCII 160 instead of the typical ASCII 32 Reviewed-by: Pieter van de Bruggen <pieter@puppetlabs.com>