(#15264) Custom title patterns can fail cryptically.

If a type uses a composite namevar and none of the supplied title
patterns matched, #parse_title would return a nonsensical array value.
This would lead to unexpected behavior like output like:

    /usr/lib/ruby/1.8/puppet/puppet/resource.rb:235:in `to_hash': undefined method `merge' for #<Array:0x007ffba3d80d78> (NoMethodError)

If a type overrides the title_patterns method and nothing matched,
there's no possible way to recover from this. To prevent misleading
errors from being thrown, this patch raises an error if none of the
title patterns matched.
Add additional commits to CHANGELOG missed in 2.7.19rc1
Use Win32 API atomic replace in `replace_file`

The changes to enable Windows support in `replace_file` were not actually
complete, and it didn't work when the file didn't exist - because of
limitations of the emulation done on our side, rather than anything else.

Windows has a bunch of quirks, and Ruby doesn't actually abstract over the
underlying platform a great deal.  We can use the Windows API ReplaceFile, and
MoveFileEx, to achieve the desired behaviour though.

This adds even more conditional code inside the `replace_file` method to
handle multiple platforms - but it really isn't very clean.  Better to get
this working now, then refactor, though.

Cherry pick of: 73e302bbf5ab4a6c5513a39070e2c907542775ae

Conflicts:

	lib/puppet/util.rb
	spec/unit/util_spec.rb
(#15471) Ensure non-root can read report summary

The security fix for locking down the last_run_report, which contains
sensitive information, also locked down the last_run_summary, which does
not contain sensitive information. Unfortunately this file is often used
by monitoring systems so that they can track puppet runs. Since the
agent runs as root and the monitoring systems do not, this caused the
summary to become unreadable by the monitoring systems.

This commit returns the summary to being world readable which undoes
part of the change done in fd44bf5e6d0d360f6a493d663b653c121fa83c3f
(#15471) Fix setting mode of last_run_summary

The writlock function didn't work with setting the mode on the
last_run_summary file. This backports some of the work in commit
7d8fd144949f21eff924602c2a6b7f130f1c0b69. Specifically, the changes
from using writelock to replace_file for saving the summary file. This
builds on top of the backport of getting replace_file to work on
windows.
Merge pull request #892 from adrienthebo/bug/2.7.x/15264-fail_on_no_matching_title_patterns

Bug/2.7.x/15264 fail on no matching title patterns
Fixed #11686 - Updated documentation for exec timeout

The exec timeout of 300 seconds was previously not mentioned in the
exec type documentation. This commit makes the default value clear.
Merge pull request #1007 from nfagerlund/tickets/master/11686

Fixed #11686 - Updated documentation for exec timeout
Merge remote-tracking branch 'andy/ticket/2.7rc/15471_last_run_report_only_readable_by_root' into 2.7rc

* andy/ticket/2.7rc/15471_last_run_report_only_readable_by_root:
  (#15471) Fix setting mode of last_run_summary
  (#15471) Ensure non-root can read report summary
  Use Win32 API atomic replace in `replace_file`
Merge remote-tracking branch 'upstream/2.7rc' into 2.7.x

* upstream/2.7rc:
  (#15471) Fix setting mode of last_run_summary
  (#15471) Ensure non-root can read report summary
  Use Win32 API atomic replace in `replace_file`
  Add additional commits to CHANGELOG missed in 2.7.19rc1
(#15521) Convert to using host stub wrapper

This patch converts the module acceptance code to using the host stub wrapper
now provided in puppet-acceptance: `stub_forge_on`.

This will allow us to change the forge host we are stubbing dynamically as
apposed to manually changing it everywhere in acceptance code.

This also changes the cases where we have teardown code to use the new
`teardown` block, and to use `rm -rf` for file cleanup to avoid puppet backup
duplication issues.
Update CHANGELOG, conf/redhat/puppet.spec for 2.7.19rc2
Merge branch '2.7rc' into 2.7.x
Don't mask NoMethodErrors

This rescue was masking a bug in a provider (involving calling `[]` on
`nil.NilClass`) with a misleading error message.  The new code asks
permission rather than begging forgiveness, but is more specific to the
problem being detected.
(#10915) Fix tests to work with new parameter checking

The change to how the property checks if the provider can be called
caused several tests to fail because they were not using providers that
were able to properly report `respond_to?`. This fixes those tests. In
the case of the host_spec.rb I was able to convert away from a mock, but
in the mount_spec.rb the mock had to mock `respond_to?` since the
interaction with the provider seems to be more complicated than I can
unravel.
(#10915) Add test for provider throwing NoMethodError
Merge branch 'bug/2.7.x/10915-misleading-error-messages' into 2.7.x

* bug/2.7.x/10915-misleading-error-messages:
  (#10915) Add test for provider throwing NoMethodError
  (#10915) Fix tests to work with new parameter checking
  Don't mask NoMethodErrors
(#14515) Tests fail with mocha 0.11.4

Prior to this commit, these tests only worked with mocha 0.10.5 because
the tests were broken and trying to stub methods on nil, which mocha
0.11.4 no longer allows. After this commit, these tests work with both
mocha 0.10.5 and 0.11.4.
Fix stubbing on nil in some specs
Don't require mocha in spec_helper

Rspec will automatically require mocha, and it knows how to do it properly
depending on the mocha version. This eliminates spurious deprecation warnings
about how mocha is loaded.