Commit Graph

47 Commits

Author SHA1 Message Date
Stephen Finucane 60b977b76d db: Enable auto-generation of API DB migrations
Change I18846a5c7557db45bb63b97c7e8be5c4367e4547 enabled auto-generation
of migrations for the main database. Let's now extend this to the API
database using the same formula. While we're here, we also enable
"batch" migrations for SQLite [1] by default, which allow us to work
around SQLite's inability to support the ALTER statement for all but a
limited set of cases. As noted in the documentation [2], this will have
no impact on other backends where "we'd see the usual 'ALTER' statements
done as though there were no batch directive".

[1] https://stackoverflow.com/a/31140916/613428
[2] https://alembic.sqlalchemy.org/en/latest/batch.html

Change-Id: I51c3a53286a0eced4bf57ad4fc13ac5f3616f7eb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2021-10-18 20:26:18 +01:00
Stephen Finucane 34ecf5ab91 tox: Integrate mypy
mypy is an experimental optional static type checker for Python that
aims to combine the benefits of dynamic (or "duck") typing and static
typing. While still in development, most features are supported and it's
already being used by real world projects like Sphinx. Let's start small
by integrating it into some of the interfaces that nova exposes. We can
further build upon this if it works out.

This change sets up the boilerplate necessary to use mypy in nova. Type
annotations are not included for any module - these will be added
separately. We're calling mypy by way of a script, as this allows us to
store a list of files that we have converted while we're in the process
of adding type annotations where necessary.

Change-Id: I75ab46a6768c4ca2050fdde2b7f8eeb90724c8c6
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-05-15 15:59:53 +01:00
Chris Dent 70a2879b2c Delete the placement code
This finalizes the removal of the placement code from nova.
This change primarily removes code and makes fixes to cmd,
test and migration tooling to adapt to the removal.

Placement tests and documention were already removed in
early patches.

A database migration that calls
consumer_obj.create_incomplete_consumers in nova-manage has been
removed.

A functional test which confirms the default incomplete
consumer user and project id has been changes so its its use of
conf.placement.incomplete_* (now removed) is replaced with a
constant. The placement server, running in the functional
test, provides its own config.

placement-related configuration is updated to only register those
opts which are relevant on the nova side. This mostly means
ksa-related opts. placement-database configuration is removed
from nova/conf/database.

tox.ini is updated to remove the group_regex required by the
placement gabbi tests. This should probably have gone when the
placement functional tests went, but was overlooked.

A release note is added which describes that this is cleanup,
the main action already happened, but points people to the
nova to placement upgrade instructions in case they haven't
done it yet.

Change-Id: I4181f39dea7eb10b84e6f5057938767b3e422aff
2019-04-28 20:06:15 +00:00
Takashi NATSUME 311110e81b Remove Placement API reference
The placement project has published the API reference
in its own repository and the related jobs for the nova project
has been removed since Ia4680f24d78af1260f2f0106a458b78a079c1287.

So remove the files and definitions related to
the placement API reference in the nova repository.

Change-Id: Ia43b958a28e7e763e7ecb29e06f8d21d2b9a850f
2018-11-28 03:38:41 +00:00
Matt Riedemann 0a461979df Implement granular policy rules for placement
This adds a granular policy checking framework for
placement based on nova.policy but with a lot of
the legacy cruft removed, like the is_admin and
context_is_admin rules.

A new PlacementPolicyFixture is added along with
a new configuration option, [placement]/policy_file,
which is needed because the default policy file
that gets used in config is from [oslo_policy]/policy_file
which is being used as the nova policy file. As
far as I can tell, oslo.policy doesn't allow for
multiple policy files with different names unless
I'm misunderstanding how the policy_dirs option works.

With these changes, we can have something like:

  /etc/nova/policy.json - for nova policy rules
  /etc/nova/placement-policy.yaml - for placement rules

The docs are also updated to include the placement
policy sample along with a tox builder for the sample.

This starts by adding granular rules for CRUD operations
on the /resource_providers and /resource_providers/{uuid}
routes which use the same descriptions from the placement
API reference. Subsequent patches will add new granular
rules for the other routes.

Part of blueprint granular-placement-policy

Change-Id: I17573f5210314341c332fdcb1ce462a989c21940
2018-05-17 11:12:16 -04:00
Matthew Treinish d083eceea3
Fix test runner config issues with os-testr 1.0.0
The os-testr 1.0.0 release had a couple of required config changes due
to it's internal usage of stestr. This commit fixes those by adding a
.stestr.conf (to remove a warning) sets the fixture env variables in
the tox.ini instead of being hidden in .testr.conf and removing the
quotes around posargs to make passing args to ostestr actually work.
Also to keep the expected dev experience stestr is used directly for
places where ostestr was called directly.

Change-Id: Ib0fbcb2e7710a6b8219c56ef2a4462c61ea498a9
2017-09-13 17:11:57 -04:00
Chris Dent 8c59991363 Structure for simply managing placement-api-ref
This consists of a duplicate of the [nova-]api-ref setup and
conf.py along with tooling to fail the tox -edocs target when
a route that is defined in
nova.api.openstack.placement.handler.ROUTE_DECLARATIONS is not
present in placement-api-ref/source/index.rst.
tools/placement_api_docs.py will report which routes are missing.

Though completely gameable (as demonstrated in the current lame
index.rst) it's better than nothing and provides some useful
structuring on what to do next. It's also the case that the 'docs'
target in tox is not part of gating.

The response for GET / is in place with the necessary
parameters.yaml for it to be correctly described. The 'get-root.json'
file provides the JSON of the expected response. The expectation is
that later commits will add information for other urls and their
JSON files will be named method-path-separated-by-dash.json with a
request/response qualifier as necessary.

Followup patches will add other routes.

A new parameters.yaml is used instead of reusing the one from
api-ref as there isn't a lot of expected overlap and having a
separate file will ease eventual extraction.

Running tox -eplacement-api-ref will generate the docs for review,
with output in placement-api-ref/build/html/index.html.

This will be hooked up with CI to deploy the generated docs,
eventually.

Change-Id: Ifb4d91d39db0e49b55952e37cdfc9f63dcd37aa3
2017-03-24 15:15:53 +03:00
Stephen Finucane 864f65e4fd doc: Integrate oslo_policy.sphinxpolicygen
Change-Id: I80e75b8a592e1125e02ca6177661177a7c17c927
2016-10-20 10:31:01 +01:00
Augustina Ragwitz be68e3c606 Ignore generated merged policy files
Change-Id: Ib26e0269e95c650b8193984fc5314601c662ad2b
2016-08-31 08:54:25 -07:00
Andrew Laski 5e38fa3cb5 Add policy sample generation
This adds the entry point and config file necessary for using the
oslo.policy sample generation script. It also adds a tox target to
simplify the usage of it.

The command is also run in the docs tox target since the sample file
can be considered documentation.

Change-Id: I18a1fa567fc04b0e0a37c02f20024b2ce483f060
Partially-Implements: bp policy-in-code
2016-06-28 20:52:44 +00:00
Matt Riedemann 44f74f5a41 Add api-ref/build/* to .gitignore
Change-Id: I1be1251c6e327f8b94799c512fad7298b4c9967e
2016-04-06 12:51:27 -04:00
Matt Riedemann afd977c69d Make git clean actually remove covhtml
This makes `git clean -df` actually remove the covhtml
directory and contents if you've run `tox -e coverage`.

Change-Id: I5db42524f9511c009289380e342b0b61f79899c2
2016-03-31 14:31:40 -04:00
Jenkins 5e37254a91 Merge "Add reno for release notes management" 2015-11-13 16:24:51 +00:00
Jenkins 8927870218 Merge "Rearranges to create new Compute API Guide" 2015-11-12 18:28:38 +00:00
Sylvain Bauza 3a65e4848f Add reno for release notes management
Since reno is the new tool for Relnotes [1], we need to add it
to Nova and provide some Sphinx docs for Liberty and Mitaka.

Change-Id: Ibd74e62b6f36076dbec17dd146632fd42aad6eb2
2015-11-12 17:34:24 +01:00
Anne Gentle 17961c41a3 Rearranges to create new Compute API Guide
Uses openstackdocstheme to match other content

Has a dependent change in project-config also so that
file will build to developer.openstack.org/compute
at https://review.openstack.org/#/c/231000/

Change-Id: Ic060a1e79e4b2f8695cb788ff4df018e0cfd3286
2015-11-12 10:47:23 +00:00
Einst Crazy fee611997d Add tags to .gitignore
When using ctags, it will provide a 'tags' file in the directory.
It should be added to .gitignore.

Change-Id: If393c934a72397e755fc9e9672bb8d610d589a83
2015-10-20 10:04:44 +08:00
Matthew Treinish 9a3ed7631a Add sample config file to nova docs
This commit adds sample config file generation to the nova devref
using the oslo.config sphinxconfiggen module which was recently added.
This will generate a new sample config each time build sphinx is run.
This is then used on a new docs page where you can either view the file
in its entirety, or download the file. The sphinx module was added in
the oslo.config 2.3.0 release.

Change-Id: I6d9150d81c8204bee8f775021a854928671bdd02
2015-09-30 22:35:46 +00:00
Daniel P. Berrange 72de6ac4f0 remove all traces of pylint testing infrastructure
The pylint tests have been broken for several months and
the Jenkins job has also been disabled. There has been
no sign of attempts to address this, so just delete what
remains of the pylint support so developers don't mistakenly
think it is supposed to work with patches they are submitting.

Change-Id: Ifacc99e45acb0e9a72be6c31113e0cf073354f02
2015-01-08 11:56:45 +00:00
Matthew Treinish 53add86b44 Remove duplicate entry from .gitignore file
This commit removes the duplicate entry in the gitignore file for the
sample config file.

Closes-Bug: #1375432

Change-Id: Ied0fb5b38a616bbde871dfc690ccccfd46c94bde
2014-09-29 19:21:02 +00:00
Jenkins a4b54d4f46 Merge "Ignore etc/nova/nova.conf.sample" 2014-05-17 21:16:47 +00:00
ZhiQiang Fan b77fd1690f Ignore etc/nova/nova.conf.sample
Since we have already remove this sample file, and provided a way
to generate it, it should be no longer tracked.

Change-Id: I786812d039d96044ff5040d09f5472051966f74f
Closes-Bug: #1320150
2014-05-16 19:06:50 +08:00
Joe Gordon d9ba50a368 Add nova.conf.sample to gitignore
Now that we aren't storing this in tree and are recommending people
generate it locally add nova.conf.sample to .gitignore.

Change-Id: I0727c7552fead5a201116f9c2c6510fec3b92cd6
2014-03-27 11:57:42 -07:00
kashivreddy a577fc5f77 add .idea folder to .gitignore pycharm creates this folder
Change-Id: Icbeabe1d3e102d9e447f46be96280e61aa364b74
2013-03-07 17:00:22 -06:00
Yun Mao b87385b87b Ignore auto-generated files by lintstack
Part of blueprint lintstack

Change-Id: I6ca0ec71c7fa083a86920a7ae055ef8e9d19c512
2013-01-17 17:27:09 -05:00
Mauro S. M. Rodrigues 559f03ebfa Add .testrepository/ directory to gitginore
Change-Id: Ib46a3d996e54c249773ac3c45960d471d21d2357
2012-12-19 10:46:36 -05:00
Robert Collins 8f3bc19633 Ignore editor backup files.
Change-Id: I5bf21781cae5588f6d6e44b025bb79d96036f48c
2012-11-19 09:20:52 +13:00
pyw 74ed3bcf5f Clear up the .gitignore file
1.Remove duplicate items
2.Sort to alphabetical order
3.Remove "*.sw[po]" instead "*.swp" and "*.swo" for pass
bundling test.

Fixes: bug #1039898
Change-Id: Id8e03ecce6d2ab6d823a992a3a225b5ceb44aa80
2012-08-31 10:09:18 +08:00
Flavia Missi cf68d6aad5 Ignoring *.sw[op] files
Change-Id: I3a059106a32f36374da787bc36a3721463189e6d
2012-08-16 20:40:20 -03:00
Monty Taylor eb2de037a3 Update common setup code to latest.
This gets us up to date with common/setup.py and replaces custom nova
autodoc generation with the port of that code found in common.

Change-Id: I2a1c5d2c0fdcf40dbea50cc123b537adb068cdc2
2012-07-07 16:32:19 -05:00
Sean Dague 19269d8464 sort .gitignore for readability
sort .gitignore using sort -V to create something more readable
for future additions, instead of always appending to the end
of the file.

Change-Id: I7e5f0a792b5555a3c53f6da124572e0e3a7d7f9b
2012-07-05 16:14:18 -04:00
Sean Dague 6c1d7989d9 ignore project files for eclipse/pydev
eclipse is far too commit happy to keep adding these files into the
tree making it a manual process to remove them before submit. This
should make life a little simpler for people using pydev.

Change-Id: Icd0ceea53daa76e6c36933ced174a235e070c394
2012-07-05 16:09:43 -04:00
Jenkins e520f55815 Merge "Finish AUTHORS transition." 2012-07-05 17:32:57 +00:00
Brian Waldon 483ec33fec Add *.egg* to .gitignore
Change-Id: Id2adc763a1a84acf0323bc711616d62d5e310d75
2012-07-05 09:33:03 -07:00
Monty Taylor 3456b667c3 Finish AUTHORS transition.
The code to generate the authors file from the git changelog has been in the
tree and running for a few weeks now. Somehow the removal of the authors
test and and the MANIFEST.in file were wrong though. This should clean that
up.

Fixes bug 920757.

Change-Id: I66c388c1c81804f8dabc52b5ee25c7f394921e11
2012-07-05 09:11:37 -05:00
Monty Taylor cf34a60157 Finalize tox config.
Shrink tox.ini to the new short version.
Fix the test cases to be able to be run in nosetets plus the
openstack.nose_plugin, which finally removes the need for
nova/testing/runner.py
Also, now we'll just output directly to stdout, which will
make nose collect the trace logging directly and either output
it at the end of the run, or inject it into the xunit output
appropriately.

Change-Id: I1456e18a11a840145492038108bdfe812c8230d1
2012-06-07 12:15:42 -04:00
Joe Gordon 5db41cb358 Update .gitignore
Add:
* ChangeLog
* nova/tests/coverage.xml

Change-Id: I1d0c395cf679e07e304dd878d97734307b685f4c
2012-05-30 15:38:32 -07:00
Renier Morales bcb53dfc6a Scope coverage report generation to nova module.
Coverage report generation was not using --include filters.
This resulted in generating a report that included all external
dependencies. Some of these may include problematic characters for
utf8 decoding. In the odd case this was found, coverage would fail
with a UnicodeDecodeError.

Fixes bug #987077.

Change-Id: I276698e65ac1037972209a406058168433cd826b
2012-04-24 07:58:25 -04:00
Monty Taylor 51210081a8 Support tox-based unittests.
Change-Id: I6a0a616a979688595762e6b772d77a14f1968070
2012-02-20 11:54:37 -08:00
Zhongyue Luo 9e16a2edb1 nova.conf sample tool
Fixes bug #918621

A tool to generate a sample nova.conf file

Change-Id: I2646d7e674ef3d1759558e820f051cc5e7f3b4ae
2012-02-18 07:51:46 +08:00
Monty Taylor b54179438e Move translations to babel locations.
If we structure things like this, we can get things
actually, you know, installed.

Locales ast and oc aren't supported by babel. We'll re-import them
from Launchpad once we get babel updated.

If you want translations installed, run:

  python setup.py compile_catalog

Before you run either setup.py sdist or setup.py install

More work is needed to actually properly use the installed translations, but
we're closer.

Change-Id: I4a4bedd982c89063aa09688c9cbcf97054bcb34b
2012-02-08 19:30:39 -08:00
Monty Taylor 4a4c274c83 Get rid of distutils.extra.
We moved to DistUtilsExtra because it promised a more automatic workflow
from setup.py. It doesn't actually deliver though, and it also vomits
warnings during setup.py usage, and also breaks pip integration.

So this is going back to babel. Mostly folks shouldn't need to know
anything about this. We'll need to update the translations import
jobs in Jenkins, and we might need to add a corresponding translations
upload job that runs post-merge.

Translations installation doesn't fully work - but it actually wasn't fully
working before. Getting this part of the project done now though is a
pre-requisite for using tox for multi-python testing (tox starts by
creating an sdist tarball and then installing it into the venv, which
is just 100% broken with DistUtilsExtra)

Change-Id: I126e1bcfab0656eab6ca10de67d3d2aaa8b844f3
2012-02-08 19:30:39 -08:00
James E. Blair 5235106e95 Rename .nova-venv to .venv.
This simplifies a number of Jenkins jobs which currently, other
than directory names, could be the same for all OpenStack
projects. By renaming the virtualenv directory, the redundant
Jenkins virtualenv build and copy jobs can be eliminated.

Change-Id: Ieaf1dac3207ecb34b911c7edcd2086809abdf49e
2011-12-08 15:17:51 -08:00
Julien Danjou e6dc250296 Remove autogenerated pot file
Change-Id: I25c33e2a91458d2eaa41232eb54b2c1e4e273854
Signed-off-by: Julien Danjou <julien.danjou@enovance.com>
2011-12-06 09:56:56 +01:00
Aaron Lee d2ac401fbb Adding run_test.sh artifacts to .gitignore
Adding myself to the Authors file.

Change-Id: Ifcedc2b7925f293cc47fb1eda9fbc14fa045918a
2011-09-27 10:31:44 -05:00
andy 6d3331e831 Move virtualenv installation out of the makefile.
Also adds some tools for dealing with virtualenvs to the tools
directory.
2010-07-26 23:16:49 +02:00
Jesse Andrews fd278ade0b missed the gitignore 2010-05-30 14:12:04 -07:00