Clean up read_deleted support in host aggregates code

tl;dr - this is a cleaner fix for bug #949038

It seems clear to me that all of the DB APIs should not explicitly pass
read_deleted='no' or read_deleted='yes' to model_query without good
reason.

We want to allow callers to specify read_deleted via the context and
that only works if we don't explicitly pass it to model_query().

If we don't explicitly specify it to model_query(), we use the value
from the context which defaults to 'no'.

Given all that, there is no need to support read_deleted to any of the
DB API calls because they should support specifying the flag via the
context. There should also be no need to pass read_deleted='no' because
that is the default.

Really, the only place there should be any mention of read_deleted is
where we want read_deleted='yes' behaviour e.g.

  - In tests, where we want to check the operational_state of an
    aggregate after it has been deleted

  - Where we want to support undeleting an aggregate or aggreate host

Change-Id: I916a8d189a33d7f30838cccb26531a024066ef96
remove unused flag:
baremetal_injected_network_template
baremetal_uri
baremetal_allow_project_net_traffic

Change-Id: I9766924cc7621e14fc52088a558b95cfd5d7ce8d
fix TypeError with unstarted threads in nova-network

(nova): TRACE: File "/usr/lib64/python2.6/site-packages/nova/utils.py",
line 860, in __init__
(nova): TRACE: self.tname = "-%x-%x" % (ident & 0xffffffff, gident &
0xffffffff)
(nova): TRACE: TypeError: unsupported operand type(s) for &: 'NoneType'
and 'int'

Fixes: bug 971629

Change-Id: I3d34816c36a11cd6fc2dd9c889c93c5872133a2c
add libvirt_inject_key flag
fix bug #971640

Change-Id: I48efc5babdd9b233342a33c87c461aabf5f5915b
Add validation on quota limits (negative numbers).

Quotas should not accept negative numbers other than -1.

Fixes LP Bug #973034.

Change-Id: Icc647d80df42d09928717d48ae95dfc8b76c4795
Use thread local storage from openstack.common.

nova.local was recently added to openstack-common.  Remove nova.local
and use openstack.common.local instead.

One benefit of this change is that it is another step toward decoupling
nova.rpc from the rest of nova.

Change-Id: I0240f4291a81f8390d3f329a11f207a1453d7cab
Add the serialization of exceptions for RPC calls.

This change uses json to serialize an exception so that it can be sent
through RPC calls to be reconstructed on the other side. The traceback is added
to the exception message. If recreating the exception fails for whatever reason
then a RemoteError is created containing all of the exception information.

Adds flag 'allowed_rpc_exception_modules' to prevent dangerous modules from
being accessed and allowing arbitrary code to be run.

Fixes bug 920705
Fixes bug 940500

Change-Id: Ife3b64b19fe8abbc730184d4ee7d9fcabfd29db3
Allow instance logging to use just a UUID.

Sometimes all you have is an instance UUID, and its not worth
building an instance dict just for logging. Allow callers to pass
just the UUID if that's all they have. Resolves bug 975774.

I have included a sample use as well.

Change-Id: I1eb50515d837869ed7fdc5e766d8700be7da3286
Cloudpipe tap vpn not always working

Fixes bug 975043

Since Essex, all instances will have an eth0 MAC address in the range
of FA:16:3E, which is near the end of the MAC address space.

When openvpn is started, a TAP interface is created with a random
generated MAC address. Chances are high the generated MAC address is
lower in value than the eth0 MAC address. Once the tap interface is
added to the bridge interface, the bridge interface will no longer have
the eth0 MAC address, but take over the TAP MAC address. This is a
feature of the linux kernel, whereby a bridge interface will take the
MAC address with the lowest value amongst its interfaces. After the ARP
entries expire, this will result in the cloudpipe instance being no
longer reachable.

This fix, randomly generates a MAC address starting with FA:17:3E, which
is greater than FA, and will thus ensure the brige will keep the eth0 MAC
address.

Change-Id: I0bd994b6dc7a92738ed23cd62ee42a021fd394e2
Imported Translations from Launchpad

Change-Id: I1eac99495dc2ed1b23ce12377aa93534ef4eb527
Change Diablo document reference to trunk

Change-Id: I1e43668ec8624f722c32e2ffebc81a387551cebc
Update doc to mention nova tool for type creation

Change-Id: I5ce1b4b7032f6f82dfaa7a8f60139e148a250db8
HACKING fixes, sqlalchemy fix.

Add exceptions to hacking.py make sqlalchemy stuff legal and prevent
clutter.

Change-Id: I44b100b4c0c4dfcec81beea7aba2d8598d5a08d0
Information about DifferentHostFilter and SameHostFilter added.

Change-Id: Ice5f03db5f3d24455c43af86bf5722b863cbe959
Add index to fixed_ips.address

Addresses one of the Critical items in bug #964824

Add migration to add an index to fixed_ips.address to remove a table
scan from active code.

Change-Id: Ic5a56bbddd0d434f8a37ad049753e6d25c7ca760
Give all VDIs a reasonable name-label and name-description

Add image id to cached glance images as well as disk type so it's easy
to see if a VDI is an os, swap or ephemeral disk.

Change-Id: I7c1e21e26a98bd38898483f4230ede3099c6099d
Create compute.api.BaseAPI for compute APIs to use

Fixes bug 960226 where compute.api.HostAPI called non-existent methods

Regression was introduced here:
https://review.openstack.org/#change,5252

Added tests for HostAPI

Change-Id: Id17927bc608ff638ea9b0b5509f0f0bb14503f85
Remove unecessary --repeat option for pep8.

Fixes bug 977489

--repeat became the default in 0.7; since we're now requiring 1.0 or
above, this can go away.

Change-Id: I85ee8ab274594ce96ece6610247dfd8a6f082af5
Merge "Add index to fixed_ips.address"
Merge "HACKING fixes, sqlalchemy fix."