If your native locale is not en_US and you run tests, some will fail due
to the message translation that happens since the assertion messages are
in en_US (not translated, just hard-coded in the tests).
I recreated the bug by setting LANGUAGE=en_GB in my tox.ini and tested
against nova.tests.unit.api.openstack.test_wsgi.
Note that setting LANG=en_US had no effect.
Closes-Bug: #1427745
Change-Id: Ib1c71d0d4170ba1a7ed2fe3eaf0e2d8071ec01d6
The pci plugin was only ever merged into the v3 (now v2.1 microversions)
and never the v2 API. Since v2.1 i meant to be identical to v2 it should not
appear in v2 either.
This change disables the pci api functionality in v2.1. It will be renabled
soon after microversions is enabled using a microversion bump.
Related-Bug: 1426241
Partially implements blueprint v2-on-v3-api
Change-Id: Ifc1d6f24d5a637270154b996087a98b41133e014
Commit 50861d3221f625a5cc589d903054bb2c440b4026 removed libvirt-python
from test-requirements.txt and there have been several bug fixes in the
libvirt tests for stubbing out attributes in the libvirt module used at
test execution time to account for older versions of real libvirt
imported.
This removes the real libvirt imports so we solely test with fakelibvirt
to avoid gaps in version testing.
Related-Bug: #1422385
Change-Id: I2b3bae594e2a99fb07d90ea5ac1b63172927162a
the nova fixtures tests do not inherit from nova/test.py because they
are designed to be consumed by it. As such, more manual setup has to
be done per test. Previously in the middle of a test run the
OSAPIFixture was spewing to stdout. This wasn't caught until a new
subunit-trace was released which passed through uncaught stdout.
Change-Id: Ie02403720406cb0ae51a9f5495fb135e1d01992a
oslo.log uses oslo.context to get the context information.
nove.context does not use the RequestContext from oslo_context,
so when oslo.log tries to find the current context using
oslo_context.get_current() it fails. We should get nova's
RequestContext to inherit from oslo.context's RequestContext
and add test cases to makes sure this works properly.
Closes-Bug: #1427209
Change-Id: I7a02e646b7cebdb0eb72be2d5ad7bfe0743c8f4d
It doesn't work and keeping the code obscures that.
When tox starts up, it seems to import all tests. Many of these import
modules from real Nova. As soon as something imports nova.i18n, the
short translators (_, _LI etc) are produced using oslo_i18n. These short
translators are then imported directly into the namespace of each
module, making them nearly impossible to mock.
We could monkeypatch oslo_i18n.TranslatorFactory._make_translation_func,
but I don't know a reliable way to do that before any test has imported
nova.i18n without touching every test.
Change-Id: Idcc4409edae5ddfa0a1c2052a746d6412dda24ac
In I5f9e74f46e347594103484460e81da46835eeb7e, a new Fixture has been added for
changing oslo.messaging casts to calls. That said, it leads to a point where
fanout casts are then mapped to fanout calls, which are not yet implemented
(and somewhat conceptually hard to consider).
Here, we're asserting that if a fanout cast is made using that fixture, it will
be properly turned into a non-fanout call, which works because there is only
one ServiceManager listening to the topic in the tests.
Co-Authored-By: EdLeafe <ed@leafe.com>
Change-Id: I1febc24ec0c09c3c17511e7ab1f2d7b6a05b6937
Currently the following filters are written as though they support multiple values:
* aggregate_image_properties_isolation.py
* aggregate_instance_extra_specs.py
* aggregate_multitenancy_isolation_filter
* availability_zone_filter.py
This commit adds support to the underlying helper method to support
specifying multiple values separated by a comma.
This change for example allows operators to set multiple tenants by using a comma
separated list.
eg. filter_tenant_id: "tenantid1,tenantid2"
DocImpact:
Closes-Bug: #1413087
Change-Id: I010e85ff4c29171c4be6d7a7209dbf2d55da0b64
V2.1 must be identical with V2 and must not contain any new attributes
and new method. And those methods have same methods in the volumes
extensions. Those methods are added in the early stage of v3 works,
because the in early stage v3 works decides to delete any volume related
proxy API, then adds those method instead of them. This commit remove
these methods from V2.1 API.
Partially implements blueprint v2-on-v3-api
Change-Id: I20e0498ec187e9feafd2bfb1aa9646426b3609af
The metadata cache expiration is now a config option.
New Option:
metadata_cache_expiration - Default 15
Time in seconds to cache metadata objects.
This also adds basic unit tests for the MetadataRequestHandler, which
might be nice to have.
Co-Authored-By: Chet Burgess <cheburge@cisco.com>
Co-Authored-By: Nicolas Simonds <nisimond@cisco.com>
DocImpact
Closes-Bug: 1366139
Change-Id: I4e829ec52cf1445339f325b5895987c82dc7a8f4
When live-migrating an instance with a iso configdrive, that
configdrive is not migrated to the host, even though it is
attached to the instance.
This fix assures that if the instance has a iso configdrive
attached the iso file is also moved during live migration.
Change-Id: Ic8e6b40dcd9a14d5a3fc7f4ef0c5b23c89be599a
Fixes-Bug: 1322096
The random number generator would allow a flavor with ram = 0, which
is invalid, and would cause a test breakage. Always make ram >= 1.
Change-Id: Id7af7d80642e988539b94035951ce7fb5b8c43ad
When trying to attach a network to an instance if there are
no free fixed ips available nova-api presently throws a 500
internal server error.This is because the NoMoreFixedIps is
not handled properly by the attach-interfaces code flow.This
fix handles the exception and returns a bad request to the user.
Change-Id: I870177f51fa7546808c505a1f9476c195c3afaf2
Closes-Bug: #1424594
Adding sqlalchemy code to add an index to the fixed_ips table on
the deleted, allocated and updated_at columns, to speed up the
periodic disassociate_all_by_timeout task
Closes-Bug: #1363119
Change-Id: Iee53b5fd31b56bf1e0dddeada42ee9267b156150
The scheduler is configured to schedule an instance on a host chosen
randomly from a subset of the N best hosts. Where the size of the subset
is defined as 'scheduler_host_subset_size' from the configuration.
In a configuration where the subset is greater than the default (1) the
scheduler does not display where it has scheduled the instance to. It
gives a list of all those that it has weighed - just not the one chosen.
This patch displays the chosen host.
Closes-Bug: 1426364
Change-Id: Ibd7d6dcd67609217d5be5e50fbad130676f403d4
We have discussed how to allocate a microversion for each patch
on nova-api meeting and this patch adds the conclusion on the rst.
Partially implements blueprint api-microversions
Change-Id: I1f23294475d60b219d4167cad1650fd768f868a1