(PUP-1362) (PUP-1775) Use yum check-updates for latest yum packages

Early versions of the yum package provider used `yum list available` to
determine the latest version of packages that were `ensure => latest`.
However the versions of yum available around that time changed the
output formatting of yum, which meant that the parsing code would break
on a regular basis (#836).

Commit 8722e439 resolved this by using the yum python bindings to
interact with yum. This required shipping a python helper script to
provide the interface between Puppet and the python libraries. However
this opened up a host of other issues ranging from what version of
Python is symlinked to '/usr/bin/python', how the yum database is
locked, and so on (PUP-1362, #11380, #16623). In addition changes to
yumhelper.py were very hard to test or reason about since it doesn't
neatly plug into our existing tests.

This commit removes yumhelper.py and replaces the update checks by
calling `yum check-update`. The output format of this command has not
changed since CentOS 4 and works all the way up to RedHat 7 so we should
be able to rely on this for a while.
(PUP-3391) Plugin synced for incorrect environment while agent is resolving environment

Before this commit if an agents environment was changed the plugins from
the initial environment were synced instead of the plugins from the
environment where the node would end up. This would cause problems where
a manifest from one environment would be applied with custom types and
providers from a different environment.

This commit changes the behavior to sync plugins after every environment
resolution. We need to sync the plugins after every environment change
because this action needs to be performed before we can retrieve a
manifest for the node in a particular environment.
(PUP-3591) Refactor get_facts to always return a hash

Configurer#get_facts would return either nil, or a Hash, forcing the
main run_internal method to guard its result. I've changed this to
return an empty hash instead of nil for consistency, allowing us to
remove a bit of duplicate code.
Merge branch 'issue/stable/pup-3591-cherry-pick-fix-from-master' into stable

* issue/stable/pup-3591-cherry-pick-fix-from-master:
  (PUP-3591) Refactor get_facts to always return a hash
  (PUP-3391) Plugin synced for incorrect environment while agent is resolving environment
(PUP-3272) Remove vendored safe_yaml and related patches

safe_yaml is no longer needed since YAML on the network is no longer
supported (slow because of safe_yaml, and unsecure without it).

This also removes the early and eager loading of safe_yaml that
affects startup time of all puppet applications even if they do not use
YAML.
(PUP-3272) Drop (unused) puppet-load

This removes the puppet-load as it relies on using removed formats.
(PUP-3272) Drop support :legacy_query_parameter_serialization

This backwards compatible setting caused resource parameters for queries
to be replaced with arrays containing yaml. This was only needed for
agents <= 3.2 and upgrade policy is that agents must be updated to
latest 3x before moving to 4x.
(PUP-3272) Remove YAML on the network

This removes b64_zlib_yaml, but keeps yaml as a format.
An attempt is made to change yaml to pson for networking - do not know
if that has been achieved.

3 tests are failing.
(PUP-3272) Remove vendored load of safe_yaml
(PUP-3272) Change deprecation warning for YAML on nw to errors

This changes the deprecation warnings about YAML use on the network
to errors. As a consequence tests are updated to reflect the change.
(PUP-3272) Fix broken test

The test was broken as it changed how a body war rendered; rather
than using the body, it always rendered either data or the body as pson
- the intention was to use the raw body.
(PUP-3772) Remove commented out base64 encoded yaml network format

The base64 encoded yaml network format should have been removed.
It was only commented out.
(PUP-3272) Remove safe-yaml parameters fom YAML load

These parameters have no effect when regular YAML is used.
(PUP-3272) Change Status yaml deserialization to support psych

This changes deserialization of a Status instance to use
a custom initialization (based on params hash). The implementation
is in a PsychSupport module to make it more visible and easier to add to
other classes needed the same support.

Since this change is not compatible with 1.8.7, the report_spec test
that depends on this functionality is restricted to not run on Ruby
1.8.7.
(PUP-3272) Remove special treatment of YAML encoded parameters

When it was allowed to pass YAML on the network it was also allowed to
pass parameters that were YAML encoded. The 3x logic had deprecation
warnings in place for these places.

Now in 4x, when YAML is no longer supported, the request parameters are
simply always strings. If someone yaml encodes data and sets it in a
parameter this has no special meaning - it is just a string that happens
to contain yaml (e.g. "--- \n 'foo'\n").

This means that it is now ok to have parameters that look like YAML but
it is not - this could cause problems earlier.
(PUP-3272) Simplify logic where yaml param was special case

Also remove dead comment.
(maint) Change phrasing of error message about Yaml not supported

This changes message from "are not supported" to "is not supported"
(PUP-3272) Remove commented out code
(PUP-3272) Remove check_master_version in indirector/rest.rb

The check was reduced to something that was not meaningful.
(PUP-3272) Remove the setting report_serialization_format

This setting stopped being useful as it should always be set to pson.