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
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
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
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
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 OS-DCF:diskconfig XML handling"
Reset migrating task state for more Exceptions

There are a number of exceptions that can occur during pre
live-migration checks, and they should reset the task state to None when
they occur since they prevent the migration from beginning.  This adds
two more exceptions to the list of exceptions that just need to reset
the task state rather than set the instance to error.

Bug 1100462

Change-Id: I95e09f49908fbc3a79f5d2eb490d5a0b3296a6ed
Merge "Drop gzip flag from tar command for OVF archives"
Merge "Fix: improve API error responses from os-hosts extension"
Merge "Make conductor's quota methods pass project_id properly"
Merge "Make os-services API extensions consistent."
Merge "Fix db archiving bug with foreign key constraints."
Revert 1154253 causes XenServer image compat issue

In 1154253 we:

  Drop gzip flag from tar command for OVF archives

While support more OVF file formats is a worthy goal the approach
in 1154253 is going to cause serious issues for existing
Nova XenServer users who are already zipping their OVS images.

I would also point out that our utils.py xenserver plugins still
zips tarballs we create (see create_tarball) so the new code
causes internal inconsistencies as well.

This should fix SmokeStack.

Fixes LP Bug #1155783.

Change-Id: Iff6db314c0dec6df2e48d98db2a547f6624b9d9a