Add alias `tag` for `tags` in `create-policy`

To allow more flexibility for the client, `tag` is being added as an alias for `tags`.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-198
Add Razor::Conflict error for reporting command logical conflicts

This introduces the Razor::Conflict error, internally, which is then used to
report logical conflicts in commands.  This, alone, does nothing, but enables
us to correctly handle the `create-repo` case where logical conflicts
are possible.

https://tickets.puppetlabs.com/browse/RAZOR-185
Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Migrate all object creation to a new API

The semantics offered by the Sequel ORM are fairly traditional: object
creation or searching is possible, but it will simply raise an error when
items that violate unique constraints are found.

We want to move beyond that, to a world where creation is idempotent: if the
object logically exists in the database, but is identical to what you
requested, then we should treat this as a success rather than an error.

This moves all the object creation to a new API, "import", on our data
objects.  This allows us to add the semantics without overriding the core
behaviour of the Sequel ORM.

https://tickets.puppetlabs.com/browse/RAZOR-185

Signed-off-by: Daniel Pittman <daniel@rimspace.net>
create-* commands should return different status if already exists

This updates the create-* commands to handle duplicates more nicely: if the
requested object is identical to the current object, it will simply return
success to the caller, since their desired state was achieved.

If any fields conflict between the two, however, this will raise the new
conflict error code, and report a 409 error along with detail of which fields
are mismatched between the two.

Identical is defined as "any publicly visible fields have equal values", which
includes "the value of being absent" on both sides -- that is, you can't add
an optional field to an existing object and have a match.

https://tickets.puppetlabs.com/browse/RAZOR-185
Signed-off-by: Daniel Pittman <daniel@rimspace.net>
Add shared example specs for required attributes

It is a common case when testing commands that there is a list of minimum required attributes in the database validation which can differ from the command validation. This adds shared examples which can programmatically test that the minimum case works, then that removing any one attribute fails.

Note that this will not catch cases where the command validation is stronger than the database validation.
Update commands & specs to check required attributes

This updates commands and their spec tests where standardization was lacking. This includes using 'hw-info' instead of 'hw_info' in several commands, although the old style will be conformed for backwards compatibility.
Update specs to check required attributes

This updates the rest of the spec tests to use a standard way of checking required attributes.

Fixes https://tickets.puppetlabs.com/browse/RAZOR-221