(PUP-1278) Windows Puppet Agent Service gracefully terminates after succesfully being put into a Paused state

Removed redundant return statement
Added in logic to only start the Puppet Agent if the service is in a Running or Idle state
(pup-640) Update report schema for error events

Previously, special handling was added to synthesize a report
event even when the property application failed early. However,
when this change was made the report schema wasn't updated,
so the schema did not allow for several fields in the event
to be null (as they are for one of these synthesized events).

This change updates the report schema to reflect that certain
fields can be null. It also adds a spec test including an error
event, which requires the schema change in order to pass.
(PUP-576) Handle Ruby 2.0 OpenSSL lib error message

The error message returned by Ruby's OpenSSL library when the host name
does not match the server certificate changes between 1.8, 1.9 and 2.x.
We handle this message and re-wrap it in a more informative form, but
were failing to catch the 2.x variation.

1.8: 'hostname was not match with the server certificate'
1.9: "hostname does not match the server certificate"
2.x: "hostname \"#{hostname}\" does not match the server certificate"

(2.0 and 2.1 as of the time of this commit)

This change just alters the regex to catch all three variants.
(PUP-1529) Make squelch of parse error specific to resource_type command

Without this fix, all indirect loading of .pp logic will silently fail.
With this fix, only queries via the resource_type command have
parse errors squelched in order to allow search to continue past a
syntax error.
Merge branch 'stable'

Conflicts:
	lib/puppet/indirector/resource_type/parser.rb
(maint) Fix error message in reduce function

If you had 3 parameters this error message would print the type of the
wrong parameter.
(PUP-1529) Make squelch of parse error use context instead of global

This fixes up the earlier fix for 3.4.x where a global variable
was used to control if parse errors should be raised or not.

Now the context system is used instead of a global variable. (It is
still a boolean value since there is no other immediate use for a
strategy that either raises the error or logs the problem).
Merge pull request #2312 from dalen/future_parser_fix

Fix error message in reduce function
(PUP-576,PUP-1064) Update to activerecord 3.2.x to work around a Ruby 2.x issue

tests/store_configs/enc_provides_node_when_storeconfigs_enabled.rb fails
running under Ruby 2.0 because of a bug between activerecord 3.0 and
Ruby 2.0.  This fails with:

  'undefined method `insert_record' for <Array:0x00000003027be8>'

when Puppet::Rails::Host attempts to save with merged facts.  The root
cause is tangled up in ActiveRecord's association proxies.

ActiveRecord 3.2 has patches which allow it to work under Ruby 2.0

However making this change unearthed another Rails issue which Andrew
Parker recalled was in fact PUP-1064.  This issue tracks a
general failure in Puppet on any Ruby version working with ActiveRecord
> 3.0.10.  Fortunately there was a patch attached to PUP-1064 which
guards lookup of the activerecord id property on the
puppet/rails/resource.rb activerecord object, and this does appear to
fix the issue.
(PUP-1118) Convert environment for nodes on load

The environment for a Puppet::Node instance is turned into simply the
name of the environment when the Puppet::Node is serialized. Since we
then load the Puppet::Node back in using YAML, and YAML uses the magic
of type annotations to re-create the Puppet::Node instance, the
environment that ends up being set on the Puppet::Node instance isn't
an instance of Puppet::Node::Environment, but is a String.

Since the Puppet::Node doesn't get a callback during deserialization, we
added a fixup method to the Puppet::Indirector::YAML implementation so
that the node object can be fixed up before being handed out to the big,
bad world.

The other choice was to use safe_yaml to load the file and then do the
conversion, but safe_yaml is significantly slower than just plain yaml
and we decided to avoid the performance hit.
(PUP-1278) Updating Windows service event messages.

Changing the service startup message to not include the agent
parameters.  This will now only be printed when actually doing the agent
run.

Removing the "service running" message from the loop as this prints out
repeatedly even if the service is paused.

Moving determining the path to puppet to outside the run loop.
Merge branch 'pr/2301'

* pr/2301:
  (PUP-1278) Updating Windows service event messages.
  (PUP-1278) Windows Puppet Agent Service gracefully terminates after succesfully being put into a Paused state

This closes GH-2301.
Merge pull request #2313 from jpartlow/issue/master/pup-576-add-fedora19-host-to-acceptance

Issue/master/pup 576 add fedora19 host to acceptance
(maint) Remove warning added during debugging
PUP-1450 Windows file resource Invalid DACL errors

 - When the source of a file resource is referred to through a symlink
   it's possible the volume for the real file does not support ACLs.
   Unfortunately it's not possible to simply readlink the path to
   determine the real path / volume, so the best thing to do is
   attempt to read the DACL of the file, catch the exception when it's
   invalid and fallback to default owner / group / mode on Windows.
 - Furthermore, under VirtualBox, the standard ERROR_INVALID_DACL is
   not the error that propagates, but rather ERROR_INVALID_FUNCTION, so
   there is special handling for that scenario.
 - Note that this particular issue also affects paths like the Puppet
   module path puppet:///modules that may be symlinked in environments
   like Vagrant.
PUP-1450 Honor source_permissions_ignore

 - In further debugging this failure, it was discovered that despite
   the :source_permissions parameter being set to :ignore on the file
   resource type, that we're still attempting to stat the source file
   and extract group / owner / mode.  So instead of trying to stat the
   file, catching errors, and falling back to defaults, we properly
   ignore the group / owner / mode of the source file and provide
   reasonable defaults on both Windows and Linux.
 - In Windows, the defaults continue to be
   :owner => 'S-1-5-32-544' (BuiltinAdministrators)
   :group => 'S-1-0-0' (Nobody)
   :mode => 0644
 - On other operating systems, the defaults are now set to be
   :owner => Process.euid
   :group => Process.egid
   :mode => 0644
 - Several tests were refactored to be less fragile with respect to the
   :source_permissions parameter
(PUP-1549) Use standard reason phrases on webrick

The webrick interface was using the body of the response for the reason
phrase for non-2xx responses. In the v1 api, this meant that we got
bizarre response headers. In the v2 api, it meant that we got json
formatted body data in the first header.

Not only was that state of affairs odd, it was also inconsistent with
the rack implementation, which didn't ever set the reason phrase. I am
also a little concerned that some clients might have choked on large
reason phrases (header too long issues).

This removes the setting of the reason phrase on webrick, which give us
back the standard reason phrases.
(PUP-1549) Update documentation showing reason phrase

All of the error responses that we had used as examples in the API
documentation had been taken from using webrick. Now that webrick is
consistent with rack, the docs need to be updated to show what the
responses should really look like.
Merge pull request #2315 from zaphod42/issue/master/pup-1549-v2-funky-response-phrase

(PUP-1549) Use standard reason phrases on webrick
(maint) Acceptance install_utils uses release rpm symlinks

The Puppet::Acceptance::InstallUtils was fiddling with extraneous
parsing trying to pick the current release rpm version from deep in
hierarchy of yum.puppetlabs.com.  Now we make use of the root symlinks.