33384 Commits

Author SHA1 Message Date
Matt Riedemann
3c65f3ae0e Force LANGUAGE=en_US in test runs
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
2015-03-03 09:00:05 -08:00
Jenkins
e9200ba51f Merge "Add note on running single tests to HACKING.rst" 2015-03-03 15:55:42 +00:00
Jenkins
6a121c7ac1 Merge "Xenapi: Attempt clean shutdown when deleting instance" 2015-03-03 15:55:10 +00:00
Jenkins
fe1a8fe67d Merge "Support specifing multiple values for aggregate keys" 2015-03-03 14:34:31 +00:00
Jenkins
064849bcf0 Merge "Disables pci plugin for v2.1 & microversions" 2015-03-03 14:33:58 +00:00
Chris Yeoh
45591b6da1 Disables pci plugin for v2.1 & microversions
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
2015-03-03 14:20:42 +10:30
Jenkins
a07bf6dc8f Merge "Imported Translations from Transifex" 2015-03-03 03:27:40 +00:00
Jenkins
f14f1a2c22 Merge "Remove TranslationFixture" 2015-03-03 03:07:05 +00:00
Jenkins
90070af74e Merge "Remove attach/detach/swap from V2.1 extended_volumes" 2015-03-03 03:05:38 +00:00
Jenkins
e95521f5f4 Merge "Replace fanout to False for CastAsCall fixture" 2015-03-03 00:10:06 +00:00
Jenkins
5ad5dcd1ec Merge "libvirt: remove libvirt import from tests so we only use fakelibvirt" 2015-03-02 23:10:49 +00:00
Jenkins
0ebeb26162 Merge "capture stdout and logging for OSAPIfixture test" 2015-03-02 22:23:45 +00:00
Jenkins
ea5f176597 Merge "Switch nova.context to actually use oslo.context" 2015-03-02 20:58:34 +00:00
Matt Riedemann
e12f17460c libvirt: remove libvirt import from tests so we only use fakelibvirt
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
2015-03-02 12:11:39 -08:00
Sean Dague
909ca960d8 capture stdout and logging for OSAPIfixture test
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
2015-03-02 13:27:25 -05:00
Davanum Srinivas
e01e0d7570 Switch nova.context to actually use oslo.context
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
2015-03-02 12:34:47 -05:00
Jenkins
381994f903 Merge "No need to re-fetch instance with sysmeta" 2015-03-02 17:26:13 +00:00
Alexis Lee
8d8b752237 Remove TranslationFixture
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
2015-03-02 16:08:40 +00:00
Sylvain Bauza
567152ba84 Replace fanout to False for CastAsCall fixture
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
2015-03-02 15:46:22 +01:00
Jenkins
18a631ca17 Merge "Display host chosen for instance by scheduler" 2015-03-02 12:05:52 +00:00
OpenStack Proposal Bot
d08cb28b11 Imported Translations from Transifex
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure

Change-Id: I2d26dcbe680fc840eefea55d5e52c7bfcbb15ca3
2015-03-02 06:57:49 +00:00
Jenkins
fb4e2de094 Merge "Enforce in REST API layer on v2.1 api remote consoles" 2015-03-02 05:57:08 +00:00
Jenkins
d6c38457b8 Merge "Make metadata cache time configurable" 2015-03-02 05:11:09 +00:00
Jenkins
a099320c6a Merge "Move v2.1 rescue api policy enforcement into REST API layer" 2015-03-02 04:07:03 +00:00
Jenkins
1cf19a03e1 Merge "linux_net.metadata_accept(): IPv6 support" 2015-03-02 04:05:25 +00:00
Jenkins
9d357dfc66 Merge "Move policy enforcement into REST API layer for v2.1 api evacuate" 2015-03-02 03:32:55 +00:00
Jenkins
8b28ef2521 Merge "Compute: make use of dot notation for console access" 2015-03-02 03:32:34 +00:00
Jenkins
656bca0a48 Merge "Compute: update exception handling for spice console" 2015-03-02 03:32:13 +00:00
Jenkins
4fe7cb5bd4 Merge "Fix tiny typo in api microversions doc" 2015-03-02 01:12:41 +00:00
Sam Morrison
45b385982f Support specifing multiple values for aggregate keys
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
2015-03-02 10:09:45 +11:00
He Jie Xu
7007ab20f6 Remove attach/detach/swap from V2.1 extended_volumes
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
2015-03-01 12:30:52 +08:00
Chris St. Pierre
5a93bfd484 Make metadata cache time configurable
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
2015-02-28 15:13:16 -06:00
Jenkins
0476bed304 Merge "Fixes 500 error message and traces when no free ip is left" 2015-02-28 08:37:59 +00:00
Jenkins
06761269b8 Merge "ensure that ram is >= 1 in random flavor creation" 2015-02-28 04:49:09 +00:00
Jenkins
421bd572e5 Merge "Inherit exceptions correctly" 2015-02-28 04:48:40 +00:00
Jenkins
2a2c4a3744 Merge "Fixes Hyper-V: configdrive is not migrated to destination" 2015-02-28 01:21:05 +00:00
Jenkins
283563ca3d Merge "db: Add index on fixed_ips updated_at" 2015-02-27 23:47:33 +00:00
Joe Gordon
89c8f028e4 Fix tiny typo in api microversions doc
Change-Id: I977a39d20ae1cc39cd6ba98286461732407f830e
2015-02-27 14:34:31 -08:00
Adelina Tuvenie
1c12bb80ec Fixes Hyper-V: configdrive is not migrated to destination
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
2015-02-27 21:26:04 +00:00
Sean Dague
d8d574a32c ensure that ram is >= 1 in random flavor creation
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
2015-02-27 16:15:23 -05:00
Jenkins
cd845661bc Merge "Remove OS-EXT-IPS attributes from V2.1 server ips" 2015-02-27 20:42:05 +00:00
Jenkins
165d37c963 Merge "Remove 'locked_by' from V2.1 extended server status" 2015-02-27 20:41:35 +00:00
Jenkins
92b0adad39 Merge "Remove 'id' from V2.1 update quota_set resp" 2015-02-27 20:41:00 +00:00
Jenkins
f4e3effb72 Merge "Add microversion allocation on devref" 2015-02-27 20:37:10 +00:00
Anand Shanmugam
82bf96fb0b Fixes 500 error message and traces when no free ip is left
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
2015-02-28 00:09:31 +05:30
Paul Griffin
e9f3ad1397 db: Add index on fixed_ips updated_at
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
2015-02-27 06:35:21 -08:00
Ryan Moore
f1b45a2a40 Display host chosen for instance by scheduler
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
2015-02-27 14:17:07 +00:00
Jenkins
983f755562 Merge "Fix bad interaction between @wsgi.extends and @wsgi.api_version" 2015-02-27 14:12:21 +00:00
Ken'ichi Ohmichi
53cad220b5 Add microversion allocation on devref
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
2015-02-27 05:53:05 +00:00
Jenkins
afc2e675d7 Merge "API: Change the API cpu_info to be meaning ful." 2015-02-27 05:32:02 +00:00