(PUP-2710) For audit only, compare Time objects as strings

Previously, auditing the mtime or ctime properties of a file
on ext4 (or any nanosecond resolution filesystem) when running
under ruby 1.9+ would spuriously report a change on every catalog
run.

This was because the yaml library (or libraries, more on that
shortly) correctly serialize the nanosecond resolution of the Time
object to yaml, *but* on deserialization they produce a Time object
truncated to microseconds. This led to a false inequality operation
leading to the spurious audit messages.

This patch is an unfortunate hack consisting of special-casing
the comparison of Time objects in the audit equality operation.

For context, I also considered alternatives:
* Monkey-patching the Time object == method to ignore nanoseconds.
  But this would affect all Time objects and could have undesired
  consequences.
* Monkey-patching the yaml library to correctly deserialize. But
  this got messy because there are several different yaml libraries
  that may be involved.
* Intercepting the serialization in Puppet::Util::Yaml, but this
  would mean discarding nanoseconds for all serialization of Time
  objects to yaml.

In the end, this spot fix seemed like the least evil solution.
(PUP-2364) Use the the puppet config vardir setting

instead of the beaker variable puppetvardir.  This change, while
pleasing in and of itself, was needed for testing on AIX.  The vardir
used there by puppet is different, and Beaker does not track a separate
set of defaults for AIX.
Merge branch 'pup_2364_spike_vars' into stable

* pup_2364_spike_vars:
  (PUP-2364) Use the the puppet config vardir setting
(PUP-2650) Add :array setting type
(maint) Move duplicate code in /lib/puppet/provider/service/freebsd.rb into single method

Prior to this commit, service_name and rcvar_name contained duplicate
code in lib/puppet/provider/service/freebsd.rb that accomplished the
same thing. This commit moves this code into a single method that
can be invoked from both service_name and rcvar_name.
(PUP-2650) Add disable_warnings setting

This commit adds a new setting that allows users to disable different
classes of warnings. Right now the only supported type of warning that
can be disabled is 'deprecations'.
(PUP-2650) Defer deprecation warnings until we can read disable_warnings

The difficulty with using the value of the disable_warnings setting to
adjust deprecation_warnings issued for other configuration settings is
that we need settings to finish initialization first.  Otherwise
deprecation_warnings become dependent on the order of setting
initialization.  To account for this, I added a deprecated attribute to
base_setting, allowing us to mark any setting as deprecated completely
or allowed_on_commandline.  And the code in settings to issue
deprecations now tracks deprecated settings as they are configured, and
then issues the deprecations after the application is initialized.
Merge branch 'pull-2740' into stable
Merge branch 'stable'

Conflicts:
	lib/puppet/defaults.rb
Merge pull request #2723 from briancain/maint/master/consolidate-methods

(maint) Move duplicate code in /lib/puppet/provider/service/freebsd.rb i...
(PUP-2705) Use source permissions for fact pluginsync

The fix for PUP-1986 caused the agent to no longer apply source
permissions of pluginsync'ed content to the downloaded files. This
caused a regression with external executable facts, since they must be
executable on the agent in order for facter to execute them.

This commit re-enables using source permissions during fact pluginsync,
while continuing to ignore them for module pluginsync.
(maint) Test downloader behavior, not implementation

Test the behavior of the Puppet::Configurer::Downloader#file method, instead
of how it constructs a file resource.
Merge branch 'pr/2715'

* pr/2715:
  (maint) Test downloader behavior, not implementation
  (PUP-2705) Use source permissions for fact pluginsync
Merge branch 'pr/2715' into stable

* pr/2715:
  (maint) Test downloader behavior, not implementation
  (PUP-2705) Use source permissions for fact pluginsync
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
Merge pull request #2727 from kylog/issue/pup-2710/audit-comparison-should-compare-strings

(PUP-2710) For audit only, compare Time objects as strings
(PUP-2710) Check that 'b' is a Time object before accessing tv_sec method

The initial fix checked that 'a' was a Time object but not that
'b' was a Time object - incorrectly reasoning that the code would
always compare like objects. However, when a property was previously
absent, the comparison might be between a Time object and the :absent
symbol. The fix is thus to check that both sides of the equality
comparison are Time objects first.
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-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