Save password set through xen agent.

The get-password extension expects an encrypted b64 encoded password.
If we are setting the password via a guest agent and the user has
provided a public key, then we can go ahead and encrypt the password
and write it to metadata. If the guest agent is not working or not
installed, we leave the encrypted password to be set by posting to the
metadata server.

Related to blueprint get-password

Change-Id: I3ed26c7e1929f3c4c84f9bb87b0c620ab27223cb
Makes sure compute doesn't crash on failed resume.

If the call to the driver to resume an instance raises an exception,
then nova-compute fails to start properly. This can happen during
recovery, for example, where an instance has been deleted so the
backing files are gone but the database is restored to a state
where it exists.

This patch fixes the issue by catching the exception and setting
the instance to error.

Fixes bug 1100430

Change-Id: Ie31f39fcd43174c29bf7a5cb1b6fa29e4c723f97
Allow nova to use insecure cinderclient.

Add an option cinder_api_insecure to pass on to cinderclient.

Bug 1100459

Change-Id: Ifb31cc0df48d2345fa0a6ec440bdf9685254cbcd
don't allow crs in the code

triggered by this slipping into quantum, now that we have more windows
developers we should ensure that \r\n doesn't land in the code as
a line ending. This check prevents it.

Change-Id: I0a82be0e74915d3c3c25203db110d279580c148b
Remove network_host config option

It appears to be unused since 9c0ffe7 and was related to the
stub_network option which itself was removed in 3313cff.

Change-Id: Ic555e3523a90c83c6a89f24619252099c4e55f37
Fix multi line docstring tests in hacking.py

* Fixes N403, along with docstring test
* Adds N404, multi line start
* Disable N403 and N404 until all cases are fixed
* Remove obsolote '--repeat' flag from tox.ini

Change-Id: Ibf6371efc1cdc764e66f6f7c5c4362440101f963
Remove obsolete baremetal override of MAC addresses.

Now that the hypervisor driver can specify what MAC addresses it
needs, overriding the MAC address during bare metal instance
provisioning is no longer appropriate.

Change-Id: I2b0790753297104ddd40a410c8acb5fdac97ad15
Fix wrong quota reservation when deleting resizing instance

When we delete an instance which is resizing from m1.small to m1.tiny, we use
instance['memory_mb'] to create quota's ram reservation, if the resizing is not
'finished', the in_use value in quota_usages is NOT commited(2048M),
but the instance['memory_mb'] is updated(512M) in _finish_resize(), so the
deleting operation after updating will commit a wrong ram reservation(-512M),
and the in_use value changes to 2048-512=1536.
The cores reservation encounters the same problem.

Fixes bug #1099729

Change-Id: Ide54fc9d822041f535819c496822aeac5a8dc68d
Cells: Fix for relaying instance info_cache updates

The update_cells argument was ignored in db/api.py.  The API cell when
doing an update calls this with False to prevent relaying the request
back to itself... but it was being relayed anyway.

Change-Id: I5a40c878a547e81605dc40f0077b7c6e20ee3ad4
Remove some db calls from db servicegroup driver.

The base service code already ensures that a service record is created.
Store that in the service object.  Then down in the servicegroup db
driver, access it instead of having to go look it up again.

Part of bp no-db-compute.

Change-Id: Ife3c98c29c6f654585e14ded5a9b4c7e3bec226d
Add service_update to conductor.

Add a service_update method to the conductor API.  This will be
necessary for removing direct db access from the servicegroup db driver.

Part of bp no-db-compute.

Change-Id: Ic9a205ed4e810ee3511378742f764b2b311174a7
Use conductor in the servicegroup db driver.

This patch updates the servicegroup db driver to use the conductor API
in the cases where it was accessing the db directly before.  If the
service is allowed to do direct db access, the conductor API will
optimize the call to go straight to the db.  Otherwise, it will invoke
rpc to a remove conductor service to perform the operations.

Part of bp no-db-compute.

Change-Id: I96adffc6f80288c829d84f170414613a35b5c840
Merge "don't allow crs in the code"
Merge "Makes sure compute doesn't crash on failed resume."
Merge "Cells: Fix for relaying instance info_cache updates"
Merge "Save password set through xen agent."
Merge "Remove some db calls from db servicegroup driver."
Merge "Add service_update to conductor."
Merge "Use conductor in the servicegroup db driver."
Merge "Fix wrong quota reservation when deleting resizing instance"