[Persist] Add persist_username & persist_password to Config::Server.

Currently there is no mechanism to pass authentication credentials to a
local or remote persistence service (such as MongoDB or PostgreSQL).
While a non-authenticated connection works out of the box with a local
MongoDB server, this is not the case with a local PostgreSQL server.

Furthermore there is no way to configure Razor to use a remote MongoDB
server protected by a username/password authentication.

As a result the PersistPlugin#connect method signature was augmented to
take `username` and `password` parameters. Each persistence
implementation is responsible for using or ignoring these additional
parameters when establishing a database connection.
[Postgres] Bugfix: uuid variable not defined in #object_doc_get_by_uuid.
[Postgres] Ensure Ruby symbols are (de)serialized.

In the MongoPlugin Ruby symbols are preserved in hash values thanks to
BSON, but in other persistence plugins symbols will be coerced to
strings (via a JSON.generate in the Postgres case) before saving. When
the object is deserialized the values that were Ruby symbols are now
strings which is not expected by the rest of the codebase.

Instead, we can "encode" the hash data structures containing symbols by
transforming any symbols to strings, for example: :symbol -> ":symbol".
When the data is read back out of the database we can "decode" these
data structures and reconstitute the symbols.
[Postgres] Allow ID of type VARCHAR only for policy_table.

A single row is inserted into this table with a "uuid" set to
"policy_table" which is not a valid UUID.
[Postgres] Insert active_model object if '@version' attr is < 0.

The object document that is persisted to the :active collection is a
PolicyTemplate and as such will have a version attribute greater than 1.
[packaging] Update mocks for rpmbuilder mock format

The Puppet Labs mocks created by rpmbuilder have assumed a new naming format,
pl-el-* vs el-* and pl-fedora-* vs fedora-*, in order to avoid overwriting the
configurations supplied by the mock package. This commit updates the mocks in
Razor to reflect the new standard, so that we can continue to build packages
with builders created with the rpmbuilder module. As we add new builders that
do not have legacy configurations, this will become critical to avoid broken
pipelines.

Signed-off-by: Moses Mendoza <moses@puppetlabs.com>
Remove hard rspec dependency in Rakefile

Razor's Rakefile requires rspec/core/rake_task to add spec tasks to the task
list. This is useful when running tests, but should not be required when
building packages. This commit addresses that by rescuing the LoadError on
rspec/core/rake_task and only adding the spec related tasks if the
Rspec::Core::RakeTask constant is defined. This allows packaging tasks to be
run without rspec installed, but will still allow tests to be run and displayed
if rspec is installed and available.
Remove trailing whitespace in Rakefile
(#418) Resolve symlinks when determining razor install location

The `razor` binary installs in a non-standard location, and depends on the
value of the `__FILE__` variable supplied by the Ruby interpreter to find the
library code it depends on.

This didn't work when a symlink was used for the top-level file, since the
ruby interpreter would supply the symlink, not the resolved path, and that
could be outside the install tree.

This updates the command line and daemon scripts to resolve the absolute real
path on disk from `__FILE__` using the standard Pathname library, before
using it.

This closes #418.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Update contributor license agreement URL

This updates the contributor license agreement URL to reflect a change
made externally to the project.
Merge pull request #426 from daniel-pittman/bug/master/418-symlinks-break-razor-library-path-magic

(#418) Resolve symlinks when determining razor install location
Merge pull request #423 from haus/remove_rspec_depends_in_rakefile

Remove hard rspec dependency in Rakefile
Merge pull request #421 from MosesMendoza/maint/master/update_mocks

[packaging] Update mocks for rpmbuilder mock format
Citrix XenServer Support for 6.1 (tampa) and 6.0 (boston)

Adds the ability to provision Citrix XenServer.  Model configuration handles
generation of the xenserverinstall_xml answerfile which it uses during installation.

pxelinux.0 is chainloaded to boot the install instead of iPXE due to mboot.32
complications which will be looked at in the future.  It calls back for a generated
isolinux file to obtain it's boot settings for the installation.
Merge pull request #425 from amesserl/xs-support

Citrix XenServer Support for 6.1 (tampa) and 6.0 (boston)
Disentangle configuration access from the data store layer

Before this change an awful lot of the Razor code accessed the global
configuration through the "data" object - because the database abstraction
happened to load the configuration file, all the rest of the code connected to
the database to access the side effect of configuration data.

The database abstraction also owned loading and updating the configuration
file on disk, tying the two together in very intimate ways that, generally,
don't make a lot of sense.

This extracts a bunch of logic around configuration file handling from the
data store, puts it in the configuration class, and then builds a global
configuration accessor off the project to provide access.

This is, in essence, a change from `get_data.config['whatever']` to
`ProjectRazor.config['whatever'`, which seems like an overall win.

Really, this is code cleanup and lays the groundwork for changing the data
abstraction layer in more fundamental ways tomorrow.  The goal is not to
change fundamental behaviours, just to clean up the code that builds them.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Merge pull request #429 from daniel-pittman/feature/master/323-extract-and-sanitize-config-handling-for-persistence-layer-updates

Disentangle configuration access from the data store layer
Load `mocha/api` in order to cleanly integrate with rspec

The newest versions of the Mocha library require that we load `mocha/api` when
integrating with a non-core test library.  Given we use rspec exclusively,
this updates the code to match their polite request.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Strip the config testing out of the persistence layers test suite

The acceptance tests for the data object still made assertions about the
configuration; this eliminates that, now that we have separated it from the
persistence layer.

All the testing that this performed has also been ported to the regular unit
test suite, so there is no loss in eliminating this change.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Eliminate use of config through the persistence layer in tests

The acceptance suite had a bunch of uses of the configuration data through the
persistence layer that, for some crazy reason, didn't show up in my earlier
test runs.

This eliminates those, allowing the tests to actually pass when fully run,
after the initial work disentangling the two concepts in the code.

Signed-off-by: Daniel Pittman <daniel@rimspace.net>