puppetlabs/puppet — pull request #2663 by hlindberg (2014-05-17 00:51:15+00:00)
Title: (PUP-2584) Make 404 warning on agent specific and an error.

This changes the general 404 warning issued by the indirection rest
baseclass into being an error if the option :fail_on_404 is passed
as a "query option".

This is then used when asking for a certificate, when asking for
the initial catalog, and when retreiving a catalog from the master.

The :fail_on_404 will raise an exception, and it is up to the caller to
determine what this means - when retrieving a catalog, there may be
retries etc. The request for a certificate fails cleanly.

To try this, contact the master with an unknown environment when using
directory environments for the master configuration.

This more specific behavior is wanted because:
* the rest indirection is used for many different things, one of them
being probing through a list of files to use until one is found.
* the use cases where it really matters that master does not respond
with 404 should error out.