8649 Commits

Author SHA1 Message Date
Chris Dent
f5b74eb674 [placement] start a placement_dev doc
placement_dev.rst provides a nova-developer oriented perspective on
the placement API including some explanation of its structure, some
gotchas to be aware of, and some instruction on how to add to it.

Subsequent patches will fill in the missing sections.

Change-Id: Ia571800774aa14beab121c85a693d75fc30ed517
2017-01-03 13:00:36 +00:00
Diana Clarke
51ca5ff32c Remove Rules.load_json warning
The following warning appears in the nova unit test output (via
PlacementLoggingTest.test_404_no_error_log).

    oslo_policy/policy.py:373: DeprecationWarning:
    The load_json() method is deprecated as of the 1.5.0
    release in favor of load() and may be removed in the 2.0
    release.

Change-Id: I9f50027c73c8387c51aef73f0c8fd34976583b89
2016-12-30 15:27:37 -05:00
Matt Riedemann
504594afb8 Handle unicode when dealing with duplicate aggregate errors during migration
The AggregateNameExists message can be translated and have unicode in it
so we can't cast it to a str in python 2.7 else we'll get a
UnicodeEncodeError. That would break the online data migration for
aggregates along with any other online data migrations that run after
that one which impacts upgrades.

This uses six.text_type rather than str for logging the error and adds
a test to recreate the bug and show that it's fixed.

Change-Id: I040db22ecbb9fabe5bbda8a3d9600cc9f76cb170
Closes-Bug: #1653261
2016-12-30 12:56:20 -05:00
Jenkins
8a4ab8ebcb Merge "Show team and repo badges on README" 2016-12-28 12:33:32 +00:00
Jenkins
c08147882b Merge "Add Python 3.5 functional tests in tox.ini" 2016-12-23 07:05:42 +00:00
OpenStack Proposal Bot
34af3165b3 Updated from global requirements
Change-Id: I222d94326ced3bd90d329971e1c6673c0a6f055a
2016-12-23 03:16:27 +00:00
Jenkins
b66e1495a7 Merge "Add nova-status upgrade check command framework" 2016-12-22 19:20:52 +00:00
jeckxie
0a7b22216a [TrivialFix] Fix comment and function name typo error
Change-Id: I713dd471a76e82ee0a4471ea4e5f9dcb57227345
2016-12-22 15:20:23 +08:00
Stephen Finucane
fccd672b91 conf: Remove 'virt' file
We have "compute" options and "virt" options but there isn't really a
difference between the two. Move two to "network" and the remainder to
"compute", allowing us to drop "virt".

There are no actual changes to the opts, besides a typo fix for the
'reserved_huge_pages' opt.

Change-Id: Ibe7ba5716c6bfb096aabb85c73e5167f337a7327
Implements: blueprint centralize-config-options-ocata
2016-12-21 16:45:08 +00:00
Cao Xuan Hoang
0c0e2bdd9e Removes unnecessary utf-8 encoding
trivialfix

Change-Id: I1294ecb5e85c9bf70a23992e92eeccfd35362551
2016-12-20 10:27:01 +07:00
Matt Riedemann
b7b72c22b2 Add nova-status upgrade check command framework
This adds the basic framework for the nova-status
upgrade check commands. Follow up patches will flesh
this out to perform cells v2 and placement API related
upgrade status checks.

A man page is added for the new CLI and as part of that
the man page index is sorted.

Part of blueprint cells-scheduling-interaction
Part of blueprint resource-providers-scheduler-db-filters

Change-Id: I687dd7317703a1bb76c197ebba849ca368c0872e
2016-12-19 16:40:50 -05:00
Maciej Szankin
72a48ce1f2 conf: make 'default' upper case
When api opts were moved from ``DEFAULT`` gorup to ``api`` group
the deprecation group was set to ``default`` instead of ``DEFAULT``.

Implements: bp centralize-config-options-ocata
Change-Id: Iebe97cdf8e06ae7d617dfa3b41ec96cca04db14b
2016-12-19 13:13:22 -06:00
Jenkins
2ccba8318c Merge "Updated from global requirements" 2016-12-19 13:07:25 +00:00
OpenStack Proposal Bot
a5fce56ca8 Updated from global requirements
Change-Id: I12d0e7bbfee7b4545771bd6b893bb49825072453
2016-12-19 09:04:09 +00:00
melanie witt
799223ab9e Make nova-manage cell_v2 discover_hosts tests use DBs
This refactors the discover_hosts tests to work with database fixtures
to more realistically test the commands. Recently, a bug was masked
because of mocking of the database APIs.

Related-Bug: #1650694

Change-Id: I6cb45beacce46c6f39861e7ca86be3bd09047b67
2016-12-17 06:12:13 +00:00
Jenkins
8f1d404351 Merge "Updated from global requirements" 2016-12-16 23:14:28 +00:00
OpenStack Proposal Bot
ff67e3b28a Updated from global requirements
Change-Id: I065e951c70d0cfb85c8b6a89714e258064761fdb
2016-12-16 09:05:44 +00:00
Jenkins
3595254229 Merge "Simple tenant usage pagination" 2016-12-15 18:25:20 +00:00
Jenkins
2fb2afcd09 Merge "Fix some release notes in preparation for the o-2 beta release" 2016-12-15 13:15:47 +00:00
Matt Riedemann
d4f4476ac6 Fix some release notes in preparation for the o-2 beta release
There were several release notes which are not yet released
but will be in the o-2 beta so this goes through and cleans up
some typos, broken links and grammar issues.

Change-Id: Ic5bcf43e94e09c59b2e16807c55d84046d90c96f
2016-12-15 00:06:01 +00:00
Jenkins
b2747c99f3 Merge "Handle maximum limit in schema for int and float type parameters" 2016-12-14 20:35:35 +00:00
Jay Pipes
e24798a02e Only return latest instance fault for instances
This patch addresses slowness that can occur when doing a list servers
API operation when there are many thousands of records in the
instance_faults table.

Previously, in the Instance.fill_faults() method, we were getting all
instance fault records for a set of instances having one of a set of
supplied instance UUIDs and then iterating over those faults and
returning a dict of instance UUID to the first fault returned (which
happened to be the latest fault because of ordering the SQL query by
created_at).

This patch adds a new InstanceFaultList.get_latest_by_instance_uuids()
method that does some SQL-fu to only return the latest fault records for
each instance being inspected.

Closes-Bug: #1632247

Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Change-Id: I8f2227b3969791ebb2d04d74a316b9d97a4b1571
2016-12-14 19:25:05 +02:00
Maciej Szankin
897be86f72 conf: fix formatting in base
* Removed leading space before asterisks in listings
  which causes list to be wrapped in blockquote tag [0]

[0] http://docs.openstack.org/newton/config-reference/compute/config-options.html

Change-Id: I9d1bea48d082d3cbbb7a8f45143eac10407bf490
Implements: blueprint centralize-config-options-ocata
2016-12-14 14:36:15 +00:00
ChangBo Guo(gcb)
1f0ff751b2 Add Python 3.5 functional tests in tox.ini
Add Python 3.5 functional tests tox envlist, this is
needed by python 3.5 functional tests Jenkins job.

Change-Id: I1bba877fcc2c1f2140cbbba2bc6e6c20d7972615
2016-12-14 13:33:07 +08:00
Diana Clarke
2623fe2427 Simple tenant usage pagination
Add optional parameters 'limit' and 'marker' to the
os-simple-tenant-usage endpoints for pagaination.

  /os-simple-tenant-usage?limit={limit}&marker={instance_uuid}
  /os-simple-tenant-usage/{tenant}?limit={limit}&marker={instance_uuid}

The aggregate usage totals may no longer reflect all instances for a
tenant, but rather just the instances for a given page. API consumers
will need to stitch the aggregate data back together (add the totals)
if a tenant's instances span several pages.

Implements blueprint paginate-simple-tenant-usage
Change-Id: Ic8e9f869f1b855f968967bedbf77542f287f26c0
2016-12-14 03:33:50 +00:00
Jenkins
0280b36666 Merge "Corrects the type of a base64 encoded string" 2016-12-13 23:03:13 +00:00
Jenkins
0df25935c1 Merge "Separate CRUD policy for server_groups" 2016-12-13 23:01:52 +00:00
Jenkins
b5a105f5c1 Merge "Add debug to tox environment" 2016-12-13 10:36:06 +00:00
Jenkins
7d5b1b8555 Merge "Pass context as kwarg instead of positional arg to get_engine" 2016-12-13 03:04:30 +00:00
Jenkins
06b8c85489 Merge "Fix instructions for running simple_cell_setup" 2016-12-12 21:27:34 +00:00
Jenkins
0a795c57c4 Merge "Refactor REGEX filters to eliminate 500 errors" 2016-12-12 20:10:17 +00:00
EdLeafe
3b8826b996 Corrects the type of a base64 encoded string
The nova/tests/functional/api_sample_tests/test_servers.py contains the
ServersSampleBase class, and in its class definition creates a
'user_data' attribute by base64 encoding a string. However, this will
not work in Python 3, as the base64.b64encode() method requires bytes,
not a string. As a result, importing the test class fails and no tests
get run.

Note that this change doesn't fix all tests to work under Python 3; it
simply fixes the bug that prevents the tests from running at all under
Python 3.

Closes-Bug: #1632856

Change-Id: I35a7b02132bed0387a173b339f6204bf0e3269de
2016-12-12 18:07:30 +00:00
Matt Riedemann
53a5b020ce Fix instructions for running simple_cell_setup
Change ff6b9998bb977421a5cbc94878ced8542d910c9e enforces in
a database migration that you've run the simple_cell_setup
command for cells v2 but the instructions in the error and
in the release note said to use 'nova-manage db' when it should
be 'nova-manage cell_v2'.

Change-Id: I8e71d1c7022d1000f26b7c16ed1c56f6e87ab8ac
Closes-Bug: #1649341
2016-12-12 12:52:27 -05:00
Jenkins
62f5a7ba72 Merge "Check that all JSON files don't have \r\n in line" 2016-12-12 17:17:04 +00:00
Jenkins
6c8ba55e3c Merge "conf: Remove config option compute_ manager" 2016-12-12 08:37:07 +00:00
Jenkins
37d8d6f908 Merge "Setup CellsV2 environment in base test" 2016-12-10 18:02:28 +00:00
jichenjc
8f2538f8fb Refactor REGEX filters to eliminate 500 errors
You can currently create a 500 error on mysql by passing | as the name
filter because mysql assumes regex values are well crafted by the
application layer.

This puts in facilities to provide a safe regex filter per db engine.

It also refactors some of the inline code from _regex_instance_filter
into slightly more logical blocks, which will make it a little more
straight forward about where we need to do something smarter about
determining the dbtype in a cellsv2 world.

Change-Id: Ice2e21666905fdb76c001195e8fca21b427ea737
Closes-Bug: 1546396
2016-12-09 16:37:27 -05:00
Dan Smith
c5c4925933 Setup CellsV2 environment in base test
This makes us automatically set up a usable CellsV2 environment in
the base test case, if we're setting up database stuff. If the test
uses the DB normally, we get a cell0, a real cell, and create
hostmappings for any compute services that we start. If we're not
a DB-using test, we mock out the cell mapping stuff so that
everything appears to just be in the same cell.

This includes a fix for the nova-manage tests, which need to control
their own cells destiny now.

This includes a fix to the pci tests for libvirt, which were starting
the same compute service twice in a row. That no longer works because
we fail to create the duplicate hostmapping record, but we should not
have been doing that anyway. This makes us only create it once.

This includes a fix to the connection switching test to set up the
database fixtures itself since it requires a specific environment
that we now confuse by always going through the CellDatabases fixture.

Change-Id: I435bf18ab66ad1469c03f0cf3027033a5751af6f
2016-12-09 10:30:43 -08:00
Jenkins
bde73b365a Merge "hacking: Use uuidutils or uuidsentinel to generate UUID" 2016-12-09 13:48:02 +00:00
Jenkins
025877800d Merge "Replace uuid4() with uuidsentinel" 2016-12-09 13:45:40 +00:00
bhagyashris
d10a4a2a27 Return 400 when name is more than 255 characters
APIs listed below are returning 500 error if you pass name more than
255 characters.
1. create resource_classes
2. update resource_classes

Added maxLength check in schema to ensure name should not be more than
255 characters.

Closes-Bug: #1648314
Change-Id: I4ae54f3061fe43d87a656088db1d2ae454eb8237
2016-12-09 15:31:21 +05:30
liyingjun
803e69f30d Check that all JSON files don't have \r\n in line
The windows edited file may contain \r\n in line, add a check for
json files for the docs job.

Change-Id: I1ca30be139651ed49eb1f7867616dda6bd080884
2016-12-09 17:33:37 +08:00
ChangBo Guo(gcb)
091c0a66ff conf: Remove config option compute_ manager
compute_manager config options were deprecated in
13.0.0, we can remove it now.

Depends-On: I93b62372e357db4f7c39992c244b2ec9e594ad9c

Implements: bp centralize-config-options-ocata

Change-Id: I84503655bd9675ff441073e51059202142db22ab
2016-12-08 20:05:52 +08:00
Jenkins
cdec0f2236 Merge "Return 400 when name is more than 200 characters" 2016-12-08 07:18:59 +00:00
Jenkins
2ac06cb111 Merge "Add SingleCellSimple fixture" 2016-12-08 02:07:51 +00:00
Jenkins
b63d01fc80 Merge "Make RPCFixture support multiple connections" 2016-12-07 21:17:44 +00:00
Dan Smith
a75008ce15 Add SingleCellSimple fixture
This fixture makes it trivial to mock out all the cell listing stuff
for the simple case where you just want to assume a single cell that
is configured as the default database.

Change-Id: I7eecee388780677d2b342556fef0179b02707f3c
2016-12-07 10:24:02 -08:00
Jenkins
eb237415f6 Merge "Updated from global requirements" 2016-12-07 18:18:19 +00:00
Jenkins
f1a29e1c1d Merge "Revert "reduce pep8 requirements to just hacking"" 2016-12-07 18:15:12 +00:00
Dan Smith
eec83eed7c Make RPCFixture support multiple connections
For testing cells, we will need to track the driver instances that
we give out by url. This normally just works with a conventional
oslo.messaging driver, but the fake driver keeps internal data
structures for simulating its bus. If we end up with clients creating
a new instance of the driver in the rpc switching code, we'll never
be able to send messages to services because we'll always have
private/separate data structures.

So, this makes the fixture wrap the transport creation stuff
and unify references by url. In order to make this work, some
retooling of rpc.init() is done, which makes it more in line with
the recent additions we had for wrapping transport initialization
per connection anyway.

For now, a lot of our tests can't handle the possibility of
multiple RPC connections due to them looking at the global
transport_url configuration. So for the moment, even though this
makes the fixture support multiple independent connections, we
collapse any such attempts down to a single connection to the
default broker.

Note: this requires a fix in oslo.messaging 5.14.0

Depends-On: I01b6f5a20ea9752da46a546a908bd38cf11da681
Change-Id: Icb63d7dabd17f3c5633387793f68a8ba20863a7e
2016-12-07 06:53:57 -08:00