(maint) Windows failing spec fixes

 - The usage of Dir.getwd in tests has been simplified to
   File.expand_path to properly handle mixed case CWD
 - util_spec.rb ensures 'FOO' Env var cleared before test starts
 - Windows SID checks should be performed as a regex match to
    properly handle all accounts starting with S-1-5-*, which denotes
    accounts with an identifier authority of SECURITY_NT_AUTHORITY
    instead of hardcoding S-1-5-32-544, the Administrators group
(maint) Changing rescue of Exception to StandardError

Rescuing exception is in general a bad practice and can cause undesired behaviors.

A detailed discussion about this can be found here: https://github.com/puppetlabs/puppet/pull/1925#discussion_r6529813
(#4506) Don't serialize transient vars in Puppet::Resource

When serializing Ruby objects to YAML, Procs may be serialized that
cannot be deserialized. Given the following example:

    YAML.load(YAML.dump lambda { "hi" })

A TypeError is raised with the message "allocator undefined for Proc".

Commit e161cbc introduced a new instance variable to Puppet::Resource,
`@rstype`, which was the serialized resource_type for the given object.
When a Puppet::Resource object was round tripped from YAML the
deserialization would fail with the above TypeError. Using Puppet's
built in deserialization (EG `Puppet::Resource.convert_from('yaml', serialized_data)`)
would work, but directly parsing the YAML would fail.

To resolve this an explicit list of instance variables is specified for
serialization, so instead of trying to serialize everything we only
serialize the things we need.
(#22665) mounts should autorequire parent mounts

Given two mount points:

    mount { "/var/log":
      # ...
    }

    mount { "/var":
      # ...
    }

The mount '/var/log' should autorequire '/var' so that the child mount
is not masked by the parent mount.
(#22643) Document the file_metadata endpoint.

This patch documents the file_metadata endpoint (a find operation)
and the file_metadatas endpoint (a search operation).  It includes a
json schema for the returned file_metadata object, and spec tests
for validating some variants of file metadata against that schema.
(maint) Remove constant and requires now provided in spec_helper
(maint) Factor a duplicated constant up to spec_helper
Merge pull request #1952 from jjulien/fix_exception

(maint) Changing rescue of Exception to StandardError
Merge pull request #1967 from kylog/maint/one-more-fixup-for-already-initialized-constant-warning

Maint/one more fixup for already initialized constant warning
Doc cleanup on create_resources example

The two items in the hash must be separated by a comma and group isn't a valid parameter to the user resource.
(doc) Merge branch 'nibalizer-patch-1' into stable

* nibalizer-patch-1:
  Doc cleanup on create_resources example

Documentation only update, merging into stable.
Merge branch 'stable'

* stable:
  Doc cleanup on create_resources example
(#22617) In Augeas onlyif, compare number strings numerically

Without this patch applied, onlyif comparators <, >, <=, and >= always
do string comparisions, even when the strings are numbers.  This
makes it impossible to enforce relative policy, such as:

    onlyif => 'get PASS_MAX_DAYS > 90',

in login.defs, for example.  If PASS_MAX_DAYS had the value 120, the
onlyif would evaluate false (not need-to-run). See ticket for more details.

Without this patch, onlyif uses string comparison, such that 120 < 90.

This patch converts strings to integers and uses numeric comparison
when both operands of the relative comparator are valid numbers.

This patch also fixes another bug that isn't reported in a ticket, namely
that the parser erroneously converts ">=" to ">" and "<=" to "<".
(#22772) Fix test for saving empty data

This test was failing due to a bug in the test, which didn't show up because
it was checking for too broad of an error.
(#22772) Allow a PUT with an empty body
(#22772) Add error checking to yaml format

This will raise a FormatError if asked to intern invalid YAML instead of an
unintelligible ruby error.
Merge pull request #1949 from adrienthebo/ticket/master/4506-define_puppet_resource_yaml_properties

(#4506) Don't serialize transient vars in Puppet::Resource
Merge pull request #1935 from adrienthebo/issue_22665-require_mount_parents

(#22665) mounts should autorequire parent mounts
Merge pull request #1969 from pcarlisle/ticket/22772-empty-filebucket-save

Fix saving empty files to filebucket
Merge branch 'stable'

* stable:
  (#22772) Add error checking to yaml format
  (#22772) Allow a PUT with an empty body
  (#22772) Fix test for saving empty data