9356 Commits

Author SHA1 Message Date
Takashi NATSUME
d069c345a8 Remove unnecessary code
TrivialFix
Change-Id: Ic0d649cc5700d737c18b84ccb019da9120f720d3
2017-07-28 06:01:21 +00:00
Jenkins
4e30bf6ca5 Merge "Move the last_bytes util method to libvirt" 2017-07-27 03:05:13 +00:00
Jenkins
23b88a2c73 Merge "deprecate `wsgi_log_format` config variable" 2017-07-27 02:07:01 +00:00
Jenkins
8636e96c27 Merge "Suppress some test warnings" 2017-07-26 22:36:46 +00:00
Matt Riedemann
478764a348 Fix example in _serialize_allocations_for_consumer
This fixes the json response body for GET /allocations/{consumer_id}
in _serialize_allocations_for_consumer.

Change-Id: I3425267cd1e8563eb89cda83ae1ed07ee782526e
2017-07-26 18:28:49 -04:00
Sean Dague
d16aae9ddb deprecate `wsgi_log_format` config variable
Running under a real wsgi environment, such as uwsgi or apache /
mod_wsgi is preferred now, and there is a different logging solution
for that. This was always an eventlet leaky abstraction. So we'll just
deprecate this for now, and the code can be removed once eventlet on
the API side is removed.

Change-Id: I934a1693cbfd539d8575d022519510d19d13aaab
2017-07-26 21:14:44 +00:00
OpenStack Proposal Bot
7cfe0d977e Updated from global requirements
Change-Id: Ide0ffe532685ac813828f9b4675b39e939c8e2eb
2017-07-26 17:39:03 +00:00
Jenkins
e0bb99fd7b Merge "Using plain routes for the microversions test" 2017-07-26 14:33:25 +00:00
Balazs Gibizer
12a8862c4c Improve assertJsonEqual error reporting
In the notification sample tests big json structures are asserted.
If the difference is only in the number of keys in a dict or in
the number of items in a list then the current assert only states
the number of items. If the list or dict is big it is quite hard to
see what is the missing key or item.

This patch adds more descriptive output to the error message if the
json structures are not equal.

Error message without this patch: http://paste.openstack.org/show/616525/
Error message with this patch: http://paste.openstack.org/show/616526/

Change-Id: Iec15c9ea863db6bbe18afd64bd00a0780798cdf8
2017-07-26 10:22:53 +02:00
Michael Still
fffb1a1ef7 Move the last_bytes util method to libvirt
The only user of this util method is libvirt, so it should live there.
This is a precursor to re-writing its single caller to use privsep to
read bytes instead of chown'ing files.

Change-Id: Ice5cc70eeef3fbeee9a1a0ec0daa801c6f74480c
2017-07-26 08:36:32 +10:00
Chris Dent
1151a0514b Use wsgi-intercept in OSAPIFixture
To lessen the amount of eventlet socket handling present in the
functional tests, run osapi_compute via wsgi-intercept rather than
spawning an eventlet server to run it in a "thread".

To get this to work three main changes are made to the fixture:

* gain access to the wsgi app via Loader().load_app. This is used
  because it involves the least amount of manipulation of CONF. The
  init_application in nova/api/openstack/wsgi_app.py tries to
  re-read configuration.

* manually register the osapi_compute service (previously built
  in as a result of using WSGIService)

* Override the TCPKeepAliveAdapter keystone session adapter. It's
  use of socket_options does not work will with the way that six and
  wsgi-intercept mess with the HTTPConnection class.

The change in integrated_helpers is required because the new fixture
must provide access to the WSGI app in a different way.

Change-Id: Ia91fd7d7605dfb1a6f4376b1680cd26ea410d0f3
Related-Bug: #1705753
2017-07-25 18:20:25 +01:00
Jenkins
3c1d175556 Merge "[placement] Use wsgi_intercept in PlacementFixture" 2017-07-25 17:05:22 +00:00
Sean Dague
8d571261fb Suppress some test warnings
Because we capture stderr during test runs we see warnings that we
have no ability to really impact. 3 of these should just be further
suppressed.

1) Anything dealing with pkg_resources, we consume this through
intermediary layers only, and these warnings have been around forever.

2) Policy enforcement warnings, as is_admin was deprecated well before
there was a transition forward.

3) Anything out of mox3. We're just trying to delete this. No one is
fixing that module as it's effectively dead.

Change-Id: I5eaf953b6a2b0a3efe215f776aa048433b192e90
2017-07-25 15:39:11 +00:00
Chris Dent
9d2c7c28d5 [placement] Use wsgi_intercept in PlacementFixture
Using wsgi_intercept to run the placement API in the PlacementFixture,
instead of spawning an eventlet server. This should help with the weird
situation where sometimes requests that are supposed to go to compute or
placement go to the other.

Some combination of six or wsgi-intercept is not happy with the use of
socket_options in the keystoneauth1.session.TCPKeepAliveAdapter, so a
MonkeyPatch is used to skip over it and use the parent Adapter.

The change here continues to monkeypatch the report client so that we
don't have to monkey patch keystone's auth and endpoint handling. We
don't want that as it will also patch the nova side of things.

Change-Id: I03b3abea152d45575ac6dde22ccbe32b6acb4646
Related-Bug: #1705753
2017-07-25 14:02:49 +01:00
Jenkins
dc67bb8c18 Merge "[placement] Flush RC_CACHE after each gabbit sequence" 2017-07-25 12:19:12 +00:00
Jenkins
b60b9e8664 Merge "Remove check_detach" 2017-07-25 10:40:49 +00:00
Chris Dent
2ecac20b92 [placement] Flush RC_CACHE after each gabbit sequence
Each gabbi yaml file is supposed to be an isolated sequence. The
fixtures were already making sure that the database was wiped, and the
traits sync was reset, but not making sure the _RC_CACHE used to cache
mappings between resource class strings and ids was flushed.

This change clears the _RC_CACHE in the APIFixture stop_fixture method.

For sake of information:
Before fixing the issue it was confirmed by running the two gabbi files
indicated in the bug report, in sequence, in a single process:

    .tox/functional/bin/python -m subunit.run discover \
        nova.tests.functional.api.openstack.placement \
        --load-list /tmp/runthese |subunit-trace

Where runthese contains (with fully qualified package name prefixes):

test_placement_api.allocation-bad-class_allocate_some_of_it_standard.test_request
test_placement_api.resource-class-in-use_delete_resource_class.test_request

Change-Id: Icb3beef7964887f29bf8cca95ac7dbae1511876d
Closes-Bug: #1706207
2017-07-25 01:59:52 +01:00
Jenkins
d193912394 Merge "doc: Populate the 'user' section" 2017-07-24 22:25:10 +00:00
Jenkins
650e866ae8 Merge "doc: Populate the 'reference' section" 2017-07-24 22:13:10 +00:00
Jenkins
d4b9b0b19c Merge "doc: Populate the 'contributor' section" 2017-07-24 22:12:41 +00:00
Jenkins
a5498de5fe Merge "doc: Populate the 'configuration' section" 2017-07-24 22:12:10 +00:00
Jenkins
167ddd1283 Merge "Updated from global requirements" 2017-07-24 15:45:54 +00:00
OpenStack Proposal Bot
a462e646eb Updated from global requirements
Change-Id: I6d428e105c681851010600d0f812c4a317c5c67b
2017-07-23 19:04:10 +00:00
Jenkins
3ac9b36c3a Merge "[placement] cover deleting a custom resource class in use" 2017-07-23 18:30:31 +00:00
Jenkins
3033d5e9c1 Merge "Updated from global requirements" 2017-07-23 17:00:10 +00:00
He Jie Xu
0df4107ffa Using plain routes for the microversions test
Few microversions unittest still depend on the stevedore to load few
fake controller. This patch uses the plain routes to instead of stevedore.

For the unittest can injects routes which are used for test, the `custom_routes`
parameter is added to the APIRouterV21.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I1a7c653ab21be41b1a41f748a35ec9a57dd8b15d
2017-07-23 22:43:53 +08:00
OpenStack Proposal Bot
034a15c0e7 Updated from global requirements
Change-Id: Id58d0ab2058ea4df33e0818f8c44c764a95fcaaa
2017-07-23 13:48:00 +00:00
OpenStack Proposal Bot
76e01cbdb9 Updated from global requirements
Change-Id: I3ce445c2897b42f77034a9d776e152bc503dbdeb
2017-07-22 16:34:36 +00:00
Jenkins
b5bf58704d Merge "[placement] Add api-ref for traits" 2017-07-22 00:30:17 +00:00
Jenkins
5a03438224 Merge "Removed unused 'wrap' property" 2017-07-21 23:23:35 +00:00
Jenkins
39ca38c637 Merge "Remove the unittest for plugin framework" 2017-07-21 21:19:09 +00:00
Jenkins
2f485696cf Merge "Use plain routes list for versions instead of stevedore" 2017-07-21 21:18:12 +00:00
Jenkins
f2b85096fa Merge "doc: Switch to openstackdocstheme" 2017-07-21 20:16:48 +00:00
Jenkins
e763883b1f Merge "Updated from global requirements" 2017-07-21 18:44:54 +00:00
OpenStack Proposal Bot
c9fb778a52 Updated from global requirements
Change-Id: If04709a3b846575aea31543e102be52b82b2cd97
2017-07-21 13:13:46 +00:00
chenxing
10bf786c3e doc: Switch to openstackdocstheme
Change-Id: If7afc2cb58759b16fc6f7caa44d0cf6b7bcf4d06
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
2017-07-21 11:35:48 +01:00
He Jie Xu
4c01c1f584 Remove the unittest for plugin framework
The extension/plugin mechanism is removed from the Nova API. This
patch removed related unittest.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I1c5a1dccb08bd0b869cb206b247d6cb744e76163
2017-07-21 17:39:46 +08:00
He Jie Xu
f7e86c290b Use plain routes list for versions instead of stevedore
This patch adds versions related routes by a plain list,
instead of using stevedore.

After all the Nova API endpoints moves to the plain routes list,
the usage of stevedore for API loading will be removed from Nova

To support the redirection from '' to '/', this patch also
enables to put a target patch instead of a dict with supported
methods in the ROUTE_LIST.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: Iba340c5dd66cf9d006e2e8d3d0674b2140915014
2017-07-21 17:39:46 +08:00
Jenkins
e208fe7989 Merge "Use plain routes list for extension_info instead of stevedore" 2017-07-21 06:35:48 +00:00
Jenkins
3ca8443190 Merge "Use plain routes list for os-snapshots instead of stevedore" 2017-07-21 06:20:27 +00:00
iswarya_vakati
998e5cf1dc Removed unused 'wrap' property
Change-Id: Ic3572343bb7a6c3da68c258e5ff8e363a5be3915
2017-07-21 05:01:21 +00:00
Jenkins
6ae245d8af Merge "Remove improper LOG.exception() calls in placement" 2017-07-21 03:19:55 +00:00
Jenkins
7078c87386 Merge "Fix and optimize external_events for multiple cells" 2017-07-21 00:13:15 +00:00
Ildiko Vancsa
9267767311 Remove check_detach
As part of cleaning up the Nova code base around the Cinder
interaction snippets check_attach was recently removed as Cinder
keeps track of the volume state and performs the necessary checks.
To move forward with the code clean up the other half of these checks
check_detach is proposed for removal due to the same reason.

As we are now introducing the new Cinder attach/detach API in Nova
it is important to make it as straight forward as possible and use
this as an opportunity to clean up the code and remove the parts we
don't need anymore. As part of this activity we are working on to
be able to support volume multi-attach, which will be easier if each
service has their own set of responsibilities.

This patch also handles error translation by catching
InvalidInput exception and raising InvalidVolume to match the former
error handling.

check_detach could also raise VolumeUnattached exception which was
added in preparation to multi-attach support. In case of normal
attach we will hit InvalidVolume before VolumeUnattached, therefore
it is safe to remove that for now. VolumeUnattached is also fully
removed from the code now to stop the status check on volumes
on the Nova side completely.

Change-Id: If63dbd236ce0970ea245707cacb2664e3fdbdfd1
2017-07-20 22:32:52 +02:00
Jay Pipes
8fbb8ba8de Remove improper LOG.exception() calls in placement
The PUT /allocations Placement API handler was improperly calling
LOG.exception() when two normal-operation events were occurring:

1) When a concurrent attempt to allocate against the same resource
providers had occurred

2) When, due to another process consuming resources concurrently
resulted in capacity being exceeded on one or more of the requested
providers

Neither of the above scenarios is a software error and so the
LOG.exception() calls have been removed.

Change-Id: I569b28313e52d979ac9be5bea88c021a0664d851
Fixes-bug: #1705487
2017-07-20 11:58:09 -04:00
Jenkins
3abbfa54c2 Merge "[placement] cover deleting standard trait" 2017-07-20 14:09:23 +00:00
Jenkins
a9cacc5666 Merge "Updated from global requirements" 2017-07-20 12:32:00 +00:00
OpenStack Proposal Bot
ad4b945e46 Updated from global requirements
Change-Id: I7bb8b4ae2c7caa64b31ac64a6e06b516200da64e
2017-07-20 04:10:32 +00:00
Matthew Booth
75e3ad94aa Fix and optimize external_events for multiple cells
server_external_events was previously making an api db query and a
cell db query for every instance reference. We improve this by
making exactly 1 api db query to fetch all instance mappings, and then
1 cell db query per cell to fetch all relevant instances from that
cell. Further, it wasn't properly handling the case where events
were delivered in one request for multiple instances across cells,
which this also fixes.

We also document an obtuse edge condition in
ComputeAPI.external_instance_event which will cause the current code
to break when we support migration between cells.

Note this includes a tweak to the SingleCellSimple fixture to mock out
the new InstanceMappingList method we use, as well as a fix to the other
InstanceMapping mock, which was returning mappings with bogus instance
uuids. This patch relies on the results of those being realistic and
thus requires those changes.

Closes-Bug: #1702959

Co-Authored-By: Dan Smith <dms@danplanet.com>

Change-Id: If59453f1899e99040c554bcb9ad54c8a506adc56
2017-07-19 17:59:26 -04:00
Jenkins
f774a511c1 Merge "Update URL home-page in documents according to document migration" 2017-07-19 17:31:51 +00:00