This change fixes a few things with the recently added
"os_interface" option in the [placement] config group.
1. It adds tests for the scheduler report client that
were missing in the original change that added the
config option.
2. It uses the option in the "nova-status upgrade check"
command so it is consistent with how the scheduler
report client uses it.
3. It removes the restrictive choices list from the
config option definition. keystoneauth1 allows an
"auth" value for the endpoint interface which means
don't use the service catalog to find the endpoint
but instead just read it from the "auth_url" config
option. Also, the Keystone v3 API performs strict
validation of the endpoint interface when creating
an endpoint record. The list of supported interfaces
may change over time, so we shouldn't encode that
list within Nova.
4. As part of removing the choices, the release note
associated with the new option is updated and changed
from a 'feature' release note to simply 'other' since
it's not really a feature as much as it is a bug fix.
Change-Id: Ia5af05cc4d8155349bab942280c83e7318749959
Closes-Bug: #1664334
Use comma for splitting resource query in the URL.
But the example does not comply with this rule.
This patch fixes it.
Change-Id: Iecc73b2cdb514bfea970187415319d869e4cf61f
Any time placement API (v1.0) code wants to raise a webob.exc of some kind it
needs to add a json_formatter attribute to the call. This is easy to forget.
This change adds wrapper for webob.dec.wsgify which will set default custom
json error formatter. Resource based actions from placement need to use this
wrapper as decorater instead of webob.dec.wsgify.
In this change, decorator updated for allocations related actions.
Change in other resource handlers can be addressed in subsequent patches.
Change-Id: I3b81c5bd00a013f1659b9e6e80c71b373d965862
Partial-Bug: #1635182
1.As mentioned in [1], we should avoid using
six.iteritems to achieve iterators. We can
use dict.items instead, as it will return
iterators in PY3 as well. And dict.items/keys
will more readable. 2.In py2, the performance
about list should be negligible, see the link [2].
[1] https://wiki.openstack.org/wiki/Python3
[2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html
The patch list:
tests.
Partial-Implements: blueprint replace-iteritems-with-items
Change-Id: I2d09c1d06370fed9c7c116a9eedea929fa5b5dc2
Some place in Nova, return value has unnecessary parentheses,
or return keyword is not followed by a space when returning a value,
which is a bad format and might be ambigous. For example:
return(1)
return{
'a': 1
}
As noone would write returns like:
return1
return'(empty)'
In this patchset we get rid of this bad formation.
Also, I've added a hacking rule which helps to prevent this in future.
TrivialFix
Change-Id: I4ff85d0240bf8719188ebd06fc0e98a81c1d1203
Normally we reserve five slots for the API database instead of the default
ten. However, given all the stuff that merged in Ocata related to API-level
services, I'm going to reserve ten here just so we have space if we need
it.
Change-Id: I57c2edcf1fb80e24017cb1b4be00065aa20b342c
This removes a couple short circuits around instance cell mapping,
which were in place for pre-cellsv2 code. Now, they defeat some of
our atomic logic around what should be done in and around deletes.
These were TODOs to remove once people had to be on cellsv2, which
is now the case.
Note that the api samples tests were depending on these in order to
work at all (which is a good demonstration of why they need to
be removed). This patch also extends the SingleCellSimple fixture
with a couple more mocks to make them happily take the same path
as the rest of the code. Since the default in that fixture is
now to make instances look mapped all the time, we also need a flag
so the tests that check for yet-to-be-mapped instances can still
function.
Related-Bug: #1660878
Change-Id: I7eb4b41fd2f33e8a63e329adbafc47d149e31552
This patch exposes the "interface" option for ks_filter to allow
the placement API to be connected on a specific endpoint interface.
The previous was to force "public", which is default for keystoneauth.
The default for the placement service mirrors this value.
Change-Id: Ic996e596f8473c0b8626e8d0e92e1bf58044b4f8
Some operators would like instance starts to fail if we cannot
fetch dynamic vendordata. Add an option to do that.
Change-Id: I0c31465c5c52cd4c7e4bb229a4452bc4c8df0e88
We should use a service account to make requests to external
vendordata services. This something which we got wrong in the
newton cycle, and discussed how to resolve at the ocata summit.
It is intended that this fix be backported to newton as well.
There is a sample external vendordata server which has been
tested with this implementat at:
https://github.com/mikalstill/vendordata
Change-Id: I7d29ecc00f99724731d120ff94b4bf3210f3a64e
Co-Authored-By: Stephen Finucane <sfinucan@redhat.com>
The check and subsequent hard failure for HostMapping records in
API migration 30 is inconvenient at times during a new setup where
we have flavors in place but no hosts yet. Since we can now check
for and warn about missing HostMapping records in our upgrade
status command, this patch lowers the lack of host mappings check
from a failure to a warning. This migration was really just to make
sure you ran the simple setup command, and the cell mapping check
does that for us.
Change-Id: I8b757fa7c805ec6f4d578ecb6f33d3f1ceff29fc
The api_samples tests depend on a very static environment where
we use the SpawnIsSynchronous fixture. This is somewhat at odds with
the locking used in the CellDatabase fixture, which will necessarily
recurse at times. Since the api_samples tests are already a bit naive
in the service layout, and since they don't care about cells things,
we do some monkeywork here to make them use the SingleCellSimple
fixture instead of a full-blown multi-cell environment.
Change-Id: If1138331f3a46f5aed87e898ce19879a787d435f
This makes compute API's instance listing routines access and compile
the list of instances across all cells.
Related to blueprint cells-scheduling-interaction
Change-Id: I37b5af1e02e2288340378944e77c110268a59a8d
Depends-On: I3c9101a34b2bb0804fc4deda62dbb8637e7b8f94
We recently merged something adding a version argument for the get method of the
SchedulerReportClient. We should add that feature into the PlacementFixture.
Also adding a comment explaining why we need to mock up the report client.
Change-Id: I918b84a0f19d56fe9aa2164c1c7ab679e7535769
Some of the functional tests are calling the scheduler for getting the destination.
Once we will accept having the scheduler be calling the Placement service in order
to know a list of valid resource providers, we will need to run a local fixture
for having those tests faking the Placement service.
Change-Id: I6883888bf5d1920ab57dbf3dcaa1a7b375591754
This patch adds a map of provider UUID to a set of aggregate UUIDs for
each resource provider the scheduler report client knows about. We call
the new 1.1 placement API microversion to grab the list of aggregates
associated with a provider. The code currently isn't highly efficient;
we call the placement REST API each time _ensure_resource_provider() is
called. The alternative to this is to require operators to restart their
nova-compute workers in order to have aggregate information picked up
when providers are associated with aggregates.
Change-Id: I8474d4d7a46c8bc42eb6e97c2403e2bd7716012e
blueprint: generic-resource-pools-ocata