summaryrefslogtreecommitdiffstats
path: root/lib/puppet/face
Commit message (Collapse)AuthorAgeFilesLines
* (Maint.) Disable cleaning of storeconfigs.Pieter van de Bruggen2011-07-281-1/+4
| | | | | | | This feature (and the corresponding tests) were causing intermittent failures which we were unable to trace. We will reintroduce this behavior when we can do so without test fragility. Reviewed-By: Matt Robinson
* (#1886) Clean up `node clean` for merge.Pieter van de Bruggen2011-07-282-72/+69
| | | | | This includes various style changes, and assorted fixes to testing. Paired-With: Matt Robinson
* Fix #1886 - Add node cleanup capabilityPeter Meier2011-07-271-0/+154
| | | | | | | | | | | | | | | | | | | | | | | | | Here is a changeset that adds a new action to the puppet node face. This application removes all traces of a node on the puppetmaster (including certs, cached facts and nodes, reports, and storedconfig entries). Furthermore it is capable of unexporting exported resources of a host so that consumers of these resources can remove the exported resources and we will safely remove the node from our infrastructure. Usage: puppet node clean [--unexport] <host> [<host2> ...] To achieve this we add different destroy methods to the different parts of the indirector. So for example for yaml indirections we already offer read access for the yaml, this changeset adds the destroy handler which only removes the yaml file for a request. This can be used to remove cached entries. This work is based on the initial work of Brice Figureau <brice-puppet@daysofwonder.com>
* (#7293) Set default format for SSL-related faces.Pieter van de Bruggen2011-07-253-11/+7
| | | | | | By default, the SSL-related faces should all render a strings, not with `Object#inspect`. Reviewed-By: Daniel Pittman
* (Maint.) Unquoting HEREDOCs.Pieter van de Bruggen2011-07-252-9/+9
| | | | | | The additional quotation marks frustrate certain syntax highlighters, and are completely unnecessary for their use. Reviewed-By: Daniel Pittman
* (#7266) Move Certificate option validation into face.Pieter van de Bruggen2011-07-251-9/+13
| | | | | | | | | The validation for the ca_location option on the certificate application continued to hang around on the application long after the face realized its potential to take responsibility for itself. This change moves (and adds) validation code as appropriate into the Face. Reviewed-By: Matt Robinson
* (#7123) Make `find` the default action...Daniel Pittman2011-07-201-0/+1
| | | | | | | | Part of the progress toward getting the `puppet status` invocation working nicely is that it should default to invoking the `find` operation. This implements that, using the new runtime default action facility. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* (#6789) Port SSL::CertificateAuthority::Interface to a FaceDaniel Pittman2011-07-201-0/+233
| | | | | | | | The Puppet::SSL::CertificateAuthority::Interface class was an early prototype heading toward building out a system like Faces. Now that we have done that, this changeset ports the early code to a new face. Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* (#7833) Several help text/template editsnfagerlund2011-06-0811-32/+75
| | | | | | | | | | | | | | | | This commit makes the following changes: * Changes wrapping on some "returns" blocks to accomodate the way we prepend "RETURNS: " to the first line in short help. * Overrides description for save on faces where save is invalid. (Since save has an inherited description, the description was contradicting the summary.) * Adds notes on dummy arguments to short_description where applicable, so as to show up in short help. * Adds the termini list to the action short help template. * Removes the authors block from short help for faces. (Save it for the man page.) * Several trivial wording changes. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* (#7764, 7775, 7778) Revisions to Faces help textnfagerlund2011-06-0722-204/+254
| | | | | | | | | | | | | | Per UX review of help text, this commit makes several changes over the breadth of the Faces help: * Preface API-only action summaries/descriptions with "API only." (issue #7775) * Provide both CLI and API info in "returns," with the CLI info first. (issue #7778) * Summaries should be sentences. (Add punctuation.) * First sentences of descriptions should reiterate summaries. (Summaries and descriptions should be displayed far enough apart that this isn't a problem.) * Standardize on "subcommand" instead of "face" when talking about the entity you invoke at the command line. (Use "face" when describing API use.) * Fix outdated or clunky text in several faces.
* (#7773, 7776, 7764) Several help template tweaksnfagerlund2011-06-073-29/+18
| | | | | | | | | | | | Per UX review of help output, this commit makes several changes to templates and shared help text: * Change "unknown" to "undocumented" * Remove copyright from short help * Point readers to the man pages (issue 7773) * Remove examples from short help (issue 7776) * Remove summary from short help and make it a fallback for description * Edit common option summaries to fit on a single 80-col line
* (#7632) Make secret_agent application compatible with secret_agent facenfagerlund2011-06-061-0/+1
| | | | | | | | | | | | | | | Running `puppet secret_agent` was failing with an error in validate_args (in interface/action.rb), because the application was trying to pass the certname as an argument to the synchronize action. Also, it was trying to submit the report a second time. Reviewing the code with Nick0, we found that the application wasn't inheriting from FaceBase and was duplicating a lot of work, and were able to resolve the issue by basically deleting the whole thing. This patch makes secret_agent behave like the other Faces apps, and makes synchronize the default action of the secret_agent face. We left the `run_mode :agent` line in the application because of bug #7802. Paired-with: Nick Lewis <nick@puppetlabs.com>
* (#7683) Use ronn, when available, to render the output.Daniel Pittman2011-06-011-0/+48
| | | | | | | | | | | | | | | | We now look for ronn(1), and if it is available ask it to generate the *roff output, delegate that to man(1) directly, and show the result to the user in their pager. If ronn(1) isn't available we delegate to $MANPAGER, $PAGER, less, most, or more, in that order, to paginate the raw markdown. Not nearly so nice, but better than doing nothing. Finally, if none of those pagers are available we fall through to the default behaviour of puppet rendering the output, which more or less results in a direct dump to the console. Nice. Reviewed-By: Nick Fagerlund <nick.fagerlund@puppetlabs.com>
* (#7683) Add a 'man' face and subcommand to Puppet.Daniel Pittman2011-06-011-0/+47
| | | | | | | | | | This is the minimal wrapper, cloning a good deal of the logic from help, that runs our face through the 'man' template and returns ronn-formatted Markdown. This provides the crudest baseline possible for getting man-style output, but lets us move forward to improve behaviour. Reviewed-By: Nick Fagerlund <nick.fagerlund@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-2621-231/+599
| | | | | | 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.
* (#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>
* (#7353) Remove :for_humans format entirely.Daniel Pittman2011-05-051-21/+12
| | | | | | | Since we never shipped this in a real release, we don't need to maintain compatibility. So, remove it entirely from the codebase. Reviewed-By: Max Martin <max@puppetlabs.com>
* (Maint) Adjust documentation whitespacenfagerlund2011-05-0417-218/+220
| | | | | The patch from issue #7221 permits indented heredocs. This patch takes advantage of that to make the doc strings less messy.
* (#7303) Remove reference to not-yet-extant man actionnfagerlund2011-05-041-1/+0
| | | | We haven't implemented the `man` action yet, so let's not mention it until we have.
* (#6962) Add self-documentation data to puppet facesnfagerlund2011-05-0417-23/+357
| | | | | | This patch adds documentation strings to most of the faces, actions, and options introduced in 2.7.0. There are a small number of TK notes remaining, and longer strings have not been indented to take advantage of the patch from issue #7221.
* (#7353) Use :console rendering format in our own code.Daniel Pittman2011-05-042-2/+2
| | | | | | | | Now that we have unified things, stop using the compatibility name in favour of the new :console name for the output format. No functional effect beyond avoiding a deprecated output mode. Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
* (#7277)Fixing all secret-agent functions, and the agent itselfLuke Kanies2011-05-033-14/+22
| | | | | | | | This cleans up the behaviours and ensures that we have parity between the basic actions of the agent and the secret_agent. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
* (#7276) Better reporting from the plugin download action.Daniel Pittman2011-05-031-0/+12
| | | | | | | | | | Instead of just returning vague values, return useful information when rendering for a human being. Based on work by Luke Kaines <luke@puppetlabs.com> in https://github.com/lak/puppet/commit/a61cc770ca9b2cad744b5b21b9776a834d6ca895 Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
* (#7278) Improve utility of the Catalog select actionLuke Kanies2011-05-031-1/+17
| | | | | | | | This extends the catalog select action to be able to return more than a single type, as well as supporting both programmatic and human focused rendering of the return value. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* (#7279) Adding some basic file actionsLuke Kanies2011-05-032-0/+48
| | | | | | | | | | | | | | Add the ability to download a file into the local filebucket using a puppet URI or from disk. Also, the ability to store into the filebucket. These provide at least basic UI for moving data around using the filebucket service, and act as an example of how further work can be done. Also, update the code to eliminate a couple of redundant checks on arguments, and add some basic testing around the actions. Mostly only that they exist, at this point. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* Merge branch 'bug/2.7.x/7314-backtrace-when-face-has-syntax-error' into 2.7.xDaniel Pittman2011-05-0213-119/+24
|\
| * maint: move the indirector face base out of puppet/faceDaniel Pittman2011-05-0213-119/+24
| | | | | | | | | | | | | | | | | | We used to shove the base class Puppet::Face::Indirector next to the actual faces; this made a bunch of things, including testing, confusing. Instead, move it away into the indirector where it lives with the rest of the indirector related things. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* | (#7304) Improve help from `puppet foo`Daniel Pittman2011-05-021-1/+1
|/ | | | | | | This addresses two of the four points: we now quote the subcommand name, and emit 'Usage: ' before the usage information on the puppet command line. Reviewed-By: Nick Lewis <nick@puppetlabs.com>
* (#7122) Enforce call arity on actions in the CLI wrapper.Daniel Pittman2011-04-281-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* (#6962) Finish documentation API on Face options.Daniel Pittman2011-04-274-5/+9
| | | | | | | 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) Extend documentation API for Faces.Daniel Pittman2011-04-262-5/+89
| | | | | | 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.
* (#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-211-1/+1
| | | | | | | | | | | | | | | | 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>
* | (#7013) Strip out old face-wide rendering defaults.Daniel Pittman2011-04-192-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Now we want to support action-based rendering, it is super-hard to define the semantics around defaulting where things are unspecified: the execution context (CLI, HTTP, etc) vs the face, vs the action all have different semantics. Without solving the problem of how we express all that context and those semantics down in the action, especially one written by a third party, this just becomes a box of counter-intuitive and annoying semantics and edge-cases. Reviewed-By: Max Martin <max@puppetlabs.com>
* | (Maint) Code cleanup.Pieter van de Bruggen2011-04-151-4/+21
| | | | | | Reviewed-By: Daniel Pittman
* | Merge branch ↵Daniel Pittman2011-04-153-24/+27
|\ \ | | | | | | | | | 'feature/2.7.x/6978-face-and-action-options-should-have-hooks-for-various-actions' into 2.7.x
| * | (#7059) Use option hooks for the indirector terminus option.Daniel Pittman2011-04-151-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | We used to open-code terminus setting, which had a bunch of duplicate code. Now, instead, we use the option hooks, resulting in the same behaviour with much less code. Paired-With: Max Martin <max@puppetlabs.com>
| * | (#7059) Set the CA location using option hooks.Daniel Pittman2011-04-151-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | Now that we support option hooks, we can use those to set the CA location rather than open-coding each chunk of support. As a side benefit we also set the CA location for inherited actions, as we should. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | (#6978) Add before and after decorators to actions from options.Daniel Pittman2011-04-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Options can now add before_action and after_action blocks; these are invoked before or after any action is invoked on the face. This allows these options to declare common behaviour and have it automatically applied to the actions invoked. Option hooks have no defined order of invocation: they will run in a completely random order. Where there are dependencies they should be on the value of the options hash passed to the invocation, not on side-effects of the other invocations. You are not able to influence the arguments, options, or calling of the action body in a before or after decorator. This is by design. The invocation passes to the hook: 1. The action object representing this action. 2. The arguments to the action, as an array. 3. The options for the action, as a hash. Paired-With: Max Martin <max@puppetlabs.com>
* | | (#7115) Enable default actions.Pieter van de Bruggen2011-04-151-0/+1
| |/ |/| | | | | | | | | | | This also enables the 'help' action on the 'help' face to serve as a default action. Reviewed-By: Daniel Pittman Reviewed-By: Nick Lewis
* | (#6928) Add a notice to Parser#validate action when using defaultNick Lewis2011-04-141-1/+4
|/ | | | | | | It was unclear what the action was validating when no arguments were specified, so now it notifies the user. Paired-With: Jesse Wolfe
* (#6928) Add a Parser face with Validate actionNick Lewis2011-04-131-0/+17
| | | | | | | This will accept a number of manifests as arguments and check their syntax. If no filenames are specified, it will check the default 'manifest' setting. Paired-With: Jesse Wolfe
* (#7056) Use 'face' rather than 'faces' in the production code.Daniel Pittman2011-04-1320-0/+415
After some discussion we decided that most uses of the Puppet Face infrastructure were about single faces on their own, not about the collection, and so we were better referring to Puppet::Face[...] in code. This implements that by translating names and references in the Ruby code to the new, s-less, name.