(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-1118) Add acceptance test for using directory envs

This checks that an environment that comes from the environmentdir
setting is usable as an environment.
(PUP-1118) Stop using Environment.new

Instead of creating environments directly, we need to go through the
configured environment loaders, otherwise environments can't come from
other places.
(PUP-1118) Fix rdoc1 specs to match changes to rdoc puppet_parser_core

PuppetParserCore was updated to pass environment, known_resource_types;
this just catches up the spec, which runs only on 1.8.7, to match the
changes.
Merge pull request #2306 from zaphod42/feature/master/pup-1118-implement-environment-directory

(PUP-1118) Use directory environments as environments
(maint) Fixing acceptance test failure caused by GH-2293.

We have our own version of "fail" that takes different parameters than Kernel::fail.  This lead to accidentally passing in a backtrace array (what Kernel#fail expects) instead of the original exception object (what Puppet::Util::Errors#fail expects).  This causes a failure when attempting to format the nested exception because it is not the correct type.
(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.