(RE-3310) Update PE mock substitution

Previously the PE mock substitution tried to match the provided PE
version against the mocks listed in the build_defaults. This works as
long as the build_defaults file is up to date, but fails if the
build_defaults' mock list is out of date, as is often the case. This
commit updates the automation to use a regex instead of literal match.
This assumes we never have a platform version that is in the x.y format,
which is currently true and seems unlikely to change.
Merge pull request #349 from haus/ticket/master/re-3310-update-mock-templating

(RE-3310) Update PE mock substitution
(RE-3358) Move versionbump from Pkg::Tar to Pkg:Util:File.

Prior to this commit, versionbump was occurring in Pkg::Tar, but not
Pkg::Util::File. This resulted in missing versionbumps for some artifacts,
such as gems. This commit moves the versionbump to Pkg:Util:File, where
it will versionbump the appropriate artifacts.
Merge pull request #350 from geoffnichols/RE-3358/3.4.x/move_versionbump_to_file

(RE-3358) Move versionbump from Pkg::Tar to Pkg:Util:File.
use matching for cows instead of splitting based on dashes
Merge pull request #351 from heathseals/re-1582/cumulus_fixups

(maint) use matching for cows dist and arch instead of splitting based on dashes
escape the '.' in the cow match regex, just in case we ever have an arch with cow in the name.
Merge pull request #353 from heathseals/re-1582/cow_regex_fixup

escape the '.' in the cow match regex
(maint) Remove space before arg parens warnings

This removes the warnings we get thrown due to space before arg parens:

tasks/tickets.rake:36: warning: don't put space before argument parentheses
tasks/tickets.rake:37: warning: don't put space before argument parentheses
tasks/tickets.rake:38: warning: don't put space before argument parentheses
tasks/tickets.rake:39: warning: don't put space before argument parentheses

Signed-off-by: Ken Barber <ken@bob.sh>
use matching for cows instead of splitting based on dashes
Merge pull request #355 from heathseals/maint/cumulus_shipping

(maint) use matching for cows instead of splitting based on dashes
(RE-3310) Update mock task to corrrectly parse mock name

When the PE version was removed from some mocks, it broke some
assumptions in the mock rake task. This commit addresses that by using a
regex capture instead of splitting, to allow for the PE version to be
optional.
Merge pull request #356 from haus/ticket/master/re-3310-update-mock-parsing

(RE-3310) Update mock task to corrrectly parse mock name
(maint) Stop stripping .cow suffix from cows

We used to strip the .cow suffix off in the pe_ship task, which meant
that the following regex that used the .cow suffix would never match.
This commit removes the .map and also tightens the following regex
slightly.
Merge pull request #357 from haus/maint/master/fixup_cow_regex

Remove non-existent .cow suffix from the deb regex
Merge pull request #354 from kbarber/maint/master/space-before-argument-parens-warnings

(maint) Remove space before arg parens warnings
Update remote_ssh_cmd to optionally return output on success

We go back and forth on this, but I've finally found a usecase for wanting the
stdout from a remote ssh command. Reprepro won't return non-zero when it
ignores a deb for inclusion in a repo. With the promotion process, we've been
assuming that just checking for an equivalent package in packages.json is a
safe check for preventing duplicate package promotions. However, as we've found
with trying to get a new PE version pipeline in order, we can't always rely on
packages.json to be accurate. When it's not, we've been "successfully"
promoting packages, when in fact the debs are completely ignored by reprepro
because they already exist in the debian repos. The metadata in packages.json
is still updated though, which leads to failed composes because the md5s don't
match up between packages.json (has the ignored deb md5) and the real package
in the repo (has the pre-existing deb md5).

This commit modifies the remote_ssh_cmd method to use the open3.capture3 method
for executing system calls. This method returns the stdout, stderr, and exit
status object for a given system call. We use it to get the output, and exit
status, of our ssh command. To return this output, callers of this method add
"true" for verbose to the invocation. This will only happen on success -
failure will still raise an exception. This is backwards compatible.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Update reprepro invocation to capture output

This commit leverages the previous commit's new facility in remote_ssh_cmd for
capturing the output of an ssh command. We do so to scan the output for
"Skipping Inclusion" - a string that indicates reprepro has refused to add a
deb to the repository because one of the same NVR already exists. When reprepro
does this, it exits 0. We were previously not handling this case, assuming
success based on the exit code. If reprepro has skipped inclusion, we now fail,
as we should.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>