Set the provision_state to DEPLOYFAIL

Set the provision_state to DEPLOYFAIL instead of ERROR when the deploy
failed. The DEPLOYFAIL state should be used for this problem specific
where ERROR is more generic.

Change-Id: I87c75dd8be46950792643303f79d57f9a7da9d0d
Port StringType class from WSME trunk

Port the StringType class and its tests from WSME trunk. The StringType
is needed for the implementation of our PatchType class that will make
use of the complex type validation of WSME to remove some of the custom
validation code.

See: https://review.openstack.org/#/c/60194/

Change-Id: If387ed915e4d0102112f93ed16eee13775b54f4c
Merge "Port StringType class from WSME trunk"
Add -U to pip install command in tox.ini

Ask pip to upgrade packages in the virtualenv so that a long-lived
virtualenv is still kept up to date as external dependencies change.

Change-Id: Ife76a83be95fed7cc4b99bb50a97277d0751e76c
Clean up duplicated change-building code in objects

Almost every object thus far has done this:

  updates = {}
  changes = self.obj_what_changed()
  for field in changes:
        updates[field] = self[field]

to get a dict of updates to apply to the database. This patch adds
that as part of the base object and makes every place that does
the above to just use that.

It's a port from a patch in nova ,link to the origional patch:
https://review.openstack.org/#/c/45353/

Change-Id: I8d2616ecc2c88cf4b21e7e8193f5b985407ed869
Closes-Bug: #1259527
Change default API auth to keystone-based

Current default setting of auth_strategy=noauth
is not a sane default for our users.

Switch to keystone-based authentication.

Change-Id: I11163eff24d185a1af52eb58e70bb53beb3ce84d
Add JsonPatchType class

This patch adds the JsonPatchType class for API parameter validation with
WSME. This class will be used to replace some of the custom validation
functions we have in the api/utils.py.

Change-Id: I233cd273854eae5ed4d8856d4af3e2f8e2309dce
Partial-Bug: #1223847
Rework patch validation on Ports

This makes use of the complex type objects of WSME and creates a type
to validate json patch format.

Change-Id: I17ea33efec16146d4ece90fd0ef5123faaacefb0
Partial-Bug: #1223847
Merge "Clean up duplicated change-building code in objects"
Merge "Set the provision_state to DEPLOYFAIL"
Imported Translations from Transifex

Change-Id: I713909c24064d77e7fd2062dd7ac1630ffe3372b
Merge "Change default API auth to keystone-based"
Handle DBDuplicateEntry on Ports with same address

Handle the DBDuplicateEntry exception when creating/updating ports with
the same address and raise MACAlreadyExists to give user a better feedback
about the problem.

Change-Id: I87feb27776bb2fee2a4a6b28f9468e235063f5f7
Closes-Bug: #1257673
API: Validate and normalize address

On the API side, checks whether the supplied MAC address is formally
correct and normalize it to all lower case.

The patch also improves the docstring of the is_valid_mac function.

Change-Id: I6ae13888a9e17a10bba20acf829cbd01df535a3c
Closes-Bug: #1259269
API: Add sample() method on Port and PortCollection

Define sample() method on Port and PortCollection API objects to provide
sample data for generating the JSON and XML examples in the output of
the auto-documentation.

Also, PEP8-fy imports in port.py.

Change-Id: Ia19a2d79509d4cc820e9dea64d5c2c92dc9b3d2a
Partial-Bug: #1260337
Merge "Handle DBDuplicateEntry on Ports with same address"
Merge "API: Add sample() method on Port and PortCollection"
Merge "API: Validate and normalize address"
Merge "Imported Translations from Transifex"
PEP8-ify imports in test_ipmitool

Change-Id: If43a2bde845e46e792252e281fd3ea8ebadfb9ed