summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
| * | (#7013) Wire up rendering hooks on the CLI.Daniel Pittman2011-04-192-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | (#7013) Handle rendering modes out in the application layer.Daniel Pittman2011-04-192-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | (#7013) Strip out old face-wide rendering defaults.Daniel Pittman2011-04-195-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | (#7013) Return bound methods for when_rendering hooks.Daniel Pittman2011-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | We can return a method bound to the current face instance when we access the 'when_rendering' hook, which allows us to directly call them. Make that change, and add appropriate testing. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | (#7013) Support 'when_rendering' and 'render_as' in actions.Daniel Pittman2011-04-195-13/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These define the API used by folks writing actions that supports their rendering hooks. 'when_rendering' defines a helper method on the interface, which runs the users code in their expected context. 'render_as' just sets the default rendering format; by default this is :for_humans. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | (#7013) better default rendering support for facesDaniel Pittman2011-04-191-4/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | maint: print 'false' in the default render method.Daniel Pittman2011-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | maint: test the 'help' face has the default action 'help'Daniel Pittman2011-04-191-1/+6
| | | | | | | | | | | | | | | | | | | | | We had a pending test for this, but forgot to write it way back when we were implementing the feature. Add it now. Reviewed-By: Max Martin <max@puppetlabs.com>
* | | Merge branch 'bug/2.7.x/7132-a-summary-with-a-newline-is-accepted' into 2.7.xDaniel Pittman2011-04-192-23/+40
|\ \ \
| * | | maint: drop multi-version support from action loading.Daniel Pittman2011-04-191-20/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now we have no other support for multi-version loading in the code; we should strip out support from the action loading to mirror. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | | (#6962) Add 'description' to faces and action.Daniel Pittman2011-04-192-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the 'description' method to the faces and actions, as well as structured testing to ensure that the DSL works as expected. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | | (#7132) Reject 'summary' text with newlines embedded.Daniel Pittman2011-04-192-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our summary documentation is used to provide single-line context to faces, actions, and other items. To support this we hard-fail if someone tries to use the summary to embed the long documentation, and point them to the right place to add the extended text. Reviewed-By: Max Martin <max@puppetlabs.com>
* | | | (#7108) Update help/man text for puppet kicknfagerlund2011-04-181-25/+10
| | | | | | | | | | | | | | | | | | | | Puppet kick's help referred only to the outdated authconfig (namespaceauth.conf) file, rather than the modern rest_authconfig (auth.conf).
* | | | (#7108) Modernize description of --listen in defaults.rbnfagerlund2011-04-181-4/+4
| | | | | | | | | | | | | | | | --listen's description referred to the older XMLRPC authorization path.
* | | | Maint: puppetmaster -> puppet master in defaults.rbnfagerlund2011-04-181-3/+3
| |/ / |/| |
* | | Merge remote-tracking branch 'community/feature/puppet-device' into 2.7.xPieter van de Bruggen2011-04-1821-51/+565
| | | | | | | | | | | | Reviewed-By: Mike Stahnke
* | | Merge branch 'ticket/2.7.x/7131-optional-arguments' into 2.7.xMax Martin2011-04-181-2/+3
|\ \ \ | | | | | | | | | | | | | | | | * ticket/2.7.x/7131-optional-arguments: (#7131) Remove support for optional arguments to options
| * | | (#7131) Remove support for optional arguments to optionsMax Martin2011-04-181-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per the design decision documented in #7131, optional arguments to options will no longer be supported. This patch causes such optional arguments to raise an error, and tests for this behavior. Also cleaned up some confusing use of the term "subject" in specs. Paired-with: Daniel Pittman
* | | | (Maint) Fixing an order-dependent failure.Pieter van de Bruggen2011-04-181-2/+0
|/ / / | | | | | | | | | | | | | | | Running spec/unit/option_spec.rb before requiring puppet/interface caused a circular require, and a failure. Paired-With: Max Martin
* | | Merge branch ↵Daniel Pittman2011-04-173-6/+22
|\ \ \ | | | | | | | | | | | | 'bug/2.7.x/7013-interfaces-should-be-able-to-mark-options-as-required' into 2.7.x
| * | | (#7013) Add support for required options.Pieter van de Bruggen2011-04-173-6/+22
| |/ / | | | | | | | | | | | | | | | | | | | | | This adds another hook into the generated wrapper, which invokes a method to validate arguments. This is used to raise an exception when required options have not been passed to the method. Reviewed-By: Daniel Pittman <daniel@puppetlabs.com>
* / / (Maint) Code cleanup.Pieter van de Bruggen2011-04-151-4/+21
|/ / | | | | Reviewed-By: Daniel Pittman
* | Merge branch ↵Daniel Pittman2011-04-158-50/+161
|\ \ | | | | | | | | | '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>
| * | (#6978) Enforce the calling convention of option hooks.Daniel Pittman2011-04-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | We require that hooks take exactly three arguments; now we enforce that in the DSL, to ensure we give good, and early, errors to users who do the wrong thing. 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-156-26/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'tickets/2.7.x/7115' into 2.7.xPieter van de Bruggen2011-04-155-13/+35
|\ \ \
| * | | (#7115) Enable default actions.Pieter van de Bruggen2011-04-155-13/+35
| | |/ | |/| | | | | | | | | | | | | | | | This also enables the 'help' action on the 'help' face to serve as a default action. Reviewed-By: Daniel Pittman Reviewed-By: Nick Lewis
* | | Merge branch 'tickets/2.7.x/7111-deprecation-warning-wordsmithing' into 2.7.xJacob Helwig2011-04-151-3/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | * tickets/2.7.x/7111-deprecation-warning-wordsmithing: Cleanup trailing whitespace (#7111) Clarify scoping deprecation warning
| * | | Cleanup trailing whitespaceJacob Helwig2011-04-141-2/+2
| | | |
| * | | (#7111) Clarify scoping deprecation warningJacob Helwig2011-04-141-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | This modifies the deprecation warning to explicitly point out that the specified behavior is deprecated, when it is slated to be removed, along with what the user can do to prepare for its removal. Paired-with: Randall Hansen <randall@puppetlabs.com>
* | | Merge branch 'tickets/next/7080-serializable_indirector_requests' into 2.7.xLuke Kanies2011-04-145-15/+92
|\ \ \ | |/ / |/| |
| * | Adding json support to Puppet::NodeLuke Kanies2011-04-141-0/+23
| | | | | | | | | | | | | | | Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | (7080) Adding json support to Indirector RequestLuke Kanies2011-04-141-2/+49
| | | | | | | | | | | | | | | | | | | | | We'll be using this to do RPC over mcollective. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * | Fixing Facts pson methods more resilientLuke Kanies2011-04-141-8/+12
| |/ | | | | | | | | | | | | | | | | | | | | They were currently failing if any values were nil, which happened a lot. We also prefer not to include nil values, since it muddies the json unnecessarily. Reviewed-by: Daniel Pittman <daniel@puppetlabs.com> Signed-off-by: Luke Kanies <luke@puppetlabs.com>
| * Merge branch 'ticket/next/6928' into nextNick Lewis2011-04-141-1/+4
| |\
| | * (#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
| * | Merge branch 'ticket/next/7103' into nextNick Lewis2011-04-131-4/+4
| |\ \
| | * | (#7103) Fix HEAD requests in the HTTP handlerNick Lewis2011-04-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HEAD request support was implemented in 2.6.x, and the internal API in the HTTP handler changed in 2.7.x. So when the branches were merged together, HEAD requests ended up using the wrong API without any visible merge conflicts or spec failures. This fixes them to use the correct API. Reviewed-By: Matt Robinson
* | | | (#6408) Update puppet cert help for new subcommand action syntax.nfagerlund2011-04-141-47/+51
| | | | | | | | | | | | | | | | | | | | Puppet cert now allows bareword actions, which brings it more in-line with the Faces subcommands. Updating the help text accordingly.
* | | | Merge branch 'feature/master/4258-pkgutil' into 2.7.xMatt Robinson2011-04-141-0/+175
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * feature/master/4258-pkgutil: (29 commits) (#4258) Fix pkgutil spec test to have the correct provider (#4258) Remove superfluous command check that called pkgutil (#4258) Fix fd leak opening pkgutil config files (#4258) Permit variations of -nv in both pkgutil.conf files (#4258) Stop file and config checks from breaking spec (#4258) Check wgetopts in pkgutil.conf (#4258) Fix hash duplication affecting canonical provider instance (#4258) Use pkgutil -a to reliably determine package common names/aliases (#4258) Update pkgutil spec for recent impl changes (#4258) pkgutil: bug fix: if shortname is not equal to package name (#4258) pkgutil provider: better handling of short package names (#4258) pkgutil provider: misc enhancements Add spec tests for pkgutil package provider * Fix exception on parse failure of pkgutil output * Fix exception when querying latest version for unknown package Fixing indentation Removing blastwave references and unused PAGER Changing indentation to 2-spaces as per 2.6+ style Single package queries made more robust when dealing with pkgutil noise Fixing wget verbose regex These regular expressions will not match anything. pkgutil doesn't output anything that can be matched. ...
| * | | | (#4258) Remove superfluous command check that called pkgutilDominic Cleal2011-04-131-8/+4
| | | | |
| * | | | (#4258) Fix fd leak opening pkgutil config filesDominic Cleal2011-04-131-2/+3
| | | | |
| * | | | (#4258) Permit variations of -nv in both pkgutil.conf filesDominic Cleal2011-04-131-2/+4
| | | | |
| * | | | (#4258) Stop file and config checks from breaking specDominic Cleal2011-04-131-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Moved all file and config checks into healthcheck method which is then stubbed in the spec.
| * | | | (#4258) Check wgetopts in pkgutil.confJuerg Walz2011-04-131-0/+7
| | | | |
| * | | | (#4258) Fix hash duplication affecting canonical provider instanceDominic Cleal2011-03-221-1/+1
| | | | |
| * | | | (#4258) Use pkgutil -a to reliably determine package common names/aliasesDominic Cleal2011-03-191-23/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Populate instances with both the real package name ("CSWsvn") and the alias name ("subversion") from separate "pkgutil -a" call. Fixed cases where pkgutil noise was parsed as aliased package names and also breaking "not in catalog" detection. Updated pkgutil_spec test to show various edge cases.
| * | | | (#4258) pkgutil: bug fix: if shortname is not equal to package nameJuerg Walz2011-03-101-2/+2
| | | | |