Commit Graph

20 Commits

Author SHA1 Message Date
Surya c5788293aa Merge extended_volumes extension response into server view builder
As nova extensions have been deprecated already, the goal is to
merge all scattered code into main controller side.
Currently schema and request/response extended code are there
among all extensions.

This commit merges the extended_volumes extension response into server
view builder.

Partially implements: blueprint api-extensions-merge-stein

Change-Id: I412ccfd5495b088c941a819b5946dc56ed86ae22
2018-09-18 16:54:38 -04:00
Eric Fried 8e1ca5bf34 Use uuidsentinel from oslo.utils
oslo.utils release 3.37.0 [1] introduced uuidsentinel [2]. This change
rips out nova's uuidsentinel and replaces it with the one from
oslo.utils.

[1] https://review.openstack.org/#/c/599754/
[2] https://review.openstack.org/#/c/594179/

Change-Id: I7f5f08691ca3f73073c66c29dddb996fb2c2b266
Depends-On: https://review.openstack.org/600041
2018-09-05 09:08:54 -05:00
ghanshyam f72fa9a739 Remove the deprecated API extensions policies
API extensions policies have been deprecated in 17.0.0
release[1]. This commit removes them.

[1] Ie05f4e84519f8a00ffb66ea5ee920d5c7722a66b
Change-Id: Ib3faf85c78bc2cdee13175560dc1458ddb6cb7a8
2018-08-17 07:11:45 +00:00
Chris Dent def4b17934 Use nova.db.api directly
nova/db/__init__.py was importing * from nova.db.api. This meant that
any time any code anywhere within the nova.db package was imported
then nova.db.api was too, leading to a cascade of imports that may
not have been desired. Also, in general, code in __init__.py is a pain.

Therefore, this change adjusts code that so that either:

* nova.db.api is used directly
* nova.db.api is imported as 'db'

In either case, the functionality remains the same.

The primary goal of this change was to make it possible to import the
model files without having to import the db api. Moving the model files
to a different place in the directory hierarchy was considered, but
given that "code in __init__.py is a pain" this mode was chosen.

This looks like a very large change, but it is essentially adjusting
package names, many in mocks.

Change-Id: Ic1fd7c87ceda05eeb96735da2a415ef37060bb1a
2018-07-10 14:56:27 +00:00
Takashi NATSUME 0d4230edbc Replace mox stubs with stub_out in test_extended_volumes.py
This patch replaces mox stubs with stub_out in
nova/tests/unit/api/openstack/compute/test_extended_volumes.py.

Change-Id: Ia58a5b2bb5b0647c42e34c5f6ac8babc508215c6
Implements: blueprint mox-removal
2018-04-09 07:09:42 +00:00
Surya Seetharaman ea6757092d Make bdms querying in multi-cell use scatter-gather and ignore down cell
This patch makes the querying of bdms from multiple cells in the
_get_instance_bdms_in_multiple_cells function of extended_volumes use
scatter_gather_cells thus making the process, parallel. It also adds
warnings in case a cell is not available; which the operator can later
tweak, if an exception needs to be raised. So for now, cells that are
not reachable are ignored and it proceeds to the next cell.

Change-Id: I0e05eb1e2ad37962968b79100bf4a96c7d6ddd8f
Closes-Bug: #1747650
2018-02-07 11:46:32 +01:00
Takashi NATSUME 0a2f45a5b2 Fix getting instance bdms in multiple cells
In the 'detail' method of ExtendedVolumesController
related to 'GET /servers/detail' API,
multiple cells environemnt is not taken into account
when getting instance BDMs.
So fix it.

Change-Id: I9377e988fbdc822df46e91c0db6c8012697bc2ee
Closes-Bug: #1708210
2017-08-04 10:44:56 -04:00
Jenkins 0f6a01de4f Merge "Remove unused init_only kwarg from wsgi app init" 2017-01-11 04:13:39 +00:00
Matt Riedemann 55df51bd42 Make several API unit tests pass with CONF.use_neutron=True by default
These just all needed trivial stubbing of either the network API
and/or the security group API because of how those are called when
either creating a fake server or getting details for a fake server,
but don't actually have bearing on the API being tested.

Part of blueprint use-neutron-by-default

Change-Id: Iebda83663b742f0d65a3e1f6927bb19a661e926a
2017-01-03 20:59:36 -05:00
Matt Riedemann 46923c7cc9 Remove unused init_only kwarg from wsgi app init
Since d8673cb256 the init_only
kwarg is no longer used in the compute API wsgi app setup.
This patch removes it along with it's usage throughout the
compute REST API unit tests where it was used to isolate
testing of extensions, which is not valid anymore as all
extensions are enabled and we removed the ability to
whitelist/blacklist them.

Change-Id: I2f58b7944d0f7d7c05683238474954a65a617ec3
2016-12-29 21:51:03 -05:00
Andrey Volkov d995e2eb96 Tests: use fakes.HTTPRequest in compute tests
In wsgi controllers tests fakes.HTTPRequest and webob.Request are used.
fakes.HTTPRequest is the descendant of webob.Request defined in nova
test codebase. To have single point of modification it's better to have
common class for controllers tests.

This change replaces webob.Request to fakes.HTTPRequest and updates
blank method signature with respect to actual webob.Request.blank
method.

Change-Id: I043b9cf4426ec1d2c9b178a6ceacb74fc113e21b
Related-Bug: #1610153
2016-08-24 19:03:54 +03:00
Jenkins dbf9bf0703 Merge "Support for both microversion headers" 2016-05-26 12:55:33 +00:00
Chris Dent bd199e3f9b Support for both microversion headers
In this change the new OpenStack-API-Version headers is allowed,
but not required, for requesting a microversion.

Both headers are accepted in the request and both headers are sent in
the response (both the header and its value, and the addition to the Vary
header).

Many tests which explicitly use a microversion header have been
updated to use both. This change is not 100% as most of the tests
are testing the handling of the value of the header, not which
header is involved.

Partially-Implements: blueprint modern-microversions
Change-Id: I68da13b5ba0c2f3357523e765a5b9db81899daf1
2016-05-25 21:41:27 +00:00
Ken'ichi Ohmichi b4c1c9f482 Remove legacy v2 API tests which use wsgi_app()
There is fakes.wsgi_app() for testing legacy v2 API code, but the
method becomes unnecessary. So this patch removes the method and
unit tests which used the method for legacy v2 API.

NOTE: This patch just removes the test of createserverext extension
      which is not documented and not tested with Tempest.
      The extension is not implemented and seems unnecessary legacy.
      Let's remove the test.

Partially implements blueprint remove-legacy-v2-api-code

Change-Id: I0eaa0a9860af7d574a689722785d5d3d614eb0c1
2016-05-25 12:47:09 +09:00
Diana Clarke edd1b9bd2f Replace stubs.Set with stub_out (db)
As part of the ongoing effort to stop using mox, start replacing
the stubs.Set calls with stub_out.

Limit the scope of this patch to the ~400 db stubs.

Part of bp:remove-mox

Change-Id: I449726ede61a18d2c504cf370bebc2b3291fcb04
2016-01-30 17:49:03 -05:00
Diana Clarke 88f406335e Replace stubs.Set with stub_out (fakes)
As part of the ongoing effort to stop using mox, start replacing
stubs.Set calls with stub_out.

Limit the scope of this patch to the following fake functions:

- fake_get_instance_nw_info
- stub_nw_info
- stub_out_instance_quota
- stub_out_networking
- stub_out_nw_api
- stub_out_nw_api_get_instance_nw_info
- set_stub_network_methods
- stub_out_network_cleanup
- unset_stub_network_methods

Part of bp:remove-mox

Change-Id: I70215fb25ef25422786b96d33c91d8f1d4760a23
2016-01-13 22:19:38 -05:00
Davanum Srinivas 4d7a594a1c [python3] Webob request body should be bytes
Enable more tests to work by making sure we use
encodeutils.safe_encode and jsonutils.dump_as_bytes
as needed.

Change-Id: I05de0cd58ee1734df0967bb58082a7e017741c0b
2015-12-28 13:51:29 -05:00
Diana Clarke 110bb30d0f Replace N block_device_mapping queries with 1
The ExtendedVolumes post-processing extension used to do N
block_device_mapping queries (one query per instance in a 'nova list').
Instead, do one block_device_mapping query with an IN clause of
instance UUIDs.

Change-Id: I32a1bd0e05a7a938e531d00bedfab23a0bb68538
Partial-Bug: #1416132
Closes-Bug: #1359808
2015-11-12 12:02:05 -05:00
Dan Smith bbd6fbfbf5 Remove orphaned code related to extended_volumes
This was orphaned code in some other patch a ways back and
is no longer necessary, but confusing in terms of relevance to
the existing code.

Change-Id: I62320663628bf05654ef56209628814917db26c1
Co-Authored-By: Diana Clarke <diana.joan.clarke@gmail.com>
2015-10-01 15:40:38 -07:00
He Jie Xu 74328ce719 Move V2.1 API unittest to top level directory
This patch moves the tests in contrib/ and plugins/v3/ into the
base directory.

Note that some of the tests have both v2 and v21 tests, The v2
tests will be deleted when V2 API removed.

Co-Authored-By: Ed Leafe <ed@leafe.com>
Change-Id: I6ff1d6594e7a44f2bcb6bbb04a4277b98d1cac74
Partial-Bug: #1462901
2015-08-17 11:15:26 +10:00