Merge pull request #551 from cprice-puppet/bug/2.7.x/12844-agent-enable-doesnt-remove-old-lockfile

Bug/2.7.x/12844 agent enable doesnt remove old lockfile
Merge pull request #556 from joshcooper/ticket/2.7.x/12914-poll-child

(#12914) Allow puppet to be interrupted while waiting for child process
(#12844) Fix a unit test relating to lockfiles

The recent changes to support backwards compatibility with 2.7.10
and 2.7.11 introduced a very minor change in behavior with regards
to when a stale lockfile gets cleaned up.  Fixed this test to
recognize the change.
Merge pull request #559 from cprice-puppet/bug/2.7.x/12844-agent-enable-doesnt-remove-old-lockfile

Bug/2.7.x/12844 agent enable doesnt remove old lockfile
(#8312) Fix zypper provider so ensure => 'latest' now works

Previously the regular expression to match the correct column from
'zypper list-updates' was wrong, it seems to have been based on the command
'zypper packages' instead. This was caused ensure => 'latest' to fail as the
provider couldn't adequately figure out what newer versions were actually
availabe.

So I've fixed the regular expression (based on Felix Frank's patch) and updated
the spec test so that it uses the real output from zypper list-updates and now
references an external spec file, as apposed to referencing the content inline.
(#11988) Don't overwrite symlinks in augeas provider

Previously, if not running with `force` set, we would try to write the
file in SAVE_NEWFILE mode to create a <filename>.augnew file with the
changes. We determined whether there were changes to be made based on
that file (and used it to show a diff). When it came time to actually
make the changes, we would simply move the .augnew file over the file
being managed. Unfortunately, if the file being managed were a symlink,
this would clobber it.

There was a fallback path in the case of force (or older versions of
augeas not supporting SAVE_NEWFILE) in which we would make the
changes in SAVE_OVERWRITE mode as normal. Now, the behavior is a
combination of the two; we still use SAVE_NEWFILE to determine whether
changes need to be made and to show a diff, but then remove the .augnew
file and always run again in SAVE_OVERWRITE mode to save the changes.
This effectively delegates the behavior of preserving the file, etc.
to augeas, so we don't duplicate effort or bugs.
(#11988) Work around Augeas reload bug when changing save modes

After saving a file in one save mode and switching to another, Augeas realise
to reload the file when Augeas#load is called again.  Work around this by
explicitly reloading all files we saved while using the first save mode.
(#7592) Remove redundant call to String#to_s

Previously, the augeas provider made calls like the following:

 @aug.get(key).to_s

Since the Augeas#get method returns a String not an array, the to_s
call is redundant. (Note the #match method does return an array.)

The augeas tests were stubbing the #get method to return an array in
some places (and a string in others). Prior to 1.9.2, ruby will
automatically convert ["foo"].to_s to "foo", so everything worked as
expected. However, under 1.9.2, ["foo"].to_s becomes "[\"foo\"]".

These failures weren't noticed earlier, because our 1.9.2@allFeatures
jenkins nodes do not have ruby-augeas installed. In other words, tests
that require Puppet.features.augeas? were never running in
Jenkins. The recent change to improve augeas testing, removed the
dependency on this feature being installed, so these tests started
failing.

This commit just removes the redundant call to String#to_s, and
updates the spec tests to match what the Augeas#get method really
returns.
Updating CHANGELOG for 2.7.12rc2
Merge branch '2.7rc' into 2.7.x
Updating puppet.spec for 2.7.11-1, 2.7.11-2
(#7986) Cleanup pkg provider #1

The testing of hash[:error] is apparently dead code because it is never set
to anything different than "ok". Remove the hashkey :missing because it is
never used later.
(#7986) Cleanup pkg provider #2

Switch from Puppet.warning to the warning classmethod. This is mostly
for testing purposes and changes messages produced by puppet slightly.
Instead of

    warning: Failed to match 'pkg list' line foo

The user will now get

    warning: Puppet::Type::Package::ProviderPkg: Failed to match 'pkg
    list' line foo
(#7986) Modify pkg provider to handle publisher

The methods :instances, :query and :latest did not handle pkg list -H
lines correctly when the publisher of a package is not the preferred
publisher.

Modify the parsing method to handle lines with publisher correctly
(#10722) Refactor http_spec to use expectations
(#10722) Add spec to verify that an error is logged on bad http
Merge pull request #561 from pcarlisle/ticket/2.7.x/10722-error-on-bad-http-response

(#10722) report an error on bad HTTTP response to report submission
Merge branch '2.7.x'

* 2.7.x:
  (#10722) Add spec to verify that an error is logged on bad http
  (#10722) Refactor http_spec to use expectations
  Updating CHANGELOG for 2.7.12rc2
  (#7592) Remove redundant call to String#to_s
  (#11988) Work around Augeas reload bug when changing save modes
  (#11988) Don't overwrite symlinks in augeas provider
  (#8312) Fix zypper provider so ensure => 'latest' now works
  (#12844) Fix a unit test relating to lockfiles
  (#12914) Allow puppet to be interrupted while waiting for child
  (#12933) Better error message when agent is administratively disabled
  (#7592) Remove redundant call to String#to_s
  (#12844) Agent lockfiles: backwards compatibility with 2.7.10/2.7.11
  (#10722) Display errors on HTTP report submission failures
  Revert "Merge remote-tracking branch 'masterzen/tickets/2.7.x/3757' into 2.7.x"
  Revert "(#12844) Backwards compatibility for 'puppet agent --enable'"
  (#11988) Work around Augeas reload bug when changing save modes
  (#11988) Don't overwrite symlinks in augeas provider
  (#12881) Fix cron type default name error on windows
  (#12844) Backwards compatibility for 'puppet agent --enable'
  (#8312) Fix zypper provider so ensure => 'latest' now works

Conflicts:
	lib/puppet/provider/augeas/augeas.rb
	lib/puppet/reports/http.rb
	lib/puppet/util/pidlock.rb
	spec/unit/application/agent_spec.rb
	spec/unit/provider/augeas/augeas_spec.rb
	spec/unit/reports/http_spec.rb
(#12981) Fix external subcommand exit status
Merge pull request #536 from pcarlisle/ticket/2.7.x/9491-filesetting-munging

(#9491) Preserve trailing slashes in FileSettings