XenAPI: Refactor Fake to create pools, SRs and VIFs automatically

Required for changing the default SR to be the pool default - see
I116f65ece94f839e63b085480ba4f8974119d2bb
This also fixes some minor bugs in fake.py shown up by the tests

Change-Id: I19fc0747648b97a0912d28008981a84f70107d7b
Use valid IP addresses values in tests

Currently we use strings like 'fake_address', 'localhost', etc
as IP addresses values in DP API tests. This works great when
running tests on SQLite or MySQL backends, where IP addresses
are stored as plain strings. But in PostgreSQL there is a special
column type (INET), which checks inserted values to be valid IP
addresses, so tests fail.

This patch ensures we use valid IP addresses values instead of
arbitrary strings in DB API tests.

Blueprint: db-api-tests-on-all-backends

Change-Id: I2026bab612fcac09b245f6745810b6200f1f2443
Change EC2 client tokens to use system_metadata

An EC2 client token is created as a result of RunInstances. The initial
implementation called create_tags which uses per-instance metadata.
However, we can't update per-instance metadata while an instance is still
building because put the metadata updates in the messaging queue.

We avoid this problem by using system_metadata instead of per-instance
metadata. As an added bonus, users can't tamper with the token via the tags
API.

Fixes bug #1202404

Change-Id: I8ff28d75154a30fe3b521926453b9e9cbdd9fead
Fix HTTP response for PortNotFound during boot

If a non-existent Quantum port is passed as a network parameter during create
instance, Nova API should return an HTTP BadRequest.

Fixes bug #1195468

Change-Id: I5914fda076fdd3ff20c81984364ca725edae1a78
Clarify instance_type vs flavor in nova-manage

Make it clear that we are only using the term flavor now.

Partially implements bp flavor-instance-type-dedup

Change-Id: Ic26349d70fd99a20635f3ae45041c66b300a0513
Use project quota as default user quota

    * Add the missing db_api test cases for user quota.
    * Fixes bug 1205582

Change-Id: Iba8702b4d6d67ef6bb3257a39da3838424d0cd07
Remove fping plugin from V3 API

The fping extension, was introduced in
I7d942270aa52bd6216eda0d7ae366ef0195d52a8.  But this doesn't seem like a
good for nova-api.  We have no other 'instance monitoring' support in
nova and doing it out of the nova-api doesn't seem like the right place.

Change-Id: I3e9bd9b1c04aa06b62f1d3d82b0966e69829a620
Enabled the hacking warning for Py3 compatible octal literals (H232)

Also fixed violations thereof.

Change-Id: I581a33385fc47a6c92c8933e0ed63fd688806c03
Merge "Clarify instance_type vs flavor in nova-manage"
Merge "Use project quota as default user quota"
Merge "Enabled the hacking warning for Py3 compatible octal literals (H232)"
Enabled hacking check for Python3 compatible print (H233)

Also fixed all violators of this check.

Change-Id: Id87ff6f44ab76fc59b18d5da739df475400e1259
Fix 2 pep8 errors in tests

./nova/tests/compute/test_compute_api.py:533:10: H202  assertRaises Exception too broad
./nova/tests/virt/xenapi/test_vm_utils.py:987:10: H202  assertRaises Exception too broad

Change-Id: I86bea27c499f2a8507b3a0ff06d657a109ad811e
Merge "Remove fping plugin from V3 API"
Merge "Fix 2 pep8 errors in tests"
Merge "Change EC2 client tokens to use system_metadata"
Merge "Enabled hacking check for Python3 compatible print (H233)"
Merge "Fix HTTP response for PortNotFound during boot"
Merge "Use valid IP addresses values in tests"
Merge "XenAPI: Refactor Fake to create pools, SRs and VIFs automatically"