Merge pull request #2156 from nfagerlund/docs_metaparams_schedule

Docs: Schedule, stage, and other metaparams
(PUP-736) Remove description from RPM/DPKG

Encoding mis-match causes package prefetching to fail with
'invalid byte sequence in US-ASCII'. The guidelines for the
Debian Project [1] and the Fedora Project [2] specify that
metadata files should be UTF-8 encoded, but it is not
enforced.

Since we are not able to force encoding "UTF-8" to work around
this we have decided to back out the description from package
formats for now while working on a longer term solution for
encoding.

Without this fix the package formats fail if there is a package
with UTF-8 encoding in the description.

[1]: http://www.debian.org/doc/debian-policy/ch-controlfields.html
[2]: http://fedoraproject.org/wiki/Packaging:Guidelines#Encoding

Paired with Josh Partlow <joshua.partlow@puppetlabs.com>
(PUP-736) Do not test for package not found

And log unmatched lines at debug level. The executors for dpkg and rpm
will raise an error if the command line returns a non-zero status, which
it does for package not found errors.  This bypasses parsing and is
interpretted as package absent result.  Therefore there is no need to
attempt to parse 'package not found' and we can avoid any issues with
changing or translated messages.

If there are unrecognizable lines of output returned from a successful
execution, log them at debug level.  Logging at a warning level has the
potential to produce too much noise.

Dpkg#query is no longer multi-line output and no longer requires
filtering through a pipe.
Merge pull request #2232 from hlindberg/pup-716_short-lived-objects-in-filesystem

(PUP-716) short lived objects in filesystem
(maint) Improve docs for acceptance ci:test:git from another FORK
(PUP-1212) Fix uninformative stack backtrace in evaluator errors

Now the backtrace used is the original, not the place where
the evaluator handles exceptions.
Merge branch 'master' of ssh://github.com/puppetlabs/puppet.git
(PUP-1151) Environment enumeration authorization test.

Add a test that unauthorized requests to the environment enumeration
endpoint receive a 403 response.

Check for the hardcoded endpoint in Puppet::Network::HTTP::Handler and
raise a not authorized error no matter what.
(PUP-1151) Factor out v1 HTTP request processing into own request processor.

The end goal is to have v1 and v2 API endpoints in their own processors,
with the routes registered on a shared handler that performs client
authentication and dispatch.

This commit rips out the v1 endpoints to their own processor, but does
not define anything about the handler including registration.

v1-related behavorial tests have been moved from the handler spec to the
v1 spec.
(maint) Get rid of http handler's initialize_for_puppet method.

It doesn't seem to be used anywhere except in some tests that expect it
to be called.

Also rescue any exception when processing a request in the http handler,
and respond with a 500(!).
(PUP-1151) Add routing framework.

Add a routing framework for the HTTP module that routes requests to
either the V1 or V2 API as appropriate (first it sees if the V2 API
would like to handle a request, and if not it's passed off to the V1
API).

To support the routing framework, several new classes in the HTTP module
are introduced: Request, Route, Response, and MemoryResponse (for
testing).

The V2 API is implemented in lib/puppet/network/http/api/v2.rb.

Change the method to handle the request from process to call, which
allows using lamdbas and procs as route handlers.

Change the require path in the HTTP module to break a cycle, which
necessitates changing requires in a few other files to just require the
entire Puppet::Network::HTTP module (rather than just the V1 API class).

Delete Puppet::Network::HTTP:RackHttpHandler because it was useless.

Change the initialize method of Puppet::Network::HTTP::WEBrickRest to
omit the unused handler argument.
(PUP-1151) Add a 405 error class to http handler

Now that we can actually dispatch based on path and HTTP verb, we can
reasonably respond with 405 for verbs that aren't supported.
(PUP-1151) Change Route matching semantic specs.

Rather than Routes having to match on path and method, they match only
on path and can then decide whether the method is allowed or raise
a method not allowed error.

Most of the handler routing spec tests are really route spec tests, so
those have been moved over.
(PUP-1151) Implement Route changes.

Rather than creating a route with a path and method, routes are created
with just a patch matcher and method handlers can be added by calling
the HTTP method-named methods on the route. By default, handlers for all
methods just raise a method not allowed error; user-defined handlers
replace those.

When the handler is given a list of routes to register, it checks to see
if any of them have identical path matching regexes and throws an error
if they do. However, it is still entirely possible for regexes that do
not compare as equal to express the same regular language, so users
still bear responsibility to ensure their routes cooperate.
Merge pull request #2239 from zaphod42/feature/master/pup-536-environment-enumeration

(PUP-1151) Take a first step toward a new HTTP API
(PUP-1151) Add documentation for environments endpoint
(PUP-1151) Specify JSON and error responses

We need to move away from PSON in puppet. Using V2 as a switching point
is as good as any. This also specifies how error responses are
formatted.
(PUP-1151) Have puppet depend on json

In order to have the v2 api emit and consume JSON puppet will need to
have access to a json library. This adds it to our dependencies for
debian, redhat, and gem packages. This should be a safe thing to do
since puppet already needs hiera and hiera depends on JSON, so this is
just taking the same dependency that hiera already had and applying it
directly to puppet.
(PUP-1151) Fix environment enumeration endpoint test
Merge pull request #2241 from aperiodic/pup-1151-environment-enumeration-test-fix

(PUP-1151) Fix environment enumeration endpoint test