Fix OS-DCF:diskconfig XML handling

Removes string to bool conversion for the OS-DCF:diskconfig
attribute during XML deserialising as the diskconfig extension
expects a string (MANUAL or AUTO) not a bool.

Fixes bug 1152439

Change-Id: Id9a5c2559a2891c2a21c437c9a5a534b9885c9bf
Fixes instance task_state being left as migrating

In a cross-hypervisor environment, such as KVM + Hyper-v. After negative test
which live migrate a KVM instance to Hyper-v host, there will be an exception
InvalidHypervisorType. As a result, the instance task_state is being
left as migrating. That leaves the instance in a broken state and most of the
requests on the instance will fail.

Actually, there are some other exceptions will cause this issue as well, such
as UnableToMigrateToSelf, DestinationHypervisorTooOld. All of them are thrown
from the driver of scheduler during live migration. But obviously, if the live
migration fails at the schedule stage, the task_state of the target instance
should be updated to None.

Fixes Bug: 1153283

Change-Id: Ide4b48653268c8dbe31de6964814830d2e82a5ba
Remove the usage of instance['extra_specs'].

Instance type extra specs is remove from instance dict, so use inst_type['extra_specs']
instead of instance['extra_specs'].

fix bug #1146253

Change-Id: I1d3542e5142f490269607b779daa507f9d7b36e4
Fix more OS-DCF:diskConfig XML handling

Add handling in the deserialisation code to handle the
OS-DCF:diskConfig attribute in the rebuild and resize actions so
the diskConfig extension can handle it properly. Formerly only
the older auto_disk_config attribute was managed (and incorrectly so).

Fixes bug 1153133

Change-Id: I68479d258cf23083274dd21b1f9eabab2feeb093
LibvirtGenericVIFDriver update for stp

Fixes bug 1129055

The patch will set the stp status as 'off' and the bridge
forwarding delay to 0.

Change-Id: Ie9c96caa797de623ef0b357c61f1b7233a7d869e
Drop gzip flag from tar command for OVF archives

Fixes bug 1154253

Change-Id: I3880d9b187dc25d2ff44fe502eec4d1e0bce4218
Make ssh key injection work with xenapi agent

If there's 'key_data' on an instance, and instance is not Windows, use
file injection to inject /root/.ssh/authorized_keys.  If a user
specifies their own /root/.ssh/authorized_keys via 'injected files',
that will take precedence.

Fixes bug 1152713

Note: Images for Xen that use nova-agent will need to have /root/.ssh
pre-created with modes 0700 on those directories.

DocImpact

Change-Id: I190c6b3f67099061b5316baa45b8bfcd1a5e53f6
Fix issues with cells and resize

There are cases where compute API resizez() is called with 'flavor_id'
as a positional argument, so we need to fix up the cells_api version of
resize() to more closely match the super class.

Also: A recent change for storing instance_type info in system_metadata
happened to make an incorrect change, assuming cells_api was for child
cells.. which it's for the API cell.  It needs to pull the instance type
from the DB just like the super class does.

Fixes bug 1154843

Change-Id: Ifdf2a68c3bff6d27d5f192e2eb73f9b79804c2c7
Check keypair destroy result operation

This checks the result of delete operation over keypairs to see if it
affected any row (this is what delete returns), if not raises
KeyPairNotFoundException.

Also adds tests for keypair db api.

Fix bug 1086980

Change-Id: I7e822c0661c563db01040ae2d57aacfe677d72b0
Make os-services API extensions consistent.

Updates the os-services API extension so that it is consistent
internally (index and update return similar formats), and so
that it works with the recent novaclient code which sends
the following request body format:

  {"binary": "nova-cert", "host": "nova1"}

Also, updates the response body format of the update call so that it
wraps things in an extra service dict which should make novaclient
happier here as well (and is consistent with other extensions too).

Fixes LP Bug #1147746.

Change-Id: I932160d64fdd3aaeb2ed90a092ecc7a36dcc9665
Add missing API doc for networks-post-req.

Part of the os-tenant-networks API extension.

Fixes LP Bug #1155303.

Change-Id: Ic71a3d108f9401ec81d2c59a6f7ba3ec6ab59dd8
Fix: improve API error responses from os-hosts extension

Modify responses to include the actual host instead of %(host)s.

Resolves bug 1154117.

Change-Id: Ic680403bdf1cb1fc1ac184352f486390fb04a195
Make conductor's quota methods pass project_id properly

Commit 652a487ed9daba9ae97f7df77ae35720322d1af3 added a workaround for
project_id on conductor's quota methods. This fully plumbs project_id
through to the manager (and thus the quota implementation) and removes
the tests that verify the workaround.

Fixes bug 1153795

Change-Id: I7cd5e3de39acfaba7831892aff6c754569c8e1bf
Fix exception message in Networks API extension

Raise exception indicating VLAN is disabled when
trying to associate a network w/ a tenant in cases where
VLAN is not the network manager
Added unit test case
Fixes bug 1075790

Change-Id: I3dcac09fbf06d9f64b18cc52d0b069dc9c0a7370
Update migration 153 for efficiency.

Currently migration 153 inserts 10 rows per instance in the database.
For new/small installations this is relatively quick, but for large
installations this can take some time.

This change modifies the migration to only insert records for
non-deleted instances and makes bulk inserts (10 rows are inserted
with each query, instead of 1 per query) for added speed.

Fixes bug 1155371

Change-Id: I88a6cec2c117368fda6eefd82150106a1542027d
Fix db archiving bug with foreign key constraints.

Fixes bug 1137977

A few Nova tables have foreign key constraints on other tables.
Deleting a row whose id is referenced as an enforced foreign key for
another table results in an error.

The fix is to detect the IntegrityError when we attempt to delete a row,
and exit from archive_deleted_rows_for_table early.  The parent
archive_deleted_rows function will continue deleting from other tables,
including the one whose dependence on this row caused the IntegrityError,
and things will eventually sort themselves out.

Change-Id: I0afdfe0778057abc5fd269a20bfa4c4ca3a7b003
Merge "Fix exception message in Networks API extension"
Merge "Add missing API doc for networks-post-req."
Merge "Fixes instance task_state being left as migrating"
Merge "Fix OS-DCF:diskconfig XML handling"