Fix baremetal get_available_nodes

Baremetal driver get_available_nodes was incorrectly returning only a
list of unprovisioned nodes, leading update_availabile_resources to
sometimes delete a baremetal node that had an instance provisioned
to it -- sometimes even while the provisioning was still in process.

Fix bug 1174952

Change-Id: I4f08a2f6539a5b6cd12245ac6b4dc308767ae0cd
Import oslo periodic tasks support.

I'll move nova across to this in the next review, I just want to
make the import clearly separate.

Change-Id: I4eefd9c73d443afcd0697ff5ddd59abf315b10e5
Update to using oslo periodic tasks implementation.

Convert nova to using the oslo periodic tasks implementation. There
are no functional changes in this review.

Change-Id: I767e0ad17781d5f9d5e987e0a4ad65796243ae5c
Catch glance image create exceptions

Catch exception from glance when image creation fails because the
requested name is too long. Currently the exception is not caught
in the api which results in an 400 Bad Request correctly being
returned, but also leaving a traceback in the logs. Correctly catching
the exception and explicitly raising an HTTPBadRequest removes
the production of the traceback.

Fixes bug #1169560

Change-Id: I511da79cb0b1b4578bf43f0819b2ac64fb6e5fb3
Convert the cache key from unicode to a string.

The memcached API expects string format, not unicode.
Convert the key passed to the memory cache to a string
before sending it to memcached. Since both the function
name and the id that form the key are ascii format, a
simple conversion from unicode to str is sufficient.

Change-Id: I9d15858ad4e10aa183444cccda9c33676059e55a
Fixes: bug #1174487
Sync jsonutils from oslo

This is a sync of commit 9dcf688ea80f52cdb5413514198b2aa81d5a4e09 from
the oslo-incubator project. It should improve the serialisation
performance in general and tests runtime specifically.

Change-Id: I6b0e7baeb24951ce3c0bc129d20c65daa0d8fa61
Sync small and safe changes from oslo

Ran the oslo-incubator sync script and brought across only the files
that have small and safe changes.

Change-Id: I41b400c189e52a2e7f642a03ad143d821aaa807c
Merge "Import oslo periodic tasks support."
Merge "Catch glance image create exceptions"
Merge "Convert the cache key from unicode to a string."
Merge "Fix baremetal get_available_nodes"
Merge "Update to using oslo periodic tasks implementation."
Reset migrating task state for MigrationError exceptions

Create an exception type for pre-check errors and add it to the list
of exceptions for which instance task state is reset to ACTIVE to
avoid cases where an instance get stuck in MIGRATING state.

Convert existing instances of raise MigrationError in scheduler and
driver pre-checks to have them raise the new MigrationPreCheckError
exception instead.

In addition, also make sure that expected exceptions are passed over
RPC silently.

Resolves bug 1171526.

Change-Id: I00fa0962e555f895dd98861684ec7767fed3b37b
Merge "Sync jsonutils from oslo"
Merge "Sync small and safe changes from oslo"
Merge "Reset migrating task state for MigrationError exceptions"