Merge pull request #944 from nfagerlund/maint/2.7.x/node_clean_help

Maint: Fix borked help/man output for node clean
Maint: Large or complex HEREDOC strings w/ no interpolation should be single-quote type

We were getting accidental interpolation of \t and \n sequences in the desc string
for the file type's content parameter. To avoid this, any description string which:

* Does not deliberately interpolate values from the surrounding code

AND

* Is long enough or complex enough that it can't be read in a single glance

...should probably be the single-quoted type of HEREDOC instead of the
double-quoted type. This commit changes a bunch of HEREDOCs that match this
description.
(#15560) Refactor LogonUser

Previously, the ADSI utility code validated a user's password by
attempting a network logon session as that user. However, the ability to
create a logon session and use the resulting process token is something
that is generally useful, in say the next commit.

This commit refactors the call to `LogonUser`, adds a helper method for
checking the validity of a password, and modifies the ADSI code to call
it.

The call to `LogonUser` remains the same except that the MSDN docs say to
specify a '.' as the domain for local user accounts, and we null out the
token handle prior to calling LogonUser instead setting it to
"\x20\x20\x20\x20" which could be interpreted as a valid handle.
(#15560) Create the user's profile if managehome is true

Previously, specifying `managehome => true` on a user resource would have
no effect even though the Windows ADSI user provider claimed to support
the `manages_homedir` feature.

On Windows, a user's homedir (profile) is not created when the user
account is created, but when the user logs in for the first time. As
a result, if Puppet created the user account, and then tried to apply
another resource that depended on the existence of the user's home
directory, such as ssh keys, then Puppet would fail.

This commit changes the Windows ADSI user provider such that if
`managehome` is enabled, then it will load and unload the user's profile.
This will create the profile if necessary and apply the appropriate DACL
to the profile and subdirectories.

This commit follows the Microsoft recommended way of creating a user
profile: http://support.microsoft.com/kb/196070/en-us
(#16058) Add setting to configure catalog cache

This adds a setting to configure the cache terminus used by the catalog
indirection. The two reasonable values at this time are "yaml" and "pson".
(#16058) Set pson as default catalog cache format

Serializing as pson appears to be faster, so set it as the default. Yaml is
still available by setting catalog_cache_terminus.
Update CHANGELOG, version.rb, redhat.spec for 3.0.0rc5
Add a terminus setting type

The terminus setting type makes it possible to set a terminus to nil by
providing an empty string in the configuration. It also converts the terminus
name to a symbol automatically.

This required making all terminus settings consistently use symbols.
Whitespace only cleanup
(Maint) Stop watchr from reading non-existent spec.opts

Without this patch the watchr auto-testing script attempts to read the
spec.opts file.  This is a problem because the file no longer exists in
the repository which causes watchr to fatally error out.

This patch fixes the problem by simply removing the code replacing it
with a comment to use a personal ~/.rspec file instead of the project
rspec options file.
(#15193) Document how to use the static compiler

Without this patch the magic nature of the `Filebucket[puppet]` resource
and the expected behavior of the puppet agent obtaining file content
from the server is not documented anywhere.  This is a problem because
it is not clear how to configure the agent in a manner that does not
produce errors when using the static compiler.

This patch fixes the problem by providing a more in-depth description of
the high-level approach the static compiler takes.  In addition, the
specific configuration of `fileserver { puppet: server => $server, path
=> false }` is documented in the README_DEVELOPER.
Document the different forms of catalogs to help test writers

Without this patch it was not clear to me that the static compiler
operates primarily on a resource catalog.

This was a problem because I spent considerable amounts of time trying
to figure out the difference between `resource[:source]` returning
`"puppet:///..."` inside of
`Puppet::Resource::Catalog::StaticCompiler#find` when running `puppet
apply` and `resource[:source]` returning `["puppet:///..."]` (an array)
when inside of `#find` from the spec test.

When testing catalog terminii the resource form of the catalog should be
created instead of the RAL form.

This patch addresses the problem by providing a description of the
difference between a resource catalog and a RAL catalog and when it is
appropriate to use each.
(maint) commit the complete commands at the end.

The provider.flush() comamnd was missing.
(#15193) Add spec test coverage for static compiler

Without this patch there is no test coverage for the static compiler
terminus.  This is a problem because internal changes to the indirector
break the expected behavior of the static compiler and we have no
automated way to discover the broken behavior.

This patch adds spec test coverage for the static compiler's find
method.  This covers the most common use case of the static compiler
where by file resources with source parameters are modified in the
resource catalog.

The patch does not include test coverage for recursive file resources.

The approach taken stubs the underlying compiler terminus and produces a
fake resource catalog for the static compiler to operate on.  The
fileserver metadata API is also mocked to break the dependency on a real
fileserver.
(#15193) Fix StaticCompiler#store_content

Without this patch the static compiler's store_content method improperly
calls the indirector in a way that produces fatal exceptions preventing
catalog compilation.

These errors take the form of:

    NoMethodError: undefined method `find' for
    Puppet::FileServing::Content:Class

This patch fixes the problem by sending the messages to the right
places for Puppet 2.7.x and Puppet 3.x
Merge branch 'bug/2.7.x/15193_fix_static_compiler' into 2.7.x

* bug/2.7.x/15193_fix_static_compiler:
  (#15193) Fix StaticCompiler#store_content
  (#15193) Add spec test coverage for static compiler
  Document the different forms of catalogs to help test writers
  (#15193) Document how to use the static compiler
  (Maint) Stop watchr from reading non-existent spec.opts
  Whitespace only cleanup
(#16058) Add setting to configure catalog cache

This adds a setting to configure the cache terminus used by the catalog
indirection. The two reasonable values at this time are "yaml" and "pson".
(#16058) Set pson as default catalog cache format

Serializing as pson appears to be faster, so set it as the default. Yaml is
still available by setting catalog_cache_terminus.
Add a terminus setting type

The terminus setting type makes it possible to set a terminus to nil by
providing an empty string in the configuration. It also converts the terminus
name to a symbol automatically.

This required making all terminus settings consistently use symbols.

Paired with: Andy Parker <andy@puppetlabs.com>
Merge branch 'ticket/3.x/16058-pson-catalog-cache' into 3.x

* ticket/3.x/16058-pson-catalog-cache:
  Add a terminus setting type
  (#16058) Set pson as default catalog cache format
  (#16058) Add setting to configure catalog cache