Adapt to the PuppetDB 3.0.0 module changes

This patch fixes helper.rb so that our acceptance tests are compatible with
the new changes in the PuppetDB 3.0.0 module.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #736 from kbarber/maint/1.5.x/adapt_to_puppetdb_300_mod_changes

Adapt to the PuppetDB 3.0.0 module changes
Remove extraenous setup file

Through some merging mistake 15_setup_repos and 15_install_repositories became
duplicated. Deleted 15_install_repositories because the name is longer and it
has slightly older code in it I believe.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #737 from kbarber/maint/1.5.x/remove_duplicate_setup_file

Remove extraenous setup file
(PDB-9) Improve report query syntax error handling

Return better error messages when the user queries with bad operators
or attributes
Merge pull request #735 from senior/ticket/master/pdb9-better-report-query-error-messages

(PDB-9) Improve report query syntax error handling
Clojure code cleanups

* Simplify nil equality check
* Use positive checks for (when ...) cases
* `repeatedly` can take a length 'n'
* Use `dec` to make this simple operation easier to skim read
* Replace a loop with internal conditional with `while`
* Use (when-not ...) for conditionals where positive-case is nil
* Use Clojure's own readable fn for equality checks with zero
* Use positive conditional checks (nil punning)
* nil equality checks can use the (nil? ...) fn
* Equality checks with zero can use the readable form (zero? ...)
* Simplify negative nil return condition by using (when ...)
Merge branch 'clojure-clean-up' into 1.5.x

* clojure-clean-up:
  Clojure code cleanups
(packaging) (#20148) Update logrotate script when appropriate

Logrotate versions > 3.8 complain about permissions unless the su directive
is explicitly set.

This commit updates the RPM and Debian package to set the su directive properly on
dists that need it (Debian >= 7, Ubuntu >= 13.04, EL >= 7, SLES >= 12, Fedora >= 16)
(packaging) (maint) Clean up the Debian rules file

Improve the use of templates to remove redundant code and improve
consistency.
testing: Improve git fetch handling to support refspec

For PR testing we need to download quite a different refspec, this patch
provides a better refspec for PR handling.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #744 from kbarber/maint/1.5.x/improve_git_fetch_for_pr_testing

testing: Improve git fetch handling to support refspec
Merge pull request #742 from shrug/bugs/1.5.x/20148

(packaging) (#20148) Update logrotate script when appropriate
Fix cli with no argument handling

Seems the cli.tools 0.2.2 library decided to change its API and is now
not returning nil valued entries when there is no default. This has played
havoc with our required-args detection, meaning that when you attempt to
call a command without any arguments you get a nasty exception.

This patch fixes this, and adds acceptance tests to ensure we don't regress.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #751 from kbarber/maint/master/1.5.x/cli-with-no-args-broken

Fix cli with no argument handling
Disclose the protocol for import/export CLI help

We didn't explicitly say HTTP only, and it confused Chris Spence so much that
we feared for our lives.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #754 from kbarber/maint/1.5.x/disclose-port-protocol

Disclose the protocol for import/export CLI help
PDB-85 Fix report export format

Three new parameters were added to the events end-point that were really
derived from the report of the event, and so aren't necessary for later
injection via import.

This was blocking anonymization and import from working as expected. This patch
ensures those parameters are stripped from the export correctly.

This bug wasn't seen because our tests do not always generate events, so
the invalid parameters never surfaced. As a safety guard for future
generations I've made sure that all the places that look like they could
do with some report events, I've ensured these exist now - even if they
probably haven't got any issues it seems like the correct thing to do
here.

To aid in this endeavour I've back-ported Ryan Seniors' two methods:

- run_agents_with_new_site_pp
- create_remote_site_pp

Since this setup was becoming quite common, this helped cleanup some of
our existing code as well.

Signed-off-by: Ken Barber <ken@bob.sh>
Add exports puppet face

Prior to this commit I was asked by @kbarber to PR a link to a face
I wrote for querying puppet exports from the command line.
I attempted to match the standard markdown examples that were already
there.
Merge branch 'add_exports' into 1.5.x

* add_exports:
  Add exports puppet face