| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This includes various style changes, and assorted fixes to testing.
Paired-With: Matt Robinson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
By default, the SSL-related faces should all render a strings,
not with `Object#inspect`.
Reviewed-By: Daniel Pittman
|
|
|
|
|
|
| |
The additional quotation marks frustrate certain syntax highlighters,
and are completely unnecessary for their use.
Reviewed-By: Daniel Pittman
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
Termini lists are now being generated in the help templates. This commit
removes the hardcoded lists from each of the affected faces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
The patch from issue #7221 permits indented heredocs. This patch takes advantage
of that to make the doc strings less messy.
|
|
|
|
| |
We haven't implemented the `man` action yet, so let's not mention it until we have.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Now we have the capability, mark all our faces copyright the company and under
the Apache 2 license, which indeed they are.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| | |
Reviewed-By: Daniel Pittman
|
|\ \
| | |
| | |
| | | |
'feature/2.7.x/6978-face-and-action-options-should-have-hooks-for-various-actions' into 2.7.x
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| |/
|/|
| |
| |
| |
| |
| | |
This also enables the 'help' action on the 'help'
face to serve as a default action.
Reviewed-By: Daniel Pittman
Reviewed-By: Nick Lewis
|
|/
|
|
|
|
|
| |
It was unclear what the action was validating when no arguments were specified,
so now it notifies the user.
Paired-With: Jesse Wolfe
|
|
|
|
|
|
|
| |
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
|
|
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.
|