Dis-associate an auto-assigned floating IP should return proper warning

Added new exception class CannotDissociateAutoAssignedFloatingIP and raised
exception instead of return.

Fixes bug 1061499

Change-Id: I348573a235c6b81653837267072b5c48fa15b8af
nova-manage doesn't validate key to update the quota

nova-manage doesn't validate the key value supplied to
update the quota, as a result unnecessary records will be
created in db and user will be under the impression that
quota value got updated.
This patch validates the input value given to the key.

fixes bug 1064359
Change-Id: I9928f30881aa2780a23005b5f69aa67a44f314c5
Pass correct task_state on snapshot.

This fixes an issue where we were not passing the correct task_state to
the compute manager thereby triggering an 'unexpected task-state error'
when the snapshot finished.

This error only manifested itself in multi-cell setups where the
compute-manager and compute-api are using separate DB's and therefore
must rely on the RPC-layer to enforce consistency.

Fixes bug 1065250

Change-Id: Ie07454f0d2075f5c3f2dd53b4e5ff9983ea3241f
Add api samples to simple tenant usage extension

Change-Id: Ib6e00e5c049846146619f52732cd06fefac62494
Revert "Tell SQLite to enforce foreign keys."

This patch broke the unit tests.  (0 tests were being run)

This reverts commit 5b4b7e4083b85bd9c10792cf0adb11dc07e92333.

Change-Id: I9b34a4f12c2c17c8f03899f9d92752ec84068be8
Clean up imports in test_servers

There were a lot of assumed imports in test_servers that were not
explicitly being imported. This makes sure all of the used files
are actually imported and makes the importing of all of the files
consistent.

Change-Id: I07d20c44de7a350465dce91fbbe5ac9fd2426d37
Update run_tests.sh pep8 ignore list for pep8 1.2

Patch I32a8808c6c9cccfedcc4d2a26649333aca1cd713 changed pep8 to 1.2
but did not update the ignore list in run_tests.sh

Change-Id: I9d2cab79197ba3cdd7103d4532e28a999c9454f4
Pass correct task_state on snapshot

This fixes an issue where we were not passing the correct task_state to
the compute manager thereby triggering an 'unexpected task-state error'
when the snapshot finished.

This error only manifested itself in multi-cell setups where the
compute-manager and compute-api are using separate DB's and therefore
must rely on the RPC-layer to enforce consistency.

Fixes bug 1065250

Change-Id: Ie07454f0d2075f5c3f2dd53b4e5ff9983ea3241f
Merge "Update run_tests.sh pep8 ignore list for pep8 1.2"
Merge "Clean up imports in test_servers"
Make sure sleep can be found

Some systems have only /usr/bin/sleep and no links. (like Arch)

Change-Id: I406dd72ba1a4669966ee58e110aee43ddf723b4a
read_deleted snapshot and volume id mappings.

Since the migration that creates the volume_id_mappings and
snapshot_id_mappings tables does not populate the 'deleted' column,
queries to this table should not limit results to 'deleted=0'.
Limiting to non-deleted rows results in duplicate mappings being
created for existing instance mappings after an upgrade, and
throws off volume and snapshot ID to UUID mapping.

This is a stop-gap measure to ensure avoid serious breakage during
an upgrade.  The NULL columns in this table are actually unused
currently and can be populated in later grizzly migrations, if they
end up being used.

Fixes bug 1065785.

Change-Id: I893c994362a203288b9984f0ede24cbb274bfcc5
Migrate DHCP host info during resize

Update instance host to migration_ref['dest_compute'] before
update_dhcp to make its DHCP host info will be written in dhcp-hostsfile.

Make similiar change in finish_revert_resize.

Fixes bug 1065440

Change-Id: I9d3e0ebf8512f98f2943999e7ad95bc58f2bf585
Used instance uuid rather than id in remove-fixed-ip

remove-fixed-ip called db method fixed_ip_get_by_instance. but
fixed_ip_get_by_instance use instance uuid not id, so change to
uuid in remove-fixed-ip.

Fixed bug: #1065899

Change-Id: Ic7526c7e91933424c04be9bb91d4a98cfedd9b01
Implement snapshots for raw backend

blueprint snapshots-for-everyone

Use simple qemu-img convert for raw snapshots.
Polymorphically select snapshot behavior for
raw and qcow2.
Allow images to be constructed from actual device/file path.

Change-Id: I6a57e43c6775c144c41a53382dcc7504ce6d4c43
Make run_tests.sh fail if no tests are actually run

Right now, run_tests seems to report test success if there is a
catastrophic failure early in the process. This can happen if you
have a python file that fails to parse, or if something else in
the test environment setup fails to initialize (such as creating
the empty database for the test run). Nosetests will report
success, but indicate that zero tests were run.

This patch snatches the output of nosetests and, if zero tests
ran, reports to the user that something is broken and offers a few
suggestions.

Change-Id: Ide6fd8b212f0650cb227f60b25d4b4e62ee150ac
Fix imports in openstack compute tests

This makes imports in a number of tests consistent. There were also
various places where files were being stubbed out that werent explicitly
imported. This patch fixes those as well. It also moves compute api
stubbing to stub the actual compute.api.API class instead of
compute.API. Includes a rewrite of test_createserverext to stub the
create method instead of doing a bunch of odd setup with a mock
compute api.

Change-Id: Id8ebb2f65228fafeac69c7ab635ff8909b79c449
Stops compute api import at import time

There is an automatic import of compute.api at import time
whenever anything under compute is imported. This leads to all
sorts of weird dependency problems such as the one here:
https://review.openstack.org/#/c/14170/

This modifies the import to happen when compute.API() is called,
which is how we handle it for network and volume. A few imports
were also modified to make it consistent with this new style.

Change-Id: Ic748376510aa4cc48dfefc6ec36621d0ae498bfc
Merge "read_deleted snapshot and volume id mappings."
Merge "Make run_tests.sh fail if no tests are actually run"