Merge pull request #671 from pcarlisle/ticket/2.7.x/13299-bad-disabled-error-message

Fix disabled error message
Put back require 'puppet' in Puppet::Util

There is a load order issue here, and removing the `require 'puppet'` line
caused some failures. For now, just put it back. The load issues are resolved
in Telly.
Merge pull request #662 from jeffweiss/ticket/2.7.x/13894_backport_fix_of_12191

(#13894) backport fix of #12191
Merge remote-tracking branch 'pcarlisle/maint/2.7.x/util_require_puppet' into 2.7.x

* pcarlisle/maint/2.7.x/util_require_puppet:
  Put back require 'puppet' in Puppet::Util
Merge remote-tracking branch 'haus/update_puppet_spec_for_rpm_2.7.x' into 2.7.x

* haus/update_puppet_spec_for_rpm_2.7.x:
  Update puppet.spec for rpm packaging
Fixing problem caused by activerecord

ActiveRecord installed a parent() method that seems to have wreaked
havoc on the inheritance traversing code in the variable lookup code.
This uses a new method that achieves the same end, but doesn't rely as
much on the duck typing (responds to :parent) of the resource.

In addition tests have been added for node inheritance to ensure that
that inheritance heirarchy is followed as we expect. Also tests that
tried to fake out things and now have incorrect assumptions have been
changed to make fewer assumptions about how the system works.
Cleaner test for create_resources doing nothing

Better expresses that a create_resources with an empty hash is the same
as doing nothing in the catalog at all
Removed duplication of compiling a catalog

Created a PuppetSpec::Compiler module for helping out testing things
that want to compile some code to a catalog
Merge remote-tracking branch 'zaphod42/bug/2.7.x/8174-incorrect-warning-about-deprecated-scoping' into 2.7.x

* zaphod42/bug/2.7.x/8174-incorrect-warning-about-deprecated-scoping:
  Removed duplication of compiling a catalog
  Cleaner test for create_resources doing nothing
  Fixing problem caused by activerecord
(#12392): Colorize console output on Windows

Previously, `Puppet[:color]` was false on Windows, because the Windows
console does not support ANSI escape sequences.

The win32console gem converts ANSI color escape sequences into Win32
console API calls to change the foreground color, etc. If the output
stream has been redirected to a file, then the gem does not translate
the sequences, instead preserving them in the stream, as is done on
Unix.

To disable colorized output specify `color=false` or `--color=false` on
the command line.

This commit adds a `Puppet.features.ansicolor?` feature that defines
whether ANSI color escape sequences are supported. On Windows, this is
only true if the win32console gem can be loaded. On other platforms, the
value is always true.

The win32console gem will be packaged into the Windows installer, and
so, `Puppet[:color]` now defaults to true. If the gem can't be loaded,
then puppet will revert to its previous behavior.
Merge remote-tracking branch 'upstream/2.7.x'

* upstream/2.7.x: (22 commits)
  Removed duplication of compiling a catalog
  Cleaner test for create_resources doing nothing
  Fixing problem caused by activerecord
  Put back require 'puppet' in Puppet::Util
  (#13299) Fix error message when agent is disabled
  Update puppet.spec for rpm packaging
  Fixed old log test to match new autoflush behavior
  Make sure the log file writable
  Default autoflushing of log files to true
  Created test that shows enc warning problem
  (Maint) Fix order-dependent test failure
  (Maint) Don't assume eventlog gem is installed on Windows
  options[:ca_location] is a string not a symbol. Safer to pull Puppet::SSL::Host.ca_location since it is already set correctly.
  (#13204) Don't ignore missing PATH.augnew files
  (#13640) Only agents should use next_agent_run
  Increased test coverage of scoping rules
  Use more descriptive terms for the differing scopes
  Make new scoping look through inherited scopes
  Add tests for mixed inheritence/inclusion
  Remove dynamic option for lookupvar
  ...

Conflicts:
	lib/puppet/defaults.rb
	lib/puppet/parser/scope.rb
	spec/unit/parser/functions/create_resources_spec.rb
	spec/unit/parser/scope_spec.rb
	spec/unit/resource/type_spec.rb
	test/util/log.rb
Revert "Merge remote-tracking branch 'upstream/2.7.x'"

This reverts commit 7a430815424e053d6e6c5925eef711ca5edd8373, reversing
changes made to 32172d5d8de35f5cdbc31bce327b3567e078bb83.
Re-apply "Merge remote-tracking branch 'upstream/2.7.x'"

This reverts commit 6d399e087372b77566dd3737d4b444aca2e61050.
(#3757) re-introduce lockfile changes

This commit re-introduces the lockfile behavior changes that
were originally merged in to 2.7.x via this pull request:

https://github.com/puppetlabs/puppet/pull/216

It was reverted because of mcollective compatibility issues.
For more info see:

http://projects.puppetlabs.com/issues/12844

It is now being reintroduced for Telly, but with some minor
modifications.  See #3757, #12933 and #12934 for details on those.
(#3757, #12934) Minor test improvement for agent disable message
Fixed problems caused by 2.7.x merge

Several things had changed on master that caused the automatic merge to
not catch problems.
(#13645) Do not open a smtp connection if nothing to report

If tagmail finds out that there are no messages that have to be sent to
anyone puppet will still open a smtp connection (if smtpserver is set)
and then close the connection without sending any data. This can lead
to a lot of syslogmessages on your smtp server like

   sendmail: puppet.example.com did not issue MAIL/EXPN/VRFY/ETRN
   during connection to MTA

The fix now does not even enter the send method if there are no reports
to be sent. This does also prevent unnecessary forking if there are no
reports.
Updating CHANGELOG, lib/puppet.rb for 2.7.14rc1
(#3757) separate settings for agent lockfile paths

There are now two different lockfiles for agents; one
for indicating that an agent is administratively
disabled, and one that indicates that an agent run
is already in progress.

In previous revisions, the paths for these lockfiles
was being built from a single puppet setting via
naming convention.  This commit does the following:

1. Creates two settings (:agent_running_lockfile and
:agent_disabled_lockfile) instead of the previously
existing one (:puppetdlock).
2. Removes the Configurer class from the chain of
command when the Agent class is determining the
lockfile path.
(#13645) Add test cases to tagmail_spec

If puppet is configured to use tagmail as a report, it should not send
an email if no message match any tag in tagmail.conf

The former behaviour was that puppet opened an smtp connection, did not
send any mail and then closed the connection again leading to errors on
the smtp server. The added tests now prove that the send method is never
even called when no message match any positive tag.