summaryrefslogtreecommitdiffstats
path: root/lib/puppet
Commit message (Collapse)AuthorAgeFilesLines
...
| | * | | Merge branch 'bug/2.7.x/7221-whitespace-stripping-for-documentation' into 2.7.xDaniel Pittman2011-04-291-41/+63
| | |\ \ \
| | | * | | (#7221) Strip bad whitespace from face and action docs.Daniel Pittman2011-04-291-41/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now strip whitespace in face (and related) documentation in two places: We strip any trailing whitespace on each line, just because. We strip any leading indent, but not all leading whitespace, from the text. That is, we strip the *minimum* amount of whitespace that we can take from every line in the documentation without changing the overall content. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | Merge branch 'tickets/2.7.x/7289' into 2.7.xPieter van de Bruggen2011-04-293-14/+31
| | |\ \ \ \ | | | |/ / / | | |/| | |
| | | * | | (#7289) Specify order for option decorations.Pieter van de Bruggen2011-04-293-14/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `before_action` decorations should always resolve in resolution order from most general (inherited from furthest away) to most specific (declared on the instance), and should always execute Face-level option decorations before action-level option decorations. `after_action` decorations should execute in the opposite order. Reviewed-By: Daniel Pittman
| | * | | | (#7248) Fail if two aliases of one option are passed...Daniel Pittman2011-04-291-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the command line, and other facades, it is fairly difficult to call an action with two aliases of the same option in the invocation, but from the Ruby API it would be relatively easy to achieve. This is now checked, and raises an error, so that we don't accidentally have strange or unusual behaviour coming out of the whole system. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
| | * | | | Revert "maint: better error reporting for argument count mismatch."Daniel Pittman2011-04-281-39/+47
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cd474b0aff0e0fec33295c8abc0668af90fb7cc1.
| | * | | | maint: better error reporting for argument count mismatch.Daniel Pittman2011-04-281-47/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Another face quirk in error reporting highlights a better way to work the error message; do so.
| | * | | | (#7122) Enforce call arity on actions in the CLI wrapper.Daniel Pittman2011-04-283-10/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had a problem, previously, in the generic translation of command line arguments to Ruby method calls: we could mistake the options, added by the CLI wrapper, for a positional argument to the action method. This was caused by a combination of factors, but primarily that the wrapper methods for actions are designed to present a friendly, helpful Ruby API for internal use. Consequently, they have a default value if you don't wish to pass options. Unfortunately, this meant that the options that the CLI *always* passed could be treated as a positional argument instead, and the default set of options added to the back of the call. To resolve this we now check the number of positional arguments in the CLI wrapper, and raise an exception if they are mismatched. This makes the generic CLI handling do the right thing in adapting the command line arguments to the Ruby API. (As an aside, we would have had a similar-but-different failure mode if we type-checked positional arguments: these calls would have failed with an invalid argument validation error.) Reviewed-By: Max Martin <max@puppetlabs.com>
| | * | | | (#7269) Fix error reporting for bad render formats...Daniel Pittman2011-04-281-24/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous change was incomplete, and could result in internal errors with the wrong combination of inputs. Now we have more testing, and a logically consistent model, so all works. Reviewed-By: Max Martin <max@puppetlabs.com>
| | * | | | (#7269) Better error reporting for bad render formats.Daniel Pittman2011-04-281-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we would try and send `nil` to a class to render an unsupported format, which was bad. Worse, we would only discover this *after* the fact, when we tried to render, so the entire action had run and the result was lost to the world. Instead, validate the parameter early and fail during option parsing. This has less nice error reporting than we can get handling it later[1], but it gets us a much better overall set of behaviour. [1] puppet/application.rb will print and exit, rather than raising, when the option handler fails; this will improve when we unify face and application options properly. Reviewed-By: Max Martin <max@puppetlabs.com>
| | * | | | (#7160) Support 'json' as a rendering method for CLI faces.Daniel Pittman2011-04-281-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already had some specialized support for rendering JSON using the PSON libraries; this just extends that to recognize the request on the command line for json to be identical to a request for pson. Theoretically we should also support the format in our network rendering code, but that is a much bigger change, in established code, that has more chance of destabilizing the whole release. Reviewed-By: Max Martin <max@puppetlabs.com>
| | * | | | Merge branch 'feature/2.7.x/6962-finish-documentation-api-for-faces' into 2.7.xDaniel Pittman2011-04-2725-54/+420
| | |\ \ \ \ | | | |/ / / | | |/| | |
| | | * | | (#6962) Add integration tests on Face documentation.Daniel Pittman2011-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now run all the faces, and their actions, as well as global help through the wringer in this test: this way we can be confident that we have, at least, the ability to generate the help without a user-visible failure. We also check that we have set copyright and license terms in our own faces. Theoretically this might fail if the end user has extra faces on LOAD_PATH, but my hope is that we won't hit that...
| | | * | | (#6962) Finish documentation API on Face options.Daniel Pittman2011-04-278-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This extends the last of the documentation support, down into options, so they can be described as expected. In the process we split out the modular docs API into a full and short version options only want short docs, but the behaviours are identical to the full version.
| | | * | | (#6962) Give copyright and license for all faces.Daniel Pittman2011-04-2617-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we have the capability, mark all our faces copyright the company and under the Apache 2 license, which indeed they are.
| | | * | | (#6962) Fill out documentation on Faces and ActionsDaniel Pittman2011-04-265-11/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the documentation we had written, wiring it into the existing faces and actions. This helps fill out the need to document these things before they ship.
| | | * | | (#6962) Move documentation support into a module.Daniel Pittman2011-04-264-179/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given that we have identical documentation behaviour in the face and action code, it should properly be written once. So, move it into a module, extend the other classes with it, and have done.
| | | * | | (#6962) Extend documentation API for Faces.Daniel Pittman2011-04-263-7/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the remaining documentation mechanisms to the Face instances, allowing them to build and report correct documentation, licensing and ownership for the help face to build on.
| | * | | | (#7251) Let exceptions raised in decorators rise.Pieter van de Bruggen2011-04-262-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows users to write before_action advice that does basic option validation very easily. Reviewed-By: Daniel Pittman
| | * | | | (#7249) Publicize ActionBuilder DSL methods.Pieter van de Bruggen2011-04-261-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change permits users to call functions with a reference to `self` that can augment the in-progress action declaration, which can be helpful in some more involved cases. Reviewed-By: Max Martin Reviewed-By: Daniel Pittman
| | * | | | (#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
| | * | | (#7137) Get rid of spurious info messages in useraddMax Martin2011-04-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage of the useradd provider was leading to spurious log messages of this form: info: /User[nigel]: Provider useradd does not support features manages_aix_lam; not managing attribute ia_load_module This was due to the ia_load_module parameter requiring manages_aix_lam and additionally having a defaultto value of "compat." Paired-with: Matt Robinson <matt@puppetlabs.com>
| | * | | (#7157) Return a non-zero exit code on face failure.Daniel Pittman2011-04-221-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a face or action fails we should exit non-zero on the CLI to signal this to our caller. "Fails" is defined as "raises an exception"; we don't treat any return value as a significant failure. Reviewed-By: Jesse Wolf <jesse@puppetlabs.com>
| | * | | maint: clean up test headers on face spec files.Daniel Pittman2011-04-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A whole pile of spec files for faces were not pulling in the regular spec_helper, or the puppet/face library before they used it. This worked fine by coincidence when they ran together, but blew up if run separately. Reviewed-By: Jesse Wolf <jesse@puppetlabs.com>
| | * | | Merge branch 'ticket/2.7.x/7080-reverts' into 2.7.xMax Martin2011-04-213-84/+10
| | |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ticket/2.7.x/7080-reverts: Revert "Fixing Facts pson methods more resilient" Revert "(7080) Adding json support to Indirector Request" Revert "Adding json support to Puppet::Node"
| | | * | | Revert "Fixing Facts pson methods more resilient"Max Martin2011-04-211-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 07a7a68a25eb9b21189751c27f90f972224ea533. The JSON patch series has caused problems with the inventory service, and further discussion is needed to decide how to serialize objects to PSON with regards to future compatibility. Conflicts: spec/unit/node/facts_spec.rb Paired-with:Matt Robinson <matt@puppetlabs.com>
| | | * | | Revert "(7080) Adding json support to Indirector Request"Max Martin2011-04-211-49/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e0615cbc1eea67ef8caf4edbc8b7b3d3ce618f4d. The JSON patch series has caused problems with the inventory service, and further discussion is needed to decide how to serialize objects to PSON with regards to future compatibility. Conflicts: spec/unit/indirector/request_spec.rb Paired-with:Matt Robinson <matt@puppetlabs.com>
| | | * | | Revert "Adding json support to Puppet::Node"Max Martin2011-04-211-23/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d3c94e62386ec03617015f6e6269b1de805954ea. The JSON patch series has caused problems with the inventory service, and further discussion is needed to decide how to serialize objects to PSON with regards to future compatibility. Conflicts (Manually resolved): spec/unit/node_spec.rb Paired-with: Matt Robinson <matt@puppetlabs.com>
| | * | | | Merge branch 'ticket/2.7.x/7084' into 2.7.xJesse Wolfe2011-04-213-10/+29
| | |\ \ \ \
| | | * | | | Fix #7084 Make the log messages produced by whits less confusingJesse Wolfe2011-04-213-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the logging behavior of Whits so that instead of talking about whits directly, we refer to the Class, Stage, or recursive resource that they are sentinals for. In the case where a "completion" Whit is notified by a resource, getting a notification at all is counterinutitive, so I've changed the output to a "debug"-priority message that describes what's happening. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
| | * | | | | (#7121) Download plugins and upload reports in secret agent!Daniel Pittman2011-04-212-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a plugin face, able to download plugins, and wires both that and the report face in to upload the result of the catalog run. This fills out the standard, boring agent behaviour and makes this a semi-credible replacement. Reviewed-By: Max Martin <max@puppetlabs.com>
| | * | | | | Merge remote-tracking branch ↵Daniel Pittman2011-04-2115-15/+51
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'remotes/lak/tickets/next/7118-summaries_for_all_faces' into 2.7.x Fix conflicts due to version drift in: lib/puppet/face/certificate.rb lib/puppet/face/facts.rb lib/puppet/face/node.rb lib/puppet/face/secret_agent.rb spec/lib/puppet/face/basetest.rb spec/unit/face/help_spec.rb Reviewed-By: Markus Roberts <markus@puppetlabs.com>
| | | * | | | | (7118) Adding summaries for all facesLuke Kanies2011-04-1415-15/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's usually just a one-liner, but when I saw an obvious opportunity for longer docs, I've added a @longdocs variable that can be converted to longer forms when ready. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| | * | | | | | (#7181) Rename configurer face to secret_agent.Daniel Pittman2011-04-212-3/+3
| | | |_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a much more useful public name, especially given the code is aimed to eventually replace the agent entirely. Until then this is pleasant enough to talk about. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | | | | | | Fixed #7481 - Added MIT license to Thomas Bellman's function codeJames Turnbull2011-05-123-0/+78
| | | | | | |
* | | | | | | (#7264) Docs: Clarify that subscribe/notify imply require/beforenfagerlund2011-05-111-40/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a doc string only commit. The metaparameter reference was not clear about subscribe and notify being supersets of require and before, respectively. This commit also cleans up some unrelated quoting, arrow-alignment, and language flow issues.
* | | | | | | Merge branch '2.7.next' into nextMax Martin2011-04-276-11/+50
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.next: (#3420) Nagios "name" attribute does not output correctly (#4487) When setting environment on a host, ensure it is a string. add test for ticket 7101 (#7220) Add the ability to "inherit" options. (#6487) Add some testing for OS X version support in DirectoryService provider (#6487) Directoryservice provider will fail in future OS releases (#6368) Make the File type autorequire its nearest ancestor directory
| * | | | | | Merge branch '2.6.next' into 2.7.nextMax Martin2011-04-273-9/+27
| |\ \ \ \ \ \ | | | |_|_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.6.next: (#3420) Nagios "name" attribute does not output correctly (#4487) When setting environment on a host, ensure it is a string. add test for ticket 7101 (#6487) Add some testing for OS X version support in DirectoryService provider (#6487) Directoryservice provider will fail in future OS releases
| | * | | | | Merge branch 'tickets/2.6.next/3420' into 2.6.nextJosh Cooper2011-04-261-1/+9
| | |\ \ \ \ \
| | | * | | | | (#3420) Nagios "name" attribute does not output correctlyJim Pirzyk2011-04-261-1/+9
| | | | | | | |
| | * | | | | | Merge branch 'tickets/2.6.next/4487' into 2.6.nextJosh Cooper2011-04-261-0/+7
| | |\ \ \ \ \ \
| | | * | | | | | (#4487) When setting environment on a host, ensure it is a string.Josh Cooper2011-04-261-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change when environment strings were read out of the storeconfigs database, they were eventually converted up to Puppet::Node::Environment objects. When these objects are returned to the storeconfigs database, ActiveRecord dumps them as YAML, which begins the death-spiral of YAML. This change makes it so the host will always store the environment as a string, preventing the Puppet::Node::Environment object from being YAMLized, and stored as such in the database. This change was based on one by Richard Crowley. Paired-with: Jacob Helwig <jacob@puppetlabs.com> Reviewed-by: Jesse Wolfe <jesse@puppetlabs.com> Signed-off-by: Richard Crowley <r@rcrowley.org>
| | * | | | | | | (#6487) Directoryservice provider will fail in future OS releasesGary Larizza2011-04-221-8/+11
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit removes a case statement in the get_exec_pramble and single_report methods. In its place is an if statement that will cause Puppet to fail if its being run on an OS X system with a version < 10.4. This if-statement will also allow Puppet to run in 10.7. Signed-off-by: Gary Larizza <ccshots@gmail.com>
| * | | | | | | (#7220) Add the ability to "inherit" options.Pieter van de Bruggen2011-04-252-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Reviewed-By: Matt Robinson
| * | | | | | | Merge branch ↵Jacob Helwig2011-04-221-2/+8
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'tickets/2.7.next/6368-files-autorequire-nearest-ancestor-directory' into 2.7.next * tickets/2.7.next/6368-files-autorequire-nearest-ancestor-directory: (#6368) Make the File type autorequire its nearest ancestor directory
| | * | | | | | | (#6368) Make the File type autorequire its nearest ancestor directoryIan Ward Comfort2011-04-221-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The File type will now autorequire the nearest ancestor directory found in the catalog, not just the file's parent directory. This is useful for setting up transitive relationships in cases when a package or other resource creates a large directory hierarchy, e.g. package { 'foo': ensure => present } file { '/var/lib/foo': require => Package['foo'] } This will make File resources at arbitrarily deep levels under /var/lib/foo automatically (transitively) require the foo package. Only the nearest ancestor is autorequired, to prevent explosion of the relationship graph.
* | | | | | | | | (#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
* | | | | | | | Merge branch '2.7.x' into 2.7.nextMax Martin2011-04-218-92/+118
|\ \ \ \ \ \ \ \ | | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.7.x: (#6928) Don't blow up when the method is undefined... (#6928) backport Symbol#to_proc for Ruby < 1.8.7 (#7183) Implement "invisible glob" version matching for faces maint: better disabling of Signal#trap in our tests. maint: more robust listing of valid faces. maint: clean up testing code a fraction... maint: better error report for a missing version of a face. maint: handle face clear/reset sanely in the interface spec. maint: stop stubbing log level setting. Move tests from Puppet-acceptance repo (#7116) Handle application-level options in parse_options maint: fix gratuitous whitespace in the code. maint: remove redundant context from the test. (#7062) better argument handling in the action wrapper methods maint: move method comments outside the comment. Fixed #7166 - Replaced deprecated stomp "send" method with "publish" maint: Remove unused faces code
| * | | | | | | (#6928) Don't blow up when the method is undefined...Daniel Pittman2011-04-211-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the same model for testing instance methods as the rest of the code. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | | | | | | (#6928) backport Symbol#to_proc for Ruby < 1.8.7Daniel Pittman2011-04-211-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use the &:foo symbol-to-proc syntax in some of our code, so to avoid problems on Ruby earlier than 1.8.7 we should backport the support in our monkey-patch file. Reviewed-By: Max Martin <max@puppetlabs.com>