(#13888) Fix self.instances for systemd service provider

Previously, attempting to run puppet resource service
on Fedora 16 resulted in a stack trace.

This commit resolves the issue so that self.instances should
work for systemd providers. The issue was that the instances
method was returning an Array of strings. This commit updates the
method to correctly return an Array of Provider instances.
(#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.
(#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
(#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.
(#3757) move lockfile path logic into modules

The Puppet::Agent::Locker and Puppet::Agent::Disabler
had a weird dependency on the existence of some
lockfile methods in Agent, but Agent didn't use
those methods anywhere else.  This commit moves
all of the lockfile related stuff into the modules
in an attempt to improve encapsulation and clarify
the API of the modules.
(#3757) Remove 'anonymous' functionality from lockfiles

The agent lockfile mechanisms had a concept of "anonymous"
built-in to them.  This was necessary to help attempt to
disambiguate the meaning of the lockfile when we were
using it for two purposes (administrative-disabling vs.
run-in-progress).  Since we now have two separate lockfiles,
this is no longer necessary... and it makes the code
and API confusing.  This commit removes it, and the
resulting API feels much cleaner and more straightforward.

The "AnonymousFilelock" class needs to be renamed, but
I haven't done that yet.  My next commit is going to
transform it into a JSON-based lockfile class, so I'll
rename it as part of that commit.
(#3757) rename AnonymousFilelock to JsonFilelock

This commit simply renames AnonymousFilelock to
JsonFilelock.  The behavior hasn't changed at all
yet, so this is a bit of a suspect commit but
I wanted to make sure that the git history
was as clear as possible as to what happened
here.
(#3757) Implement json-based lockfiles

This commit does the following:

1. Refactors our main lockfile class to accept a data object
    as an argument to the #lock method.  This data can
    then be retrieved at any time while the lock is held;
    the implementation is to write the hash as JSON to
    the lockfile.  This will allow external tools to
    read it without calling into puppet code.
2. Refactor pidlock to use the above--but only serializing
    a String (the pid) to the file.
3. Refactor disabler to use the above, with a Hash containing
    a key/value pair identifying the "disabled" message.
4. Fix and clean up spec tests.
(#3757) cleanup and docs
(#3757) add acceptance test

This acceptance tests covers the cases around the agent
--disable/--enable options.  It doesn't cover the
pidfile case, which will be hard to test without
running the agent in daemon mode.
Add ability to log spec test order to a file

This commit tweaks the spec_helper to give it the
ability to log the spec test order to a file.  It
will only log the order if you have set the
environment variable "LOG_SPEC_ORDER", e.g.:

LOG_SPEC_ORDER=true rspec spec

This will be useful when using Nick L.'s bisect
script to identify order-dependent spec failures.
It should probably be enabled on all of our
Jenkins jobs, and would potentially allow us to
start running them with the random order flag
enabled.
Removed unused methods

* `unsetvar()` was ommented that it was only used in tests and the only tests that used it
test it, so it isn't needed to actually test things.
* Since the `scope_path()` method isn't actually used for looking up the
variable, there is no guarantee that it is the actual path of scopes
used.
Fixed error reporting when appending

There was a pointless raise that a test thought it was checking for, but
a different error was being raised than was intended. The logic also
used a lot of "unless"es which made it hard to follow at times, so
changed them to "if".
Removed dynamic scoping

Removed dynamic scoping code and related acceptance tests that checked
that deprecation warnings were issued about accessing variables via
dynamic scope. Since there is no dynamic scope anymore there is no
warning.
Moved full scoping tests to integrtion

Since these are using the entire parser/compiler system they don't
really qualify as unit tests.
Fixed += op changing arrays in outer scope

The += operator was changing the value of the variable that it was
supposed to clone when the value was an array.
Added tests to cover old dynamic lookup

These test cases cover what happens in what used to be dynamic lookup
situations.
Added tests around enc usage

Scoping for classes included by an ENC follow some rules that are not
immediately obvious. These tests should nail down and clarify that
behaviour
(#14072) Allow faces to inline global setting docs

Add `display_global_options` to Face DSL.
Add `environment`, and `modulepath` as display_global_options for existing
module face.
Add `type` for typed settings.
Add display_global_options to exising help and man faces.