(PUP-3718) Make defined function handle qualified variable names

The defined function can answer if a variable is defined. There
were however no tests for qualified variable names. The implementation,
when given a qualified name simply tried to lookup the complete name
in its own scope which naturally failed.

This commit adds logic to check if a variable is qualified in the
Scope#exist? method, and then mimics the behavior of a variable
lookup by splitting the name, then looking up the class and its scope
and finally delegating the exist? call to that scope.

This is made somewhat complicated when testing due to the fact how
scopes are wired (to find other names scopes). The test that checks for
the existence of a top scope variable now sets this up as if the main
class (called '') had been evaluated.
(PUP-3521) Fix Puppet's exception swallowing

Fix Puppet's exception swallowing by finding places where an
Exception is rescued and swallowed and making their rescues
more granular.
(PUP-3718) Make it clear that exist?(varname) returns boolean

There was a code path that did not ensure that that the return
from exist?(varname) was a boolean. Now a test is added, and nil
result is always turned into a boolean.

This is primarily done to ensure against leaking values / object
that could be considered thruthy if this code changes. (It would
be harmeless to return nil/false or true as the code stands now,
but this commit makes it explicit that a boolean result is expected.
(maint) Don't test agent on the master for Win/Sol

Windows and Solaris Beaker configs currently test the 'agent' role on
the master, typically an EL 6 or EL 7 machine. This leads to
double-testing, since we already test these platforms elsewhere.

This commit removes the 'agent' role from the master for Windows and
Solaris Beaker configs to speed up testing and reduce false positives
for these agent platforms.
(PUP-659) Fix failing acceptance tests

With this change, some acceptance tests were failing since they
still relied on Puppet searching the local namespace. The tests
have been updated so that they no longer rely on this functionality
since it's no longer supported.
Reapply (PUP-659) Optimize qualified variables

This reverts commit 17caf5e8dd97e34f7633f99ebc627662459d2756.

Since we've determined that the issue around the pull request
this commit was reverting was out of date acceptance tests,
undo the revert and reapply the changes.
Merge pull request #3413 from rji/maint/stable/remove-agent-role-from-master-win-sol

(maint) Don't test agent on the master for Win/Sol
Merge pull request #3414 from hkenney/issue/master/PUP-659_optimize-qualified-variables

Reapply (PUP-659) Optimize qualified variables
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (maint) Don't test agent on the master for Win/Sol

Conflicts:
	acceptance/config/nodes/solaris10.yaml
	acceptance/config/nodes/solaris11.yaml
	acceptance/config/nodes/win2003r2x64-rubyx64.yaml
	acceptance/config/nodes/win2003r2x64-rubyx86.yaml
	acceptance/config/nodes/win2003r2x86-rubyx86.yaml
	acceptance/config/nodes/win2003x64-rubyx64.yaml
	acceptance/config/nodes/win2003x64-rubyx86.yaml
	acceptance/config/nodes/win2003x86-rubyx86.yaml
	acceptance/config/nodes/win2008-rubyx64.yaml
	acceptance/config/nodes/win2008-rubyx86.yaml
	acceptance/config/nodes/win2008r2-rubyx64.yaml
	acceptance/config/nodes/win2008r2-rubyx86.yaml
	acceptance/config/nodes/win2012-rubyx64.yaml
	acceptance/config/nodes/win2012-rubyx86.yaml
	acceptance/config/nodes/win2012r2-rubyx64.yaml
	acceptance/config/nodes/win2012r2-rubyx86.yaml
Merge pull request #3302 from fpringvaldsen/PUP-3521-error-swallowing

(FOR REVIEW) (PUP-3521) Fix Puppet's exception swallowing
(PUP-3754) Better error message when failing to chown log file

Previously, puppet would log an error if it failed to chown a
file-based log destination, but didn't specify what owner/group it tried
to chown to or the path to the file, making it difficult to debug.

This commit changes the error message to include the owner, group and
file path for easier debugging.
Merge branch 'pr/3355'

* pr/3355:
  (PUP-3754) Better error message when failing to chown log file
(PUP-3756) Only chown log file when running as root

Previously, if you specified a log file destination on non-windows
platforms, puppet would attempt to chown the file to the `Puppet[:user]`
and `Puppet[:group]`. However, this will only work if puppet is running
as root.

This commit change the log file destination to only chown when running
as root. It continues to skip the operation on Windows.
(PUP-3268) resource/service/should_not_change_the_system should only run on agents

Use the agents object to more definitely run against the proper
machines.  This test would previously error on windows runs after the agent
role is removed from the master for windows tests.  This change fixes
this issue.
Merge pull request #3415 from er0ck/maint/master/PUP-3268-resource.service.should_not_change_the_system-should_only_run_on_agents

(PUP-3268) should_not_change_the_system should only run on agents
(PUP-3642) Remove environment name from URL path

This commit makes some changes to the indirector network layer
such that the environment name is no longer a part of the main
URL path structure.  This will allow us to have a more finite URL space
and run Puppet in the same webserver with other apps, without
worrying about URL collisions.  Instead, the environment becomes a query
parameter.
Merge pull request #3412 from cprice404/feature/master/PUP-3642-remove-env-from-url-path

(PUP-3642) Remove environment name from URL path
(MAINT) Remove PUPPET_LOADED from Gemfile

Remove the use of the PUPPET_LOADED environment variable from
the Gemfile, as the bug requiring its use has been eliminated by
Puppet Server's upgrade to JRuby 1.7.17.
(maint) Update ruby sha used to build

We've updated the certs included in ruby to access rubygems.org.
Since the website has updated their certs, we were behind, and
installing gems using the provided package of rubygems would fail. This
commit updates the sha of puppet-win32-ruby we are pulling in to include
in the msi build. This will provide the additional certs for use, and
allow people to access rubygems.org via the provided rubygem package.
Merge pull request #3419 from melissaanne/stable

(maint) Update ruby sha used to build