| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The application wrapper for help used to disable the inherited 'render' method
from FaceBase - specifically, to avoid the behaviour of rendering strings
poorly.
Now that we have support for good output in the upstream method, this is
unnecessary, so we can eliminate the stub method entirely and use the default
behaviour.
(This also enables rendering the help into JSON or YAML, against the odds that
someone actually cares about that. ;)
|
|
|
|
|
|
|
|
|
|
|
|
| |
A logic error meant that global Face options that took arguments were
mishandled: we never consumed the argument, so we read this:
puppet facts --render-as json find $(hostname)
...as meaning "invoke the 'json' action on the 'facts' face"...
This fixes that problem, so we now correctly handle both optional and
non-optional arguments to global Face options.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Faces isn't a face, interestingly, so it doesn't get a summary line in the puppet help.
This will output the appropriately-formatted manpage text using the normal
mechanism.
|
|
|
|
|
|
|
|
|
|
|
| |
We now move over to using only network FormatHandler rendering code for
output, ditching all the support we had in the application.
We include a compatibility shim to ensure that the :for_humans format that was
supported for a while is now an alias for the :console format we are using
moving forward.
Reviewed-By: Jacob Helwig <jacob@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
| |
We need a boilerplate application file and class to expose a face on the
command line; this adds that for the plugin face, to expose it to users.
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 is unnecessary, and only turned up because Matz &c. impose their taste on
the rest of the world through the Emacs Ruby mode. Since people are starting
to clone that, and it doesn't add value, eliminate it everywhere.
Reviewed-By: Pieter van de Bruggen <pieter@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The error handling code in the face CLI facade was pretty terrible: it make a
bunch of assumptions about the structure of the error message it got back, and
used exceptions to communicate inside the same function.
Instead, we handle errors uniformly without raising and catching in the same
method, report more nicely, and exit cleanly in all cases.
Reviewed-By: Nick Lewis <nick@puppetlabs.com>
|
|
|
|
| |
This reverts commit cd474b0aff0e0fec33295c8abc0668af90fb7cc1.
|
|
|
|
|
| |
Another face quirk in error reporting highlights a better way to work the
error message; do so.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
We hid another layer of per-application option in the class backing the
application, which wasn't correctly handled in the parse_options method.
They are now found and handled, so that global flags like --debug work as
expected on the left of the action, not just the right.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|
|
|
|
|
|
| |
We had some stray spacing between variables and the '=' sign from when there
was another variable in place; it got deleted, but the code wasn't closed up.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|\
| |
| |
| | |
Fix the conflicts over changes in my previous commit.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We now find, and call, the appropriate rendering hooks on actions during the
rendering phase. This allows the user to intercept and replace the result
object that passes through the rest of the rendering system on the fly.
Example usage:
action :foo do
when_rendering :pson do |result|
{ :whatever => result[a],
:foobar => result[b],
}
end
end
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We no longer establish the rendering mode in the actions; they just default to
"nothing", and let that flow on out to the application layer. That lets the
facade we put before the face determine the default behaviour.
This is mostly a no-op down in the CLI side, but it makes it much easier to
integrate into MCollective, HTTP-API, and for other non-CLI users of Faces.
Reviewed-By: Max Martin <max@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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We have some specific requirements around rendering, including the ability of
authors of actions to add nice, custom rendering. To support that we want
solid "basic" rendering for human-focused output.
This implements that generic rendering correctly and to spec, to give a sound
basis that we can build on for extensible rendering.
(#7013) better default rendering support for faces
We have some specific requirements around rendering, including the ability of
authors of actions to add nice, custom rendering. To support that we want
solid "basic" rendering for human-focused output.
This implements that generic rendering correctly and to spec, to give a sound
basis that we can build on for extensible rendering.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We used to skip printing if the return value from an action was false; this
made it impossible to display "false" to the user, which was a more meaningful
output in some cases than nothing.
maint: print 'false' in the default render method.
We used to skip printing if the return value from an action was false; this
made it impossible to display "false" to the user, which was a more meaningful
output in some cases than nothing.
Reviewed-By: Max Martin <max@puppetlabs.com>
|
|/
|
|
|
| |
Puppet kick's help referred only to the outdated authconfig (namespaceauth.conf) file, rather than
the modern rest_authconfig (auth.conf).
|
|
|
|
| |
Reviewed-By: Mike Stahnke
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
This also enables the 'help' action on the 'help'
face to serve as a default action.
Reviewed-By: Daniel Pittman
Reviewed-By: Nick Lewis
|
|/
|
|
|
| |
Puppet cert now allows bareword actions, which brings it more in-line with the
Faces subcommands. Updating the help text accordingly.
|
|
|
|
|
|
|
| |
This reverts commit 24a277c5e805ce16e0b86e17e6cb2fbe1945ae07.
Despite not needing --ignoreimport as an option anymore, it's still used
internally and has to stay.
|
|
|
|
|
|
| |
This was only used with --parseonly, which is gone.
Paired-With: Jesse Wolfe
|
|
|
|
|
|
| |
This has been removed in favor of 'puppet parser validate <manifest>'.
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Logically, the extra work around option parsing for faces belongs in the
application parse_options method, not hidden in the step before. This commit
moves that to the right place and fixes the fallout from that strange early
design decision.
Along the way we unify error reporting for invalid options so that all the
code paths result in the same externally detected failures.
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
| |
The default behaviour is to serialize the result somehow, defaulting to
displayed, render should be a no-op. This means overriding the parent method.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
|
|
| |
The face application base uses render to transform the returned object to a
form where #to_s produces the output intended for the end user; we were
actually printing in the method instead, leading to an extraneous 'nil' at the
end of the output...
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
|
| |
This implements the basic help face, along with the start of the support
structures; we include the basic application, and the default help action that
just emits a listing of faces and other discovered stuff...
Reviewed-By: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Jesse made a change, in e1191f33defcaffec5900c7122a89ca75d3a9673, to
transition from printing and exiting in the help method up to returning the
help data to the caller. This was part of eliminating rdoc usage from the
display of help to the user.
The cert application was missed, and still used the legacy "print and exit"
model; this cleans that up so it matches the rest of the code.
Paired-With: Matt Robinson <matt@puppetlabs.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For details of why we're moving please see:
https://groups.google.com/d/topic/puppet-users/NuspYhMpE5o/discussion
Removed explicit GPL licenses where appropriate
Replaced selected GPL licenses with Apache 2.0
Replaced LICENSE with Apache 2.0
Updated README
|
|
|
|
|
|
|
|
|
|
|
| |
It only had one available method, and the errors incorrectly
specified what it was.
This just defaults to listing all the time, and I've updated
the docs to be correct, too.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Daniel Pittman <daniel@puppetlabs.com>
|
|\
| |
| |
| |
| | |
This joins the two repositories, including full history, into a single run, as
well as landing the interfaces work on the next branch ready for release.
|
| |
| |
| |
| |
| | |
The codebase is now using the new name, faces, uniformly to reference the
objects contained. All tests pass.
|