(#15521) Convert to using host stub wrapper

This patch converts the module acceptance code to using the host stub wrapper
now provided in puppet-acceptance: `stub_forge_on`.

This will allow us to change the forge host we are stubbing dynamically as
apposed to manually changing it everywhere in acceptance code.

This also changes the cases where we have teardown code to use the new
`teardown` block, and to use `rm -rf` for file cleanup to avoid puppet backup
duplication issues.
Add packaging support for fedora 17

This commit modifies the puppet.spec file to use
the ruby vendorlib instead of sitelib if building
for fedora 17, which ships with ruby 1.9. Mostly
borrowed from the official Fedora 17 package.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Merge pull request #1017 from MosesMendoza/maint/2.7rc/update_spec_for_fedora_17

Add packaging support for fedora 17
maint: Refactor suntab and aixtab filetype

Apply the create/do_stuff/delete cycle of a temp file that is explained
in tempfile.rb to the suntab and aixtab filetype. This way the temporary
file should always be removed.

The name of the temporary file was changed so it will be easier to stub
this single call in tests - without stubbing tempfile creations in other
places (like inside Puppet::Util.execute) at the same time.
(#14283) Fix suntab filetype when run as normal user

Running puppet as an unpriviledged user to manage its own crontab caused
two problems under solaris:

The uid argument was passed to the execute method to set the correct uid
before executing the crontab command. The execute method has a default
argumenthash with the key :failonfail set to true. Because the suntab
filetype passed it's own hash, failonfail was nil so if crontab
completes with a non-zero exit code no error will be raised.

This is bad because running execute with :uid not only sets the correct
userid in the child process but also tries to run `Process.initgroups`
to set the correct supplementary groups of that user. This call will most
likely fail as a non priviledged user causing the whole child process to fail.

The fix now makes sure that failonfail is passed to the execute method
so failures can be handled correctly and uid is only passed if necessary
(which is not the case when the target user in the crontab resource is
the same user that is running puppet).

Since the execute method now raises an exception on non-zero exit
codes, we have to handle the case where the crontab file doesn't exist
for the user (and return '') versus other fatal errors.
(#15291) Add Vendor tag to Puppet spec file

Previously the spec file had no Vendor tag, which left it undefined. This
commit adds a Vendor tag that references the _host_vendor macro, so that it can
be easily set to 'Puppet Labs' internally and customized by users easily. The
Vendor tag makes it easier for users to tell where the package came from.
Merge pull request #1023 from haus/ticket/2.7rc/15291_add_vendor_field

(#15291) Add Vendor tag to Puppet spec file
Ruby 1.9.3 has a different error when `require` fails.

The text of the error message when load fails has changed, resulting in the
test failing.  This adapts that to catch the different versions, allowing this
to pass in all cases.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
Merge pull request #1024 from haus/ticket/2.7rc/11325_fix_load_failure_regex

Ruby 1.9.3 has a different error when `require` fails.
(maint) Include backtrace in re-raised exception

Previously, there were places where a rescued exception's message was
not included in the newly raised exception. We also were not preserving
the backtrace, which makes debugging more difficult.

This commit ensures the original message and backtrace are included in
the newly raise exception.
(maint) Whitespace cleanup

Previously there was trailing whitespace and lines indented 4 spaces.
Just reformatted the file, no code changes.
(maint) Remove spurious `puts` line

Previously, the suntab's write method was printing the contents of the
crontab file to stdout.
Convert expect..should to expect..to in configurer spec
Use TestHelper in old unit tests

This adds calls so that the old unit tests use the pre and post steps from
Puppet::Test::TestHelper to clean up between tests.
Always set log functions on root environment

Set the logging parser functions (notice, err, etc) on the root environment.
This also requires setting the current environment to be nil in
Environment.clear by setting it directly on Thread.current.  Otherwise the
default environment from puppet.conf is used. In tests this was interfering
with the log functions being set on the root environment instead of the
current environment.
(#7442) solaris: add tests for password_max_age attribute

This commit tests that password_max_age will properly read the values
out of a /etc/shadow file. If password aging is disabled for a user on
Solaris, there is no artifact in the shadow file that indicates this.
We need to get "-1" back to match other platforms.
(#7442) solaris: return "-1" for password_max_age when password aging is disabled

If password aging is disabled for a user on Solaris, there is no
artifact in the shadow file that indicates this. We need to get "-1"
back to match functionality on other platforms.
Merge branch 'ticket/2.7.x/7442_solaris_password_max_age' into 2.7.x

* ticket/2.7.x/7442_solaris_password_max_age:
  (#7442) solaris: return "-1" for password_max_age when password aging is disabled
  (#7442) solaris: add tests for password_max_age attribute
(#15940) Update puppet doc to ignore files and templates in modules

Without this commit puppet doc will parse some files inside of the
files/ and templates/ sub directory of a module.  This is a problem
because these files are not meant to contain puppet code.

Conflicts:
	lib/puppet/util/rdoc.rb
(#15940) Add test coverage for rdoc exclude option

Without this patch the addition of `<module>/templates/.*$` does not
have test coverage.  In addition, the existing test fails because the
arguments have changed.

This patch fixes both problems by updating the spec tests appropriately.