There are several changes which depend on using mock rather than mox for
unit tests:
https://review.openstack.org/#/c/42474/https://review.openstack.org/#/c/43161/
And the general trend seems to be to move from using mock over mox for
new tests (see blueprint mox-to-mock-conversion).
And given mock is listed in the global-requirements.txt file in the
openstack/requirements project, we should require mock for nova so we
can start using it.
Change-Id: Iaa0f233c28de2f92a237ee6d089858ee10bc6d2f
In _allocate_fixed_ips() and setup_networks_on_host(), we spawn off
green threads to call _rpc_allocate_fixed_ip() and
rpc_setup_network_on_host() on remote network managers, but if there is
an exception in the thread it just gets swallowed.
We don't really need a GreenPool here. It's not like its limit of 1000
threads is relevant here. Just use eventlet.spawn(), collect the list of
threads spawned and call wait() on each of them. This will ensure the
exception gets raised by wait().
Also, fix a case in the v3 integrated servers test where we are setting
up fake networks which are associated with a non-existent 'fake-mini'
host. See also I9854863bbec8834c638c55832411f63da570f82d.
blueprint: oslo-messaging
Change-Id: I7af1c4c1869edf3601809fe02fb82b12c8b70811
Converts calls to compute's prep_resize to pass a new-world instance
object.
This does not convert the scheduler prep_resize method which is still
called on reschedules. It will soon be deprecated anyway.
Related to blueprint unified-object-model
Change-Id: I7a150f119547595aec962d5e5a8d2ab815d0b6c5
Converts the 1 use of conductor migration_create() to use the object
model, instead.
Related to blueprint unified-object-model
Change-Id: I5d8cf38d10d1092f2890b4f381337d188f4a7cf2
This makes the backup and snapshot paths use objects. To make things
cleaner for syncing compute rpcapi and cells rpcapi, the
single snapshot_instance rpc method that was used for both snapshot and
backup has been split into backup_instance and snapshot_instance. The
appropriate cells versions have been added.
The backup and snapshot tests have also been converted into unit tests and
moved into test_compute_api.py.
Related to blueprint compute-api-objects
Change-Id: Ibdaee07290cf8d61c106702aa7068dd308bc9aac
Converts all calls to reset_network to use objects. Also adds the
cells rpcapi methods to match compute rpcapi and ditches the special
cells code in compute/cells_api.py
Related to blueprint compute-api-objects
Change-Id: If4da142864cbe993a7cc852358e3b27bd8c02629
Converts compute_api.lock and unlock to require objects and modifies the
callers to pass them.
Related to blueprint compute-api-objects
Change-Id: Ice8361328cdfeb92207c778beb07b55a9d4eda8d
The revert_resize and confirm_resize compute API methods were previously
converted to accept and use objects. This actually passes them over RPC
instead of their primitive forms.
Implements blueprint unified-object-model
Change-Id: I6dbd5fc0ddcaa37013e885b71aabede92eedf120
We can now call the compute api directly for confirm_resize, so the
conductor method 'compute_confirm_resize' has been deprecated.
This was also the last call to conductor's:
'migration_get_unconfirmed_by_dest_compute'
so it, too, has been deprecated.
Related to blueprint unified-object-model
Change-Id: I57a4898f14d35e97d3a9ed8fd2a99f157c4111a7
This makes the compute_api confirm and revert_resize calls use
and return Migration objects for its work. This also adds the
cells RPC methods needed to support child cells re-calling the
compute API with objects.
Related to blueprint compute-api-objects
Change-Id: I26adc8d2fadc4a31cd0de94887e163040691ede1
This converts the migrate/resize/live_migrate paths to use instance
objects. This also syncs up cells rpcapi and compute task rpcapi so
we can ditch the special cells code in compute/cells_api.py.
Related to blueprint compute-api-objects
Change-Id: I977a5edb8a5313b2a8827796ff8c2bc081f9d63f
If multiple calls that result in initialize_gateway_device() being
run occur at roughly the same time then there is a race between the
ip route commands being run at the same time. This will cause
instances to go into an error state. This commit adds a global lock
to the initialize_gateway_device() method to prevent it from being
run at the same time to avoid this issue.
The race condition is not directly testable in unit tests because it
requires a multithreaded environment to run
initialize_gateway_device() at the same time. It was uncovered
with tempest in parallel.
Fixes bug 1217163
Change-Id: Ib750381636d1341062928d0abc8d3518e327935e
In sqlalchemy nullable defaults to True, so we don't need to explicitly
set the value to the default. By removing all nullable=True everywhere
it makes it easier to spot the nullable=False and also should lead to
less confusion when adding a new column (do I need to add nullable or
not, only some other columns do it)
Change-Id: I22fe2d0caca77005553a6a6f0c7cc2d3e8ea5512
ec2_code attribute with valid EC2 error code was added to several
Nova exceptions to allow simple error code mapping in EC2 API.
Implements: blueprint ec2-error-codes
Change-Id: Ica5cdf4a9662b4b569ded1f1b1931b9a3cdaa9f3
This patch replaces parameter/attribute related raises of EC2APIError
with specific exceptions.
* Introduce new MissingParameter exception with 'MissingParameter'
ec2_code.
* Introduce new InvalidAttribute exception which isn't a valid EC2
error code but it's needed nonetheless as the nova EC2 API isn't
fully compatible.
* Add 'InvalidParameterValue' ec2_code to existing
InvalidParameterValue exception and use it where appropriate. Also
add it to existing InvalidPortRange exception.
Implements: blueprint ec2-error-codes
Change-Id: I7820edfd9045fdc817a8538a754c9add20b68cf4