* removed skipsdist=True to make sure cloudkitty is available in the
virtual env
* added find to allowed external commands in tox
* replaced full path to find for readability
Change-Id: I4211e9be3e170f8724246883768247727b1d5d0b
Co-Authored-By: Pierre Riteau <pierre@stackhpc.com>
This is a follow-up to:
https://review.opendev.org/c/openstack/cloudkitty/+/867122
We need to add the `[testenv:api-ref]` section to `tox.ini` to be able
to run `tox -e api-ref`, which is what Zuul uses to build the API refs.
Sphinx had to be capped to the latest version 4 or otherwise `tox` fails
with the "add_content() takes 2 positional arguments but 3 were given"
error message.
Change-Id: I65b008152e2bc64f29229996c87ad4587fe85043
The deps configuration for the docs environment only uses upper
constraints for doc/requirements.txt. However, cloudkitty also gets
installed automatically without upper constraints, which produces
various errors on older branches.
Install cloudkitty requirements using constraints to fix this issue.
Change-Id: Ia6f12151be829be6d2f21b3536536697345e05f4
It was deprecated in favor of assertRaisesRegex added in Python 3.2.
We can replace it now because Python 2 is no longer supported.
Change-Id: I4cec6e44d48bcee9808bfd647f3a45cd8b1e2f11
This repo has not been testing lower-constraints at all due to
broken install_command. If you look at any lower-constraints run and
compare the install python packages with lower-constraints, you see
that those are completely different.
This change removes install_command and updates deps in tox.ini to
follow best practices (moving constraints into deps).
It also updates lower-constraints to newer versions.
Remove broken hacking test.
Co-Authored-By: Justin Ferrieu <jferrieu@objectif-libre.com>
Change-Id: I13daab9e53617266beff7053e50779d1f281802c
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
Fix problems found.
Update local hacking checks for new flake8.
Change-Id: I41a5518f1210c9a1b6d5217bbbcd99bbaa3c9b53
Class docstrings were being pulled in to multiple locations, causing
sphinx errors due to the duplicate references. This fixes it by adding
the :noindex: option to those references.
Also temporarily disabling the PDF build as that is failing with another
issue that should be fixed in a follow up.
Change-Id: I6de2948ff49e1bb0b6a8b9a3a90f9f2ebbb8b7bb
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.
[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045
Change-Id: Ic3a57b513d3646b6931edc6163c2702805d29d57
This fixes all build warnings in the docs, and makes them build
with -W (consider warnings as errors).
Work items:
* Remove the useless "METRICS_CONF" global variable in the monasca collector.
It was causing the "load_conf()" function to fail, as the
/etc/cloudkitty/metrics.yml file couldn't be found.
* Change the docstring indentation in
cloudkitty/rating/hash/controllers/mapping.py. This was the cause for the
"doc/source/api-reference/v1/rating/hashmap.rst:12: WARNING: Field list ends
without a blank line; unexpected unindent." message.
* Added a cloudkitty.conf sample to the admin documentation.
* Deleted unused files.
* Fixed the policy.yaml sample include path.
* Sorted the v2 API parameters alphabetically.
* Ignored the "wsmeext.sphinxext: directive 'autoattribute' is
already registered" warning
* Added :noindex: directives to functions documented twice.
* Made sphinx always build with -W.
Change-Id: I5f1ab04e18920f3352c2807878cad327692a225f
This adds support for pdf documentation generation. Work items:
* Provide a distinct index for pdf doc. This is required as the toctree in a
tab fails to render as a pdf document.
* Remove the v2 API reference from the pdf documentation. "rest_expand_all",
"rest_method" and "rest_parameters" are not supported.
* Add a pdf-docs tox env
* Update conf.py
Story: 2006075
Task: 34808
Change-Id: I848d59b551fe6d5077960dc45554c7281c2372a7
create a tox environment for running the unit tests against the lower
bounds of the dependencies.
Add openstack-tox-lower-constraints job to the zuul configuration.
See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.
Change-Id: Iac8d78c191763121cc580c5cdb070b2673e39c99
As specified by the OpenStack Style Guidelines in its 1.1.1.dev15
version, which is the latest version to this day, *author* tags
should not be specified (see H105).
https://docs.openstack.org/hacking/latest/user/hacking.html#general
Change-Id: I0ab7359e15eb04948c7a905378001a66cb901e69
This change adds a basic bandit config for cloudkitty. It can be invoked
by running the tox environment for bandit;
tox -e bandit
These changes also fix potential security issues find during bandit checks.
- binding to all interface: remove useless host_ip option to avoid issue
- hash function issue: switch from sha1 to sha512
- use of exec: can't be removed for moment so using #nosec comment
Change-Id: Iae7d7604457345fe6d482cf48311c9b75fdde947
This is part of a global effort to clean up CloudKitty's
unmaintained codebase.
This storage backend was only present for development purposes,
and not production ready. A second v2 backend will be implemented
in the future, with support for HA/clustering.
Change-Id: Iab9d152d2851ca385e607d338c0a09b74ba7e3b3
Story: 2004400
Task: 28568
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')
Change-Id: Ia95801a67b0db3932fba6b3dd0c4cae6f0a81e56
Use openstack-tox-cover template, this runs the cover job as
non-voting in the check queue only.
Remove jobs and use template instead.
Fix cover environment.
Change-Id: I4fa5ac5d852544beffb020b30f2f428ebf56b78b
This adds a v2 storage interface as well as a gnocchi backend for it to
cloudkitty. This new interface will allow us to implement the v2 API, which will
be more metric-oriented.
This new storage uses the new dataframe format ('desc' is now split up into
'groupby' and 'metadata', following the collect logic); and supports grouping,
filters and pagination.
Modifications:
* The tenant/scope state management isn't handled by the storage backend
anymore. A StateManager object has been added.
* All internal interactions with the storage backend use the v2 interface.
An adapter class has been added to ensure retrocompatibility with the
v1 interface.
* A base class for functional tests testing the v2 storage interface has been
added. It contains generic tests, which should allow easier testing for new
v2 backends.
* Some developer documentation explaining how to implement a v2 storage
backend has been added. User documentation will be updated once the v2
storage backend is considered stable.
The v1 is still the default storage version. Note that this new version is
considered unstable and should only be used for upstream development.
Change-Id: I5e9b95c79292582fab3017289d35ee310e35ffea
Story: 2001372
Task: 6585
Task: 14361
Task: 24535
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: Icb3886271885bfee19981a6acdda3163f3cd72f8
Due to the Sphinx module of pecanwsme,
which is not python3 compatible,
we need to force the usage of python2
for the documentation generation.
A future patch will remove the usage of pecanwsme completely.
This commit will be reverted at the same time.
Change-Id: Icaa8047d9d15cb75a75bbb04336e5f9d2fefcbe0
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: I03d26060e9b36ed50062a54b9de29d7dc6787fb9
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This patch introduces the implementation for registering
default policy rules in code. Default rules are defined under
cloudkitty.common.policies. Each API's policies are defined in a
sub-folder under that path and __init__.py contains all the
default policies in code which are registered in the ``init``
enforcer function in cloudkitty/common/policy.py.
This commit does the following:
- Creates the ``policies`` module that contains all the default
policies in code.
- Adds the base policy rules into code (context_is_admin,
admin_or_owner and default rules).
- Add policies in code for current APIs
- Add a tox env to generate default policy sample file
- Delete policy.json from repo as policies in code will be used.
Change-Id: I257e8cefc2b699fc979c717531cd9ba77233d94b
Implements: blueprint policy-in-code
The app.wsgi file should be adjusted to meet pep8
standards and apply pep8 check to app.wsgi automatically.
Change-Id: I608e9e491dc13ded595c68108d8b8854c8ab0585
The testenv:checkconfig is unused and there is not the file
{toxinidir}/tools/config/check_uptodate.sh in cloudkitty.
Change-Id: Ifa8293a7b04557316c7256519b8821b5a668c554
The gating on python 3.4 is restricted to <= Mitaka. This is due
to the change from Ubuntu Trusty to Xenial, where only python3.5
is available. There is no need to continue to keep these settings.
Change-Id: I49007c51723bfbe7747bcc611ff669f3c7980a10