summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Merge branch ↵Daniel Pittman2011-04-212-3/+24
|\ \ \ | | | | | | | | | | | | 'bug/2.7.x/7121-the-'configurer'-face-should-download-plugins-and-send-reports' into 2.7.x
| * | | (#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>
* | | | maint: fix a race in catalog compilation versioning.Daniel Pittman2011-04-211-0/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation has a whole pile of time dependencies in our comparisons, we had a whole pile of races across the code. We could try and fix the comparisons to work better, but that is actually harder than it sounds thanks to the architecture. Instead, freeze time for each test, ensuring that we consistently get the result expected.
* | | Merge remote-tracking branch ↵Daniel Pittman2011-04-2118-17/+67
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '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-1418-18/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Merge branch 'feature/2.7.x/7181-rename-configurer-face' into 2.7.xDaniel Pittman2011-04-214-9/+7
|\ \ \ \ | |_|_|/ |/| | |
| * | | (#7181) Rename configurer face to secret_agent.Daniel Pittman2011-04-214-9/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | 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>
* | | Merge branch 'bug/2.7.x/6928-backport-symbol-to_proc' into 2.7.xDaniel Pittman2011-04-211-6/+4
|\ \ \
| * | | (#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>
* | | | Merge branch 'bug/2.7.x/6928-backport-symbol-to_proc' into 2.7.xDaniel Pittman2011-04-211-0/+9
|\| | |
| * | | (#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>
* | | Merge branch ↵Daniel Pittman2011-04-217-75/+125
|\ \ \ | | | | | | | | | | | | 'feature/2.7.x/7183-implement-invisible-glob-version-matching-for-faces' into 2.7.x
| * | | (#7183) Implement "invisible glob" version matching for facesDaniel Pittman2011-04-215-47/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Invisible glob", or "prefix", version matching means that when you specify a version string to use you can specify as little as one version number out of the semantic versioning spec. Matching is done on the prefix; an omitted number is treated as "anything" in that slot, and we return the highest matching versioned face by that spec. For example, given the set of versions: 1.0.0, 1.0.1, 1.1.0, 1.1.1, 2.0.0 The following would be matched: input matched 1 1.1.1 1.0 1.0.1 1.0.1 1.0.1 1.0.2 fail - no match 1.1 1.1.1 1.1.1 1.1.1 1.2 fail - no match
| * | | maint: better disabling of Signal#trap in our tests.Daniel Pittman2011-04-212-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We tried to stub out the trap method on signal to stop our application level signal handlers getting in the way, but it kept not sticking. Now, instead, we just stub it out globally at the module level in our spec helper. Less fun, but more effective. Until rspec starts installing a signal handler, at least. :)
| * | | maint: more robust listing of valid faces.Daniel Pittman2011-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to treat anything with a top level key in the faces hash as a valid face; it makes more sense to filter that only to things that have at least one implementation. Previously we had to be super-careful not to accidentally touch the top level for an invalid face, which set us up for future failure when someone wasn't careful enough; now we can cope with that. Paired-With: Max Martin <max@puppetlabs.com>
| * | | maint: clean up testing code a fraction...Daniel Pittman2011-04-201-22/+10
| | | | | | | | | | | | | | | | | | | | This rewrites a block of identical tests down to a little table, then applies the test over that.
| * | | maint: better error report for a missing version of a face.Daniel Pittman2011-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We would report this: Could not find version 1.0.0 of Puppet::Face[:version_matching, "2.0.0"] That is not actually so helpful, not least because people wonder why it reports a version number they didn't ask for. Instead, we just report the requested name now.
| * | | maint: handle face clear/reset sanely in the interface spec.Daniel Pittman2011-04-201-5/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to flush the loaded face cache, but not the list of 'require' things, which meant that these tests couldn't work with anything outside their own setup, which is actually pretty undesirable. Instead, port the code from the face_collection spec that handles this in a way that makes me less inclined to weep, and which lets the surrounding code work as designed.
* | | maint: stop stubbing log level setting.Daniel Pittman2011-04-2012-79/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The underlying problem turned up when another test (as a side effect) changed the logging level to be more verbose, and a very distant test broke. This revealed that we didn't preserve that global state around tests. Fixing that further revealed that we stubbed setting that log level all over the place, as a point fix for the same problem, and to assert the operation of various tools. So, additionally, we strip out all that stubbing, and assert on the desired effect rather than the mechanism for achieving it. Reviewed-By: Max Martin <max@puppetlabs.com>
* | | Move tests from Puppet-acceptance repoDominic Maraglia2011-04-2092-0/+2074
| | |
* | | Merge branch 'bug/2.7.x/7116-cannot-use-faces-with---debug' into 2.7.xDaniel Pittman2011-04-202-104/+126
|\ \ \
| * | | (#7116) Handle application-level options in parse_optionsDaniel Pittman2011-04-202-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | maint: fix gratuitous whitespace in the code.Daniel Pittman2011-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | | maint: remove redundant context from the test.Daniel Pittman2011-04-201-103/+101
|/ / / | | | | | | | | | | | | | | | | | | | | | We had a block of tests in a describe block inside a describe block; they were literally one hundred percent overlap. Eliminate that and just keep the outer. Reviewed-By: Max Martin <max@puppetlabs.com>
* | | Merge branch 'bug/2.7.x/7062-improve-cloudpack-option-parsing-errors' into 2.7.xDaniel Pittman2011-04-202-28/+105
|\ \ \
| * | | (#7062) better argument handling in the action wrapper methodsDaniel Pittman2011-04-202-8/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously used *args to collect all arguments to the action when_invoked block, then tried vaguely to massage some little bits of them into the right shape. Methods defined with blocks, in Ruby 1.8, also have some fun behaviours. The most special is that if you pass more than one argument to a block defined with only one Ruby will automatically coerce the arguments into an array – and this is preserved when it is bound to a method. This led to routine situations where we would pass the wrong number of arguments to the block because, say, the user gave an extra argument on the command line. Instead of failing this would transmogrify the arguments in counterintuitive ways, and end up with horrible stack traces when that interacted badly with the code as written. Now, instead, we work out the right argument format based on the arguments that the when_invoked block takes. This gives much better (albeit perhaps not so user friendly) behaviour at the interface level. Which is, at least, consistent with other Ruby API. Reviewed-By: Max Martin <max@puppetlabs.com>
| * | | maint: move method comments outside the comment.Daniel Pittman2011-04-201-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The comment discussing the purpose of the wrapper and related details rightly belongs outside the method; move it there so it doesn't perturb the functional changes that follow. Reviewed-By: Max Martin <max@puppetlabs.com>
* | | | Merge branch 'ticket/2.7.x/7166' into 2.7.xJosh Cooper2011-04-196-20/+20
|\ \ \ \ | |/ / / |/| | |
| * | | Fixed #7166 - Replaced deprecated stomp "send" method with "publish"James Turnbull2011-04-196-20/+20
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "send" method in the stomp gem has been deprecated since: http://gitorious.org/stomp/mainline/commit/d542a976028cb4c5badcbb69e3383e746721e44c It's been replaced with the "publish" method. Also renamed the send_message method to publish_message more in keeping with language used in queuing.
* | | Merge branch 'ticket/2.7.x/maint-remove_duplicate_faces_code' into 2.7.xMatt Robinson2011-04-193-30/+0
|\ \ \ | |_|/ |/| | | | | | | | * ticket/2.7.x/maint-remove_duplicate_faces_code: maint: Remove unused faces code
| * | maint: Remove unused faces codeMatt Robinson2011-04-193-30/+0
|/ / | | | | | | | | | | | | Looks like in renaming faces to face we just missed some files. They got copied, not moved. Paired-with: Max Martin <max@puppetlabs.com>
* | maint: mangle grammer in rspec to avoid Jenkins fail...Daniel Pittman2011-04-191-2/+2
| | | | | | | | | | | | | | | | Apparently 'expect { ... } .not_to' is considered unnecessary contortion by the rspec authors, so we only have 'expect { ... } .to_not' in some versions of rspec. This updates the test code to reflect that bit of annoyance.
* | Merge branch 'bug/2.7.x/6752-allow-action-specific-render-methods'Daniel Pittman2011-04-1916-214/+383
|\ \ | | | | | | | | | Fix the conflicts over changes in my previous commit.
| * | (#7013) Wire up rendering hooks on the CLI.Daniel Pittman2011-04-193-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-194-11/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-199-41/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-192-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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-197-58/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-192-4/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: make sure we don't ever default to being default...Daniel Pittman2011-04-191-1/+6
| | | | | | | | | | | | | | | | | | | | | We tested that we could make something a default action, but we also want to assert that we never accidentally make everything the default action. Paired-With: 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: delete README.strings, which is out of date.Daniel Pittman2011-04-191-115/+0
| | | | | | | | | | | | | | | | | | | | | This documentation has not been kept up to date with changes in the product, since it originated way back in the prototype of interfaces. Reviewed-By: Randall Hansen <randall@puppetlabs.com>
| * | maint: test the 'help' face has the default action 'help'Daniel Pittman2011-04-192-2/+7
| | | | | | | | | | | | | | | | | | | | | 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-195-39/+100
|\ \ \
| * | | 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-195-44/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-194-20/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | | Merge branch 'ticket/2.7.x/7108' into 2.7.xnfagerlund2011-04-182-32/+17
|\ \ \ \ | |_|/ / |/| | |
| * | | (#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.