Merge pull request #835 from domcleal/tickets/3.x/14378

(#14378) Skip context-based optimisation for complex expressions
(Maint) Fixed up acceptance tests for pluginsync on windows

The pluginsync acceptance tests were not using the right path separator
and directory ownership on windows. By using the values on the host we
can make sure that the setup is done correctly on both linux and
windows.
Merge pull request #890 from zaphod42/maint/3.0rc/pluginsync-tests-on-windows

Maint/3.0rc/pluginsync tests on windows

This was done with the help of Josh Cooper.
Fix Puppet::Util.execute is deprecated warning

Without this patch applied the 3.0rc branch gives this warning when a
plugin sync file has changed:

    jeff@pe-debian6:~$ puppet agent --test
    Info: Retrieving plugin
    Warning: Puppet::Util.execute is deprecated; please use Puppet::Util::Execution.execute
       (at /workspace/src/puppet/lib/puppet/util/diff.rb:14:in `diff')
    /File[/home/jeff/.puppet/var/lib/puppet/cloudpack.rb]/content:
    --- /home/jeff/.puppet/var/lib/puppet/cloudpack.rb      2012-06-28 03:40:01.000000000 -0700
    +++ /tmp/puppet-file20120628-1955-99huz5-0      2012-06-28 03:46:39.000000000 -0700
    @@ -1,5 +1,4 @@
     require 'tempfile'
    -require 'rubygems'
     require 'guid'
     require 'fog'
     require 'net/ssh'

This patch fixes the issue by calling the recommended method in the
deprecation warning.
Merge pull request #895 from jeffmccune/fix/3.0rc/diff_warning

Fix Puppet::Util.execute is deprecated warning
Fix spec test failures from diff warning

I was bad and made a change to the execution behavior of diff without
bothering to update the spec tests.  This patch fixes the failing spec
tests to match the new expectation that Puppet::Util::Execution.execute
is used instead of Puppet::Util::Diff#execute as was previously used.
Merge branch 'fix/3.0rc/diff_warning_specs' into 3.0rc

* fix/3.0rc/diff_warning_specs:
  Fix spec test failures from diff warning
(#15202) Make puppet module install create parent directories

Without this patch, the puppet module install command will fail when run
as a normal user account without a ~/.puppet directory.

The error is:

    $ puppet module install puppetlabs-cloud_provisioner
    Preparing to install into /Users/jeff/.puppet/modules ...
    Error: Could not install module 'puppetlabs-cloud_provisioner' (latest)
      Directory /Users/jeff/.puppet/modules does not exist

This is a problem because it adds friction to the process of getting started
with Puppet.

This patch fixes the problem by creating the directory if the path does not
already exist.  If the path does exist, then the error is still thrown, but has
been modified slightly to provide helpful next actions.  The error when the
path exists as a non-directory looks like:

    Error: Could not install module 'puppetlabs-cloud_provisioner' (latest)
      The reason is path '/Users/jeff/.puppet/modules' is not a directory.
      A potential solution is `mkdir -p '/Users/jeff/.puppet/modules'`.

This patch also handles the situation where the target path does not exist but
the effective uid of the puppet process does not have access to create the
directory.  The error message in this case looks like:

    Error: Could not install module 'puppetlabs-cloud_provisioner' (latest)
      Permission is denied when trying to create directory '/Users/jeff/.puppet/modules'.
      A potential solution is to check the ownership and permissions of parent directories.
(#15202) Fix acceptance tests for creating non-existance directories

The acceptance tests were failing after we added the new functionality
for creating dependent directories during module installation.

This patch fixes that, by remedying the tests to make this situation
acceptable instead of expecting an error and a non-zero exit code.
(#15202) Handle paths with files in them

When creating the install path, if there is a file in the way then there
was an unhandled exception. This commit extracts out a install directory
handling code for ease of testing and adds handling for this case.

This class excapsulates the logic of preparing the installation
directory for modules. As we find more operations on the installation
directory we should try to move them to this class.
(maint) Add trailing newlines to all files
(maint) Standardize on /usr/bin/env ruby -S rspec

Without this patch some spec files are using `ruby -S rspec` and others
are using `rspec`.

We should standardize on a single form of the interpreter used for spec
files.

`ruby -S rspec` is the best choice because it correctly informs editors
such as Vim with Syntastic that the file is a Ruby file rather than an
Rspec file.
Merge pull request #903 from jeffmccune/maint/3.0rc/fix_spec_bang_lines

(maint) Standardize on /usr/bin/env ruby -S rspec
Merge commit '2.7.17' into 3.0rc

* commit '2.7.17':
  Updating CHANGELOG, lib/puppet.rb, conf/redhat/puppet.spec for Puppet 2.7.17
  (maint) Add symlink stub to gentoo service provider spec
  Add comment to upstart provider explaining exclusion of 'wait-for-state'
  Upstart code cleanup, init provider improvement
  Add spec test for network-interface-security
  Add basic service resource test to upstart acceptance
  Handle network-interface-security in upstart
  Add exclude list to upstart provider
  (#15027, #15028, #15029) Fix upstart version parsing
  (maint) Add --test to puppet run
  Update CHANGELOG, conf/redhat/puppet.spec for 2.7.16
  Update facter dep to reflect epoch 1

Conflicts:
	CHANGELOG
	acceptance/tests/helpful_error_message_when_hostname_not_match_server_certificate.rb
	conf/redhat/puppet.spec
	lib/puppet.rb
	spec/unit/provider/service/upstart_spec.rb
(maint) Remove duplicate key in requestdir default

This is really small patch that simply removes a duplicate key value
pair from the requestdir default hash.
Merge branch '3.0rc' of github.com:puppetlabs/puppet into 3.0rc
Merge pull request #902 from zaphod42/bug/3.0rc/15202-puppet-should-create-module-directories

Bug/3.0rc/15202 puppet should create module directories
(Maint) Add tags to .gitignore for ctags
(Maint) Fix Could not find Puppet Face :foo

We're showing a symbol to the user through the use of inspect.  This
isn't cool since this isn't actually the name of the face or the
subcommand.

This patch uses .to_s instead of .inspect
Merge branch 'maint/3.0rc/do_not_show_symbols_to_users' into 3.0rc

* maint/3.0rc/do_not_show_symbols_to_users:
  (Maint) Fix Could not find Puppet Face :foo