(#15989) Allow setting arity on functions

The arity value works the same way as for blocks in Ruby.
(#15989) Set arity on functions

Set the arity on builtin functions.
(#15989) Tests for function arity

Test that setting arity on functions work as it should.
(#4695) Puppet should not reset locale for services

Don't reset locale when starting services, we don't parse their output
so there is no need.

This avoids having different locales for services depending on if they
are started on boot or started by puppet.
Removing -e options from pip provider.

-e causes a few problems with puppet:

1. it tries to install to /root/src.
2. It makes the items editable, which isn't useful.
3. reapplying puppet will cause pip to re-install.

Removing -e should help.
(#17458) Load 'puppet' at the right time

Previously the Puppet::Util.which method tried to compensate for the
puppet.rb file not being loaded at the right time by trying to load it
itself. When a performance improvement was added (commit 20efe94) to
check if this needed to be done it broke the codepath for executing
external puppet-* commands.

This commit fixes this by requiring 'puppet' at the right place in the
entry point (Puppet::Util::CommandLine) and removing the workaround in
Puppet::Util.which.

Paired-with: Josh Cooper <josh@puppetlabs.com>
Merge branch 'issue/2.7.x/17458-puppet-fall-down-go-boom' of git://github.com/zaphod42/puppet into 2.7.x

* 'issue/2.7.x/17458-puppet-fall-down-go-boom' of git://github.com/zaphod42/puppet:
  (#17458) Load 'puppet' at the right time
Maint: Clarify that the managehome parameter will delete a home directory

Users have sometimes been surprised that managehome will delete a home
directory when removing a user. This commit makes that explicit.
Merge pull request #1265 from nfagerlund/clarify_managehome

Maint: Clarify that the managehome parameter will delete a home director...
Make spec_helper manage tmpdir.

This adds management of the ENV[TMPDIR] when running rspec tests using
spec_helper. Before tests are being run, a temporary directory is
created under the current tmpdir. This temporary directory is then set
as the ENV[TMPDIR]. 

After all tests have been run, this temporary directory is removed.
The directory is created with the prefix "rspecrun" to easily identify
it in case the spec testing crashes before having cleaned up.
(maint) Fix hiera_include spec tests

Without this patch applied, the hiera_include function spec tests are
not examples of actual behavior.  In the spec tests the stubbed methods
would return an empty array, which would then be forwarded straight away
to the include parser function.  The example did not have the
expectation that this would raise an error.

This behavior is a problem because adding arity checking to the
functions becomes more difficult if theses examples are not
demonstrating exepcted behavior.  Instead, the change to check arity
causes these examples to fail unexpectedly.

This patch fixes the problem by setting the expectations of the actual
behavior of the hiera_include functions more accurately.  An empty array
is no longer returned from the stubbed Hiera behaviors.  This patch
causes us to expect the system to take exception with trying to include
a non-existent class.
Merge branch 'maint/3.0.x/fix_hiera_include_specs' into 3.0.x

* maint/3.0.x/fix_hiera_include_specs:
  (maint) Fix hiera_include spec tests
Merge branch '3.0.x'

* 3.0.x:
  (maint) Fix hiera_include spec tests
  Maint: Clarify that the managehome parameter will delete a home directory
Merge branch 'dalen-function_arity'

* dalen-function_arity:
  (#15989) Tests for function arity
  (#15989) Set arity on functions
  (#15989) Allow setting arity on functions
Merge branch 'dalen-service_locales'

* dalen-service_locales:
  (#4695) Puppet should not reset locale for services
(#17361) Re-enable agent forking for catalog run

Commit 6812ee9fc51f327f3a74fc6a6c0eefd9758d0134 introduced agent forking as a
means of controlling the persistent heap size of the Puppet daemon. This
functionality was inadvertently disabled in the conflicting merge commit
23a1a17bebaadbb9b3a1611f34ae46d06b531136.  This is a problem since the agent
fails to utilize this memory-saving code path.

This patch alters Puppet::Agent.initialize to include should_fork as an
additional argument.  Puppet::Application::Agent and Puppet::Run were also
updated to reflect the new method signature.  The agent is instantiated with
should_fork enabled during normal operation.  For --onetime runs and when
instantiated via "puppet kick", should_fork disabled.  In order to preserve the
Puppet::Agent.initialize API for any external users, should_fork has a default
value of true.

Affected unit tests have been updated to reflect the expected forking behavior.
Merge branch 'fix/3.0.x/daemon_forking' into 3.0.x

* fix/3.0.x/daemon_forking:
  (#17361) Re-enable agent forking for catalog run
Merge branch '3.0.x'

* 3.0.x:
  (#17361) Re-enable agent forking for catalog run
(maint) Add expectation pip does not use -e flag

Without this patch we don't have an automated way to validate the
expectation that the pip package provider does not execute with the `-e`
flag present.

This patch makes this expectation explicit and automatically verifiable.
Merge branch 'davedash-patch-1'

* davedash-patch-1:
  (maint) Add expectation pip does not use -e flag
  Removing -e options from pip provider.