8361 Commits

Author SHA1 Message Date
Jenkins
5654045ccb Merge "Always use python2.7 for functional tests" 2016-10-12 11:30:58 +00:00
melanie witt
6cf0d65fe2 Always use python2.7 for functional tests
The functional testenv doesn't work with python 3.x on our codebase.
If someone is on a platform that defaults to python => python3,
functional tests will fail for them.

Closes-Bug: #1632521

Change-Id: I7bf6653f55c10d0a4f75054e519edf7da19c5c09
2016-10-12 00:02:50 +00:00
Jenkins
265bfba54a Merge "placement: add new resource_classes table" 2016-10-11 22:35:36 +00:00
Jenkins
30c5e28712 Merge "Add swap volume notifications (start, end)" 2016-10-11 17:56:06 +00:00
Jenkins
1301f1df30 Merge "Add a hacking rule for string interpolation at logging" 2016-10-11 17:55:32 +00:00
Jay Pipes
634b59c73a placement: add new resource_classes table
We will store custom resource classes in the new resource_classes table.
These custom resource classes represent non-standardized resource
classes. Followup patches add the plumbing to handle existing
standardized classes currently using the fields.ResourceClass field type
and to perform CRUD operations against a /resource-classes REST API
endpoint.

Change-Id: I60ea0dcb392c1b82fead4b859fc7ed6b32d4bda0
blueprint: custom-resource-classes
2016-10-11 12:30:44 -04:00
Takashi NATSUME
ab8382ffa1 Add swap volume notifications (start, end)
Add the following notifications when swapping volumes.

* 'instance.volume_swap.start'
* 'instance.volume_swap.end'

A subsequent patch will add 'instance.volume_swap.error'.

Change-Id: Ic4d9d25bdc611221157e4663817e918b8d667ce9
Implements: blueprint add-swap-volume-notifications
2016-10-11 19:17:23 +09:00
Takashi NATSUME
5bcab383ba Add a hacking rule for string interpolation at logging
String interpolation should be delayed to be handled
by the logging code, rather than being done
at the point of the logging call.
So add the following hacking rule for it.

- [N354] String interpolation should be delayed at logging calls.

See the oslo i18n guideline.

* http://docs.openstack.org/developer/oslo.i18n/guidelines.html

Change-Id: Ief6d3ee3539c0857098fffdb7acfeec3e0fed6eb
Closes-Bug: #1596829
2016-10-11 08:39:48 +00:00
Jenkins
a57b8438ff Merge "Tests: fix a typo" 2016-10-11 07:38:43 +00:00
Gary Kotton
c1579af1aa Tests: fix a typo
TrivialFix

Change-Id: I83ea75257d5b900a37f024fe29427d33c4f2b17e
2016-10-10 00:45:11 -07:00
Jenkins
fb0ed6dc45 Merge "[placement] reorder middleware to correct logging context" 2016-10-07 12:11:29 +00:00
Jenkins
90363b02f4 Merge "[placement] Allow both /placement and /placement/ to work" 2016-10-07 12:10:49 +00:00
Jenkins
d22488d6e1 Merge "[placement] ensure that allow headers are native strings" 2016-10-07 12:09:26 +00:00
Jenkins
71211e75a4 Merge "Move notification_format and delete rpc.py" 2016-10-06 20:56:47 +00:00
OpenStack Proposal Bot
3404cc854d Updated from global requirements
Change-Id: Ib4348d9d2aa75cb93fd77d10bafd8e8268f22756
2016-10-06 16:59:36 +00:00
Jenkins
b0b88d2587 Merge "Fix periodic-nova-py{27,35}-with-oslo-master" 2016-10-05 18:27:22 +00:00
Jenkins
74fd283b07 Merge "Unwind circular import issue with api / utils" 2016-10-05 15:57:24 +00:00
Jenkins
50d1457edd Merge "Updated from global requirements" 2016-10-03 16:51:42 +00:00
Jenkins
5320e733bb Merge "Remove context object in oslo.log method" 2016-10-03 14:52:20 +00:00
OpenStack Proposal Bot
43046c2ac2 Updated from global requirements
Change-Id: I277c18ef272b4e3c73d3eaa13937de7fd934dd0e
2016-10-02 20:16:53 +00:00
Jenkins
f293a1af19 Merge "Updated from global requirements" 2016-09-30 18:57:00 +00:00
OpenStack Proposal Bot
9fdbb57bf7 Updated from global requirements
Change-Id: I6563d3d3a42882ad02239448d3b09aa85c0a0c13
2016-09-30 10:21:30 +00:00
Jenkins
1552f6f965 Merge "Remove stale pyc files when running the cover job" 2016-09-30 10:17:26 +00:00
Andreas Jaeger
a0f3b6d9cb Fix periodic-nova-py{27,35}-with-oslo-master
The jobs periodic-nova-py27-with-oslo-master and
periodic-nova-py35-with-oslo-master are failing with:
"tox.ConfigError: ConfigError: substitution key '34,35' not found".

For details, see
http://logs.openstack.org/periodic/periodic-nova-py27-with-oslo-master/c01eab1/
http://logs.openstack.org/periodic/periodic-nova-py35-with-oslo-master/c10b034/

Fix this with not using a clever "py{34,35}" substitution in tox.ini and
instead duplicate the line.

Change-Id: If10fa53fff85350234ac1308505c273cde1333a1
2016-09-30 09:00:37 +02:00
Jenkins
dce330b0e6 Merge "Use gabbi inner_fixtures for better error capture" 2016-09-29 22:25:07 +00:00
Chris Dent
99d98e8280 Use gabbi inner_fixtures for better error capture
Upgrade to gabbi 1.26.1 to use the new inner_fixtures feature to
capture log and stdout/stderr per individual test request. The
existing nova fixtures are used for the capture.

Depends-On: Ic13dc14f62334aefbcced93872ec564cab157898
Change-Id: Ic6f5a50df37b4680a60c4aa94f7587aec232c367
2016-09-29 11:53:18 +00:00
Jenkins
e85795bcbb Merge "Updated from global requirements" 2016-09-29 03:10:07 +00:00
OpenStack Proposal Bot
582b5511ef Updated from global requirements
Change-Id: I76fbd2fd7164ad837fa782161a3e9a8f84ac0e79
2016-09-29 00:08:21 +00:00
Chris Dent
cfea1845df [placement] reorder middleware to correct logging context
The initial bug was that the initial 'Starting' log provided by
requestlog had a different request id from the rest of the log
messages for the same request. The initial assumption was that this
was because a request id was not initially available, causing one
to be generated for the first log entry that later was replaced
by the request id middleware.

In the process of debugging that it became clear that the id was
in fact the request id of the previous request because the context
was being reused under the covers in oslo_log and olso_context.

Therefore the auth, context and request id middlewares are now
changed to be active in the middleware stack before the request log
middleware. The unfortunate side effect of this is that the Starting
message and final request logging is no longer actually bounding the
full request: it misses three critical middlewares.

Change-Id: Ifa412973037193e4e67a0c9d2c71c7a4847980a9
Closes-Bug: #1626493
2016-09-28 21:13:00 +00:00
Matt Riedemann
5ca6fb9266 Remove stale pyc files when running the cover job
The cover job runs the unit tests and having stale
pycs can skew those results, so remove the pyc files
before running the tests with --coverage.

Change-Id: I7393d2df36e715dbf53ba9ae6a077bdc8e79b5a5
2016-09-28 11:27:38 -04:00
Jenkins
be31407cfc Merge "Fix a few typos in API reference" 2016-09-28 12:05:47 +00:00
Chris Dent
4e85f9f712 [placement] ensure that allow headers are native strings
mod-wsgi checks that response header values are what's described
as "native strings". This means whatever `str` is in either
python 2 or 3, but never `unicode`. When they are not mod-wsgi
will 500. For the most part this is taken care of by webob, but in
the case of the 405 handling, the webob response is not being
fully massaged.

mod-wsgi is doing this because it supposed to. Python WSGI server
gateways have different expectations of headers depending on whether
the Python is 2 or 3. See

https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types

In addition to the unit test, the gabbi tests are now using a
version of wsgi-intercept that will raise a TypeError when the
application response headers are not using the correct form. This
check needs to be done in wsgi-intercept rather than the gabbi tests
because both wsgi-intercept and the http client makes requests
transform the headers for their own purposes.

This fix ensures that instead of a 500 the correct 405 response
happens.

Closes-Bug: #1626496
Depends-On: I3b8aabda929fe39b60e645abb6fabb9769554829
Change-Id: Ifa436e11e79adc2e159b4c5e7d3623d9a792b5f7
2016-09-28 09:40:39 +00:00
Hironori Shiina
cf8f6afe12 Fix a few typos in API reference
Change-Id: Ib90100f4ec6b4b03f27ed39166caeb9bdf5bc24c
2016-09-28 14:34:23 +09:00
Dan Smith
411113a2dd Archive instance-related rows when the parent instance is deleted
This is something I expect has been very broken for a long time. We
have rows in tables such as instance_extra, instance_faults, etc that
pertain to a single instance, and thus have a foreign key on their
instance_uuid column that points to the instance. If any of those
records exist, an instance can not be archived out of the main
instances table.

The archive routine currently "handles" this by skipping over said
instances, and eventually iterating over all the tables to pull out
any records that point to that instance, thus freeing up the instance
itself for archival. The problem is, this only happens if those extra
records are actually marked as deleted themselves. If we fail during
a cleanup routine and leave some of them not marked as deleted, but
where the instance they reference *is* marked as deleted, we will
never archive them.

This patch adds another phase of the archival process for any table
that has an "instance_uuid" column, which attempts to archive records
that point to these deleted instances. With this, using a very large
real world sample database, I was able to archive my way down to
zero deleted, un-archivable instances (from north of 100k).

Closes-Bug: #1622545
Change-Id: I77255c77780f0c2b99d59a9c20adecc85335bb18
2016-09-27 12:08:21 -07:00
Sean Dague
12cfd5be6d Unwind circular import issue with api / utils
The DeleteFromSelect function was added to sqla.utils, which is mostly
the home of 2 shadow table functions that need to import api.py to get
constants related to shadow tables. We now exclusively use that
function in api.py for archiving code. That causes some oddities
around module import.

This moves DeleteFromSelect so we can get rid of these odd late
imports.

Change-Id: I59c3444c2258f59a09a9c885bd9490055e278998
2016-09-27 15:05:56 -04:00
Sivasathurappan Radhakrishnan
43f8eb40d7 Remove context object in oslo.log method
Removed context object while logging as Nova uses oslo.context's
RequestContext which means the context object is in scope when doing
logging. Added hack to notify, in case if someone uses it in logging
statements in future.

Change-Id: I5aaa869f2e6155964827e659d18e2bcaad9d866b
Closes-Bug:#1500896
2016-09-27 18:02:08 +00:00
Maciej Szankin
1b9e0abc50 Move notification_format and delete rpc.py
The only entry in rpc.py would be better living in notifications.py.
At that point we can just delete rpc.py.

Blueprint centralize-config-options-ocata

Change-Id: Id4d41339a5f8e1102baa4705fc93a99c151d3ac5
2016-09-27 14:33:52 +00:00
Jenkins
efb67379eb Merge "Updated from global requirements" 2016-09-27 12:53:49 +00:00
OpenStack Proposal Bot
387899f580 Updated from global requirements
Change-Id: I791c1957289f9a934661ba13f9d6c4ad657074a3
2016-09-27 10:04:27 +00:00
Jenkins
808604ffdd Merge "hacking: Always use 'assertIs(Not)None'" 2016-09-26 13:12:34 +00:00
Chris Dent
86e5e03acf [placement] Allow both /placement and /placement/ to work
When mounted under a prefix (such as /placement) the service was
only returning the home document at /placement/ not /placement. In
the context of having a prefix, we'd generally like the latter to
work and for '/' to work when there is no prefix. This allows both.

Note that this doesn't make /placement/resource_providers/ work, and
we don't want that.

Change-Id: I0ac92bf9982227d5f4915175182e5230aeb039b4
Closes-Bug: #1626490
2016-09-26 11:35:11 +00:00
Jenkins
5f541ea467 Merge "conf: Make list->dict conversion more specific" 2016-09-26 10:50:30 +00:00
Jenkins
3869c1c5f1 Merge "[placement] 404 responses do not cause exception logs" 2016-09-26 10:45:36 +00:00
Jenkins
93d415893b Merge "Replace uuid4() with generate_uuid() from oslo_utils" 2016-09-26 08:58:56 +00:00
Stephen Finucane
363571867e hacking: Always use 'assertIs(Not)None'
This is per the OpenStack style guidelines.

Change-Id: Ia706045fe3524b6b5e1db0140672776d481a0c01
2016-09-23 15:40:35 +01:00
Jenkins
1c867a22b7 Merge "[placement] Adjust the name of the gabbi tests" 2016-09-23 14:40:11 +00:00
Jenkins
6a218902f0 Merge "Remove redundant str typecasting" 2016-09-23 14:23:38 +00:00
Chris Dent
bc4370c7db [placement] 404 responses do not cause exception logs
Prior to this change, a 404 caused by a not possible route being
requested (such as /placement/hello) would result in a proper 404
response but also a log message about an uncaught exception. This
made it appear that a 404 response is unexpected and something that
needs exceptional attention. It doesn't. This change makes sure
that 404s propagate up the stack in a clean way and are logged only
by the existing INFO log used for all requests.

Change-Id: I21f9411bd5154eddc582d5f38891be747de874b3
Closes-Bug: #1626489
2016-09-23 13:17:24 +00:00
Jenkins
8dc6b097bb Merge "Remove nova.image.s3 and configs" 2016-09-23 11:16:34 +00:00
hussainchachuliya
5c570e9f7f Replace uuid4() with generate_uuid() from oslo_utils
As of now, UUID is being generated using either uuid.uuid4()
or uuidutils.generate_uuid(). In order to maintain consistency,
we propose to use uuidutils.generate_uuid() from oslo_utils.

Change-Id: I69d4b979fc0e37bc351f9b5516dae899e7e7dba0
2016-09-23 14:39:09 +05:30