(PUP-1807) Change empty string to be "truthy"

An empty string is now interpreted as a "true" value. It used to
represent a false value.

This representation is only in the future evaluator. Values are still
transformed when calling the 3x function API (it expect undef to be
encoded as empty string). This also takes place when transforming to the
3x catalog.
(PUP-1807) Add tests cases for undef equality checks

This adds checks that future evaluator treats '' != undef.
(It already did this, but tests were missing).
(maint) Remove commented out code
(maint) Use same prioritizer throughout catalog

Under normal system runs, there wasn't any problem with the prioritizer
being used, since the Puppet::Resource::Catalog created it and passed to
all of the correct places. However, the testing methods in
PuppetSpec::Compiler ended up lying to the user about the prioritizer
that could be used. The prioritizer that was passed in was not the one
actually used by the catalog for constructing the relationship graph.
This was because the Puppet::Parser::Catalog used the one it had
internally. The answer is to have the Puppet::Parser::Catalog act as one
possible factory of prioritizers, and pass the prioritizer around as it
needs it. This allows the tests to then pass in the correct prioritizer
and use it consistently throughout.
(PUP-2635) use generate instead of eval_generate to purge ssh keys

The generating of ssh_authorized_keys resources for purging is implemented
in Puppet::Type::User#eval_generate. The resources are added as the graph
is being traversed.

This exhibits unexpected behavior under certain circumstances. Specifically,
generated keys can be considered already absent (and hence in sync) if there
is a package resource in the catalog. The error disappears when the
functionality is moved from the eval_generate hook in favor of the generate
hook.

The reasons for the wrong behavior is an issue between the transaction code
and the eval_generate mode of operation. During evaluation, the transaction
will call its #prefetch_if_necessary hook for each resource in turn, which
relies on #resources_by_provider. The latter has a cache and misses all
resources that are added using eval_generate after the initial method call.
As a result, those resources are not passed to the provider for prefetching
and thus remain in an uninitialized state, just as though the resource
would not exist on the target system (ensure => absent). They are therefor
not eligible for syncing/purging.
(PUP-2635) integration test for the purging of authorized ssh keys

Compile manifests that purge keys from a specific file and verify
their effect. Adds a test that detects the eval_generate problem
fixed in this branch.
Merge pull request #2707 from ffrank/ticket/3.6.1/PUP-2635-issues-with-ssh-key-purging

(PUP-2635) use generate instead of eval_generate to purge ssh keys
(PUP-2635) Skip this test on windows
Merge pull request #2739 from zaphod42/maint/stable/allow-prioritizer-to-be-used-in-tests

(maint) Use same prioritizer throughout catalog
Revert "Merge pull request #2589 from daenney/add-ensure-type-logging"

This change added a lot of debugging information to every property
change made, which isn't needed for normal operation and clutters up the
output. In addition properties can define `#is_to_s` and `#should_to_s`
which can completely change how properties output change, so this change
by itself is somewhat misleading:

    [root@master puppet]# bundle exec puppet resource file /root mode=0600 owner=vagrant group=vagrant
    Notice: /File[/root]/owner: owner changed 'root' of type Fixnum to 'vagrant' of type Fixnum
    Notice: /File[/root]/group: group changed 'root' of type Fixnum to 'vagrant' of type Fixnum
    Notice: /File[/root]/mode: mode changed '0550' of type String to '0700' of type String
    file { '/root':
      ensure => 'directory',
      group  => '500',
      mode   => '700',
      owner  => '500',
    }

In this specific case https://github.com/puppetlabs/puppet/blob/3.6.1/lib/puppet/type/file/owner.rb#L34-L41
overrides the default is_to_s behavior, which indicates that this cannot
be done as a default and in fact should be up to the type author to
modify `#is_to_s` and `#should_to_s` as needed during debugging.

This reverts commit f89f1a536e22a04dc80a3b1c4c2d729693ce6b42, reversing
changes made to 34f55e1840b5dadadb84f95391a842a7b50a6540.
Merge branch 'revert-pup-2369'
(PUP-2364) Fix usage of puppet vardir setting Win2003

 - Previous acceptance tests were using the Beaker puppetvardir
   setting.  On Windows, this uses cygpath to resolve to an 8.3
   style name that can be used in shell commands without quoting.
   By changing the acceptance tests to use the Puppet configuration
   value instead, a Windows long file name will be used instead of
   the 8.3 style. This does not affect any OS newer than Windows
   2003R2, because the vardir path does not contain spaces.  On
   Windows 2003R2, vardir is rooted in C:\Documents and Settings\
   which means it must be quoted when using it in shell commands
   within Cygwin.  Verified that other shells like Bash (on Linux
   and AIX) can still work properly quoted, and made changes to
   the acceptance tests to quote when in doubt.
 - Fixed string interpolation in acceptance test 6541 for invalid
   file bucket files.
Merge pull request #2743 from Iristyle/ticket/stable/PUP-2364-fix-vardir-Windows-2003R2

(PUP-2364) Quote vardir to work on Windows 2003R2
(PUP-2356) Add additional yumrepo options

This change introduces some new yumrepo options:
 * gpgcakey
 * retries
 * throttle
 * bandwidth
 * mirrorlist_expire

- Added also the possibility to specify dhm units and never as value for
metadata_expire option
(PUP-837) FFI Puppet::Util::Windows::SID

 - FFI Win32 API functions IsValidSid, ConvertSidToStringSid,
   ConvertStringSidToSid and LocalFree
 - Unfortunately ConvertSidToStringSidW allocates a buffer and does not
   return it's length, therefore a new helper function has been added to
   FFI::Pointer that will return a string up to a maximum length. If the
   NULL terminator is encountered prior to the max size, no additional
   memory is read.  This is not ideal, but slightly more secure than the
   previous implementation, which picked a buffer size, read all memory
   to the buffer, then called .strip on what remained.  The helper
   function also imposes a maximum of 512 UTF16 characters (1024 bytes)
 - Presume a maximum SID string length of 184 characters when formatted
   per http://stackoverflow.com/a/1792930
 - Add additional FFI MemoryPointer aliases for :wchar, #read_wchar
 - Remove any dependenc on mixins Windows::Security, Windows::Memory or
   Windows::MSVCRT
 - Updated affected callsites in security.rb to properly use or create
   FFI::Pointer when dealing with IsValidSid and sid_ptr_to_string. Also
   updated a couple of existing "old school" calls that are expecting
   addresses instead of FFI::Pointer objects.  This is a partial
   refactor until work continues with making security FFI compatible.
(maint) Windows SID variable naming style

This is a minor change to be more specific with the naming of the variable
'string' to 'string_sid' for methods in Puppet::Util::Windows::SID.
Merge branch 'pull-2577'
(PUP-2364) Correct host variable reference

A change in the previous fix to this test put in double quotes so that
the embedded expression would actually interpolate, which exposed the
fact that it was referencing 'host' rather than the 'agent' variable
that is actually in scope.  Fixed that so that it can interpolate and run.
Merge branch 'ticket/master/PUP-837-FFI-Windows-SID'

* ticket/master/PUP-837-FFI-Windows-SID:
  (maint) Windows SID variable naming style
  (PUP-837) FFI Puppet::Util::Windows::SID
Merge branch 'stable'

* stable:
  (PUP-2364) Correct host variable reference
  (PUP-2364) Fix usage of puppet vardir setting Win2003
  (PUP-2635) Skip this test on windows
  (PUP-2635) integration test for the purging of authorized ssh keys
  (PUP-2635) use generate instead of eval_generate to purge ssh keys
  (maint) Use same prioritizer throughout catalog