9356 Commits

Author SHA1 Message Date
Dan Smith
040b5a674a Add db.instance_get_by_sort_filters()
This adds a method to the DB API that lets us query out the next
instance for a sort query, but without a marker UUID. If the marker
is from another cell, we'll need to resume the pagination sequence
based on the sort keys and the values from the marker instance.

This adds the method and a test to be used later.

Change-Id: Ib0e63ec0dd12c2feff562311bd7f69234cf43a1b
2017-09-21 08:01:41 -07:00
Jenkins
d29e4e1ec5 Merge "[placement] Unregister the Trait object" 2017-09-18 13:07:27 +00:00
Jenkins
d646ee6a2a Merge "[placement] Unregister the TraitList object" 2017-09-18 10:10:21 +00:00
Chris Dent
d947b286aa [placement] Unregister the Trait object
Unregister the Trait object because we do not need RPC and
versioning for the objects in nova.objects.resource_provider.

There are two primary changes here:

* unregistering the Trait class
* where objects.Trait is used, point directly to the
  nova.objects.resource_provider package instead

Partially-Implements: bp placement-deregister-objects
Change-Id: I73e08aba095d843b59f73cf2ce8d8d4801740ed2
2017-09-15 16:49:45 +01:00
Chris Dent
fcf4b829eb [placement] Unregister the TraitList object
Since we don't use RPC in placement and intend to never use RPC in
placement it makes little sense to register the resource provider
objects and keep track of their versions. They still need to be
activated as structured objects to get their fields set and properly
inherited.

Tests of versioned objects inspect the dependency trees of objects that
have other objects as fields so this process starts with the TraitList
object. Nothing depends on it. In subsequence patches the other objects
will be unregistered.

There are two primary changes here:

* unregistering the TraitList class
* where objects.TraitList is used, point directly to the
  nova.objects.resource_provider package instead

Partially-Implements: bp placement-deregister-objects
Change-Id: If284b7d595a7dd214a5cd3a322419074dcf0373e
2017-09-15 16:49:45 +01:00
Matthew Treinish
41979125e7 Add single quotes for posargs on jobs
People seem to hate the idea of using tox -epy27 -- foo to use a
test regex so add single quotes around posargs to make it so you can
just do tox -epy27 foo again.

Change-Id: I12c5d2dc78db3bc8954ff420492115ff53c42703
2017-09-15 11:15:06 -04:00
Jenkins
f390632d7a Merge "Target context when setting instance to ERROR when over quota" 2017-09-15 01:50:28 +00:00
Jenkins
b2ca657cb4 Merge "Cleanup running of osprofiler tests" 2017-09-14 00:53:24 +00:00
Jenkins
4270fe81a1 Merge "Fix test runner config issues with os-testr 1.0.0" 2017-09-14 00:52:57 +00:00
Matt Riedemann
bada6eb2d9 Target context when setting instance to ERROR when over quota
When conductor does the quota recheck, the instances are created
in a cell but when we update the instance and set it to ERROR state,
we were not targeting the context to the cell that the instance lives
in, which leads to an InstanceNotFound error and then the instance
is stuck in BUILD/scheduling state.

This targets the context to the cell when updating the instance.

Change-Id: I45faffaba4d329433a33cfb5e64c89ce4885df46
Closes-Bug: #1717000
2017-09-13 18:45:28 -04:00
Jenkins
f5e2c4cf1f Merge "Fix missed chown call" 2017-09-13 22:10:16 +00:00
Matthew Treinish
190b48ebcd Cleanup running of osprofiler tests
Now that we're using stestr directly we have more flexibility on how we
run the osprofiler tests. This patch makes it run second without test
discovery and combines the subunit output with the results of the
previous full test run.

Change-Id: I49db096dd3056a4fd2ec6e6603b59e70a8d25480
2017-09-13 17:22:19 -04:00
Matthew Treinish
29f76e972a Fix test runner config issues with os-testr 1.0.0
The os-testr 1.0.0 release had a couple of required config changes due
to it's internal usage of stestr. This commit fixes those by adding a
.stestr.conf (to remove a warning) sets the fixture env variables in
the tox.ini instead of being hidden in .testr.conf and removing the
quotes around posargs to make passing args to ostestr actually work.
Also to keep the expected dev experience stestr is used directly for
places where ostestr was called directly.

Change-Id: Ib0fbcb2e7710a6b8219c56ef2a4462c61ea498a9
2017-09-13 17:11:57 -04:00
Michael Still
ac1d84fd89 Fix missed chown call
When privsep'ing chown calls, this one was missed. Fix that.

I think this entire method should go away, but it will break at least
one of out tree driver. I'm talking to the powervm guys about a way
forward there.

Change-Id: I8a9bda36728896e60b13c32afda0a7130664cb7b
Closes-Bug: #1716718
2017-09-14 03:01:42 +10:00
OpenStack Proposal Bot
96180c0080 Updated from global requirements
Change-Id: I043babceb3b1be03550c8e90c9abb9450d5f5cde
2017-09-13 12:57:19 +00:00
Jenkins
d71e870dd1 Merge "Revert "Revert "Fix AZ related API docs""" 2017-09-11 20:16:00 +00:00
Sean Dague
d2c8d41878 Revert "Revert "Fix AZ related API docs""
Fix AZ related API docs

While we have a big fat comment in the development docs explaining why it's so
terrible to use default AZ values for either booting an instance or setting
an aggregate AZ metadata, we still have confusing API docs that provide the
wrong name for the AZ...

Fixing that and trying to explain the problem within the docs, too.

This reverts commit 92ca21abd61b6df7fc8bc5ffe7502f03b3eca2dd.

Co-Authored-By: Sylvain Bauza <sbauza@redhat.com>
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>

Change-Id: Ie4bfe32bbef0f8060bfc0ad4190f262d4a8bd3b2
2017-09-10 13:51:47 -06:00
Jenkins
d71c0fca91 Merge "Revert "Fix AZ related API docs"" 2017-09-10 17:17:00 +00:00
Chris Dent
cdb7bed0ae Revert "Fix AZ related API docs"
This reverts commit 71a7eda44b6da00c05bd3e136d0465086c30e721.

This is breaking the gate due to the change in the az name.

Change-Id: Idd7d1aab113f3d4aba8b1deb6e5dc3871a75aa29
Closes-Bug: #1716247
2017-09-10 16:32:59 +00:00
Jenkins
a4901fbb0d Merge "Fix AZ related API docs" 2017-09-09 03:04:14 +00:00
Jenkins
a4c917123d Merge "[placement] api-ref GET /traits name:startswith" 2017-09-08 21:29:24 +00:00
Sylvain Bauza
bbb5d4e969 Fix AZ related API docs
While we have a big fat comment in the development docs explaining why it's so
terrible to use default AZ values for either booting an instance or setting
an aggregate AZ metadata, we still have confusing API docs that provide the
wrong name for the AZ...

Fixing that and trying to explain the problem within the docs, too.

Change-Id: I811d0f219142ca435b2b206e9b11ccd5ac611997
Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
2017-09-08 16:21:54 +01:00
Jenkins
e995bd5cea Merge "Typo error about help resource_classes.inc" 2017-09-08 14:28:09 +00:00
Jenkins
21981293c5 Merge "Set regex flag on ostestr command for osprofiler tests" 2017-09-08 14:10:09 +00:00
kangyufei
b871bda935 Typo error about help resource_classes.inc
Change-Id: I6e61aadecc80f87cd75c1331ab2f725583e9966b
2017-09-08 11:03:00 +08:00
Jenkins
be71484d14 Merge "Fix broken URLs" 2017-09-08 02:17:18 +00:00
Matthew Treinish
0566870b9f Set regex flag on ostestr command for osprofiler tests
In the unit test tox jobs we run the whole test suite first and after
that exits successfully we also run the osprofiler tests while setting
an osprofiler env variable to enable osprofiler. However the regex isn't
being set properly in ostestr, you set the selection regex with the
--regex flag. [1] This only works by chance because ostestr will pass
any unrecognized args to the subprocess used to run testr internally,
and testr leverages that as a regex. But in the latest os-testr release
it doesn't subprocess internally anymore and this doesn't work. This
commit fixes things to properly set the regex in ostestr so it works in
both old and new versions.

The order of the test runs is also switched because we capture the last
test run's subunit for openstack-health and other analysis, so we want
to full test run to be used for this.

[1] https://docs.openstack.org/os-testr/latest/user/ostestr.html#test-selection

Change-Id: I890505d65ca6043ddbdcc5895f2620391b505756
2017-09-07 15:30:36 -04:00
Jenkins
432f2bef3b Merge "Allow setting up multiple cells in the base TestCase" 2017-09-07 17:04:17 +00:00
Andreas Jaeger
52c57ca2b8 Fix broken URLs
Fix broken nova URLs that linked to the old developer/nova places and
use the new link instead.

Change-Id: Ideb50626e140201dded19fc82584440f1a407e47
2017-09-07 15:42:31 +02:00
Matt Riedemann
0010e98bbd Allow setting up multiple cells in the base TestCase
This lays the groundwork for other tests to get multiple
cells setup in the base TestCase by overriding a variable.

Change-Id: Ic27369dd3711e5b6bf11c98f742b5dc20a3a2799
Related-Bug: #1715493
2017-09-06 21:31:28 -04:00
Jenkins
73ac2bfa4b Merge "First attempt at adding a privsep user to nova itself." 2017-09-06 21:45:31 +00:00
Jenkins
253cd51bbe Merge "doc: Add configuration index page" 2017-09-06 19:08:30 +00:00
Jenkins
29aeb370d2 Merge "doc: Add user index page" 2017-09-06 19:07:43 +00:00
Michael Still
72d262a368 First attempt at adding a privsep user to nova itself.
I don't particularly care about this use case (although the localfs
code should perhaps go away), but it was a nice contained example
of a privsep user which wasn't just calling a command line.

This patch also starts to layout what an API to the privsep'd code
might look like. For now its modelled on python's os module, because
that's where all the operations we perform are coming from.

The rootwrap configuration is cleaned up as we remove users.

Co-Authored-By: Tony Breeds <tony@bakeyournoodle.com>
Change-Id: I911cc51a226d6af29d63a7a2c69253de870073e9
2017-09-07 03:01:01 +10:00
Jenkins
6eb8456740 Merge "trivial: Remove some single use function from utils" 2017-09-06 16:08:16 +00:00
Stephen Finucane
669d5c75cd doc: Add configuration index page
Change-Id: Ic318e04be73639de7d26e53e1f0b152d9803fd2f
2017-09-06 14:40:17 +01:00
Stephen Finucane
a83e491eb1 doc: Add user index page
The idea is that each guide should be self contained, even though we can
link between them. Enforce this by duplicating a lot of the content from
the main index page to the user index page.

Change-Id: I160fed0f1b507eba7958666bf38f4138b0f62b3a
2017-09-06 14:40:17 +01:00
Jenkins
7930d25422 Merge "Add uuid online migration for migrations" 2017-09-06 06:40:14 +00:00
Jenkins
6215df0c7d Merge "Updated from global requirements" 2017-09-05 18:57:40 +00:00
OpenStack Proposal Bot
208daec742 Updated from global requirements
Change-Id: I9de10bb5188ad778f06bb59e7f08f2b49089c1da
2017-09-05 12:19:55 +00:00
Matt Riedemann
21fe32d080 doc: link to versioned notification samples from main index
Notifications are essentially another API for end users, but
it can be hard to find the list of existing notifications or
their samples which are buried deep down via contributors >
technical reference deep dive > notitfications. If I'm an
end user, I'd like to just see them in the same set of links
on the main page as the API, under the "For End Users" section.

Change-Id: If3ca21b080d06a291ed27c9bcd84a566164c3b70
2017-09-01 14:10:14 -04:00
Matt Riedemann
4c1f2b1b83 doc: link to placement api-ref and history docs from main index
Now that we have a placement api-ref getting published, we
should link to it like we do for the compute api-ref. This
also links in the placement microversion history for consistency.

Change-Id: Id0c70486c5a72a4d6794d80d350a45a5f356ca37
2017-09-01 14:10:14 -04:00
Eric Fried
1aa57ede98 [placement] Update user doc with api-ref link
The Placement API user guide [1] mentions a not-yet-available REST API
reference which has since become available [2]; update with the link.

[1] https://docs.openstack.org/nova/pike/user/placement.html#api-reference
[2] https://developer.openstack.org/api-ref/placement/

Closes-Bug: #1714284
Change-Id: Ic368327aa4a81f4217aecb4af3d9358502676234
2017-08-31 10:30:03 -05:00
Eric Fried
6bcda0e997 [placement] api-ref GET /traits name:startswith
In the Placement API reference, the GET /traits [1] query parameter
'name' says it accepts a key called 'starts_with'. The actual API
accepts 'startswith' (no underscore).

[1] https://developer.openstack.org/api-ref/placement/#list-traits

Change-Id: I5a1fa51fc751f2492ae6aa2b38893a9e06a26ed1
Closes-Bug: #1714283
2017-08-31 10:27:39 -05:00
Jenkins
b1e05cc700 Merge "[placement] Require at least one resource class in allocation" 2017-08-31 07:00:41 +00:00
Jenkins
b95f53a970 Merge "[placement] Add test for empty resources in allocation" 2017-08-31 06:01:46 +00:00
Chris Dent
35b9dcf776 [placement] Require at least one resource class in allocation
If an allocation was made with an empty resources object, a 500 response
code would result. This change adjusts the schema to use minProperties
of 1 to say there must be at least one resource class and value pair in
the allocation. If there is not a 400 response is returned.

As this is fixing 500 response to a useful error, no microversion is
required. A previous gabbi file which demonstrated the problem has been
updated to demonstrate that the problem has been fixed.

Change-Id: I7d9c64c77586564fb3bdbe92c693bd2a1bc06f24
Closes-Bug: #1714072
2017-08-31 00:38:42 +00:00
OpenStack Proposal Bot
ff568a8c18 Updated from global requirements
Change-Id: I197925602a5b76cad961cc3cb2eebb67c0ea82bf
2017-08-30 23:26:21 +00:00
Chris Dent
5cbb9e9c57 [placement] Add test for empty resources in allocation
If the resources object in an allocation request is an empty dict then
there will be a 500 deep in the belly of the AllocationList object
handling when it tries get a information. The patch demonstrates the bug
with a new gabbi test that verfies the 500. The next patch will fix it.

Change-Id: I5ab417e39044af63fb9acb57c48c087ecf1e6f04
Related-Bug: #1714072
2017-08-30 20:19:31 +01:00
Jenkins
7602735374 Merge "Improve assertJsonEqual error reporting" 2017-08-29 06:10:25 +00:00