Merge pull request #881 from mckern/1.5.x

(maint) Updated RHEL7 support in 1.5.x branch
PDB-510 Add migration to fix sequence for catalog.id

The sequence for catalog.id had not been incremented during insert for migration
20 'differential-catalog-resources'.

This meant that the catalog.id column would throw a constraint exception during
insertion until the sequence had increased enough to be greater then the max id
already used in the column.

While this was only a temporary error, it does cause puppetdb to start to throw
errors and potentially dropping some catalog updates until a certain number of
catalogs had been attempted. In some cases catalogs had been queued up and
retried successfully, other cases meant they were simply dropped into the DLQ.

The fix is to reset the sequence to match the max id on the catalogs.id column.

This patch includes a new migration with this step, that utilizes a new function
created to generically reset sequences based on table and catalog in a database
independant way.

Signed-off-by: Ken Barber <ken@bob.sh>
PDB-510 Add explicit locking and move fix-identity-sequence

This patch adds explicit locking of tables to fix-identity-sequence and moves
the function under storage-utils.clj.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #890 from kbarber/ticket/1.6.x/pdb-510-reset-catalog-sequence-to-latest-id

PDB-510 Add migration to fix sequence for catalog.id
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
Merge branch '1.6.x'

* 1.6.x:
  PDB-510 Add explicit locking and move fix-identity-sequence
  PDB-510 Add migration to fix sequence for catalog.id

Conflicts:
	src/com/puppetlabs/puppetdb/scf/migrate.clj
Clojure 1.6.0 final

Signed-off-by: Ken Barber <ken@bob.sh>
(PDB-452) Adding support for storing environments

Added support for environments to the model and command wire formats.
Pin Rake for Ruby 1.8.7

Rake 10.2 has dropped Ruby 1.8.7 support, this patch pins that version to use
10.1.1.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #895 from kbarber/maint/master/clojure-160-final

Clojure 1.6.0 final
Merge pull request #896 from kbarber/maint/1.5.x/pin-rake-gem

Pin Rake for Ruby 1.8.7
Merge branch '1.5.x' into 1.6.x

* 1.5.x:
  Pin Rake for Ruby 1.8.7
Merge branch '1.6.x'

* 1.6.x:
  Pin Rake for Ruby 1.8.7

Conflicts:
	Gemfile
Minor doc changes
Merge pull request #894 from senior/ticket/master/pdb-452-support-environments-in-commands

(PDB-452) Adding support for storing environments
PDB-453 Add environments to all terminii

This patch ensures that the request environment is sent to PuppetDB inside
the payloads for the object types: facts, catalogs & reports. To support this
we bump the command version as per PDB-452.

The new version of catalog requires a flattening, which this patch provides.

Signed-off-by: Ken Barber <ken@bob.sh>
Merge pull request #888 from kbarber/ticket/master/PDB-453-terminus-environments

PDB-453 Add environments to all termini
added example for latest-report?

thanks to grim_radical for his help in irc.
flubbed the initial operator.
removed a space