Adds doc8 check to pep8
This patch adds doc8 check for .rst files to pep8. Files that fail doc8 check are also fixed. Change-Id: Ib8556b6eac0fb5a9bd3b7f8dcf000ab1b23e23bc
This commit is contained in:
parent
d4eea2537c
commit
b3ae81dc92
|
@ -13,15 +13,17 @@ Cloudkitty Specific Commandments
|
||||||
- [C311] Use assertIsNone(...) instead of assertEqual(None, ...).
|
- [C311] Use assertIsNone(...) instead of assertEqual(None, ...).
|
||||||
- [C312] Use assertTrue(...) rather than assertEqual(True, ...).
|
- [C312] Use assertTrue(...) rather than assertEqual(True, ...).
|
||||||
- [C313] Validate that logs are not translated.
|
- [C313] Validate that logs are not translated.
|
||||||
- [C314] str() and unicode() cannot be used on an exception. Remove or use six.text_type().
|
- [C314] str() and unicode() cannot be used on an exception.
|
||||||
|
Remove or use six.text_type().
|
||||||
- [C315] Translated messages cannot be concatenated. String should be
|
- [C315] Translated messages cannot be concatenated. String should be
|
||||||
included in translated message.
|
included in translated message.
|
||||||
- [C317] 'oslo_' should be used instead of 'oslo.'
|
- [C317] `oslo_` should be used instead of `oslo.`
|
||||||
- [C318] Must use a dict comprehension instead of a dict constructor
|
- [C318] Must use a dict comprehension instead of a dict constructor
|
||||||
with a sequence of key-value pairs.
|
with a sequence of key-value pairs.
|
||||||
- [C319] Ensure to not use xrange().
|
- [C319] Ensure to not use xrange().
|
||||||
- [C320] Do not use LOG.warn as it's deprecated.
|
- [C320] Do not use LOG.warn as it's deprecated.
|
||||||
- [C321] Ensure that the _() function is explicitly imported to ensure proper translations.
|
- [C321] Ensure that the _() function is explicitly imported to ensure
|
||||||
|
proper translations.
|
||||||
|
|
||||||
LOG Translations
|
LOG Translations
|
||||||
----------------
|
----------------
|
||||||
|
|
|
@ -85,7 +85,8 @@ want to install it on an older system, use a virtualenv.
|
||||||
Getting release notes
|
Getting release notes
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
Release notes can be found in the `release notes section`_ of the documentation.
|
Release notes can be found in the `release notes section`_ of the
|
||||||
|
documentation.
|
||||||
|
|
||||||
|
|
||||||
.. Global references and images
|
.. Global references and images
|
||||||
|
|
|
@ -8,34 +8,44 @@ with DevStack.
|
||||||
Configure DevStack to run CloudKitty
|
Configure DevStack to run CloudKitty
|
||||||
====================================
|
====================================
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
$ DEVSTACK_DIR=/path/to/devstack
|
$ DEVSTACK_DIR=/path/to/devstack
|
||||||
|
|
||||||
1. Enable Ceilometer::
|
1. Enable Ceilometer:
|
||||||
|
|
||||||
$ cd ${DEVSTACK_DIR}
|
.. code-block:: bash
|
||||||
$ cat >> local.conf << EOF
|
|
||||||
[[local|localrc]]
|
|
||||||
# ceilometer
|
|
||||||
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer.git master
|
|
||||||
EOF
|
|
||||||
|
|
||||||
2. Enable CloudKitty::
|
$ cd ${DEVSTACK_DIR}
|
||||||
|
$ cat >> local.conf << EOF
|
||||||
|
[[local|localrc]]
|
||||||
|
# ceilometer
|
||||||
|
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer.git master
|
||||||
|
EOF
|
||||||
|
|
||||||
$ cd ${DEVSTACK_DIR}
|
2. Enable CloudKitty:
|
||||||
cat >> local.conf << EOF
|
|
||||||
# cloudkitty
|
|
||||||
enable_plugin cloudkitty https://git.openstack.org/openstack/cloudkitty master
|
|
||||||
enable_service ck-api, ck-proc
|
|
||||||
EOF
|
|
||||||
|
|
||||||
3. Set CloudKitty collector to gnocchi::
|
.. code-block:: bash
|
||||||
|
|
||||||
$ cd ${DEVSTACK_DIR}
|
$ cd ${DEVSTACK_DIR}
|
||||||
cat >> local.conf << EOF
|
cat >> local.conf << EOF
|
||||||
CLOUDKITTY_COLLECTOR=gnocchi
|
# cloudkitty
|
||||||
EOF
|
enable_plugin cloudkitty https://git.openstack.org/openstack/cloudkitty master
|
||||||
|
enable_service ck-api, ck-proc
|
||||||
|
EOF
|
||||||
|
|
||||||
Run devstack as usual::
|
3. Set CloudKitty collector to gnocchi:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
$ cd ${DEVSTACK_DIR}
|
||||||
|
cat >> local.conf << EOF
|
||||||
|
CLOUDKITTY_COLLECTOR=gnocchi
|
||||||
|
EOF
|
||||||
|
|
||||||
|
Run devstack as usual:
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
$ ./stack.sh
|
$ ./stack.sh
|
||||||
|
|
||||||
|
|
|
@ -153,8 +153,8 @@ the ``mysql`` client::
|
||||||
GRANT ALL PRIVILEGES ON cloudkitty.* TO 'CK_DBUSER'@'localhost' IDENTIFIED BY 'CK_DBPASSWORD';
|
GRANT ALL PRIVILEGES ON cloudkitty.* TO 'CK_DBUSER'@'localhost' IDENTIFIED BY 'CK_DBPASSWORD';
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
If you need to authorize the mysql user associated to cloudkitty from another host you
|
If you need to authorize the mysql user associated to cloudkitty from another
|
||||||
have to change the line accordingly.
|
host you have to change the line accordingly.
|
||||||
|
|
||||||
Run the database synchronisation scripts::
|
Run the database synchronisation scripts::
|
||||||
|
|
||||||
|
@ -174,10 +174,10 @@ cloudkitty uses Keystone for authentication, and provides a ``rating`` service.
|
||||||
To integrate cloudkitty to Keystone, run the following commands (as OpenStack
|
To integrate cloudkitty to Keystone, run the following commands (as OpenStack
|
||||||
administrator)::
|
administrator)::
|
||||||
|
|
||||||
openstack user create cloudkitty --password CK_PASSWORD --email cloudkitty@localhost
|
openstack user create cloudkitty --password CK_PASSWORD \
|
||||||
|
--email cloudkitty@localhost
|
||||||
openstack role add --project service --user cloudkitty admin
|
openstack role add --project service --user cloudkitty admin
|
||||||
|
|
||||||
|
|
||||||
Give the ``rating`` role to ``cloudkitty`` for each project that should be
|
Give the ``rating`` role to ``cloudkitty`` for each project that should be
|
||||||
handled by cloudkitty::
|
handled by cloudkitty::
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,8 @@ Policy configuration
|
||||||
Configuration
|
Configuration
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
The following is an overview of all available policies in Cloudkitty. For a sample
|
The following is an overview of all available policies in Cloudkitty.
|
||||||
configuration file, refer to :doc:`samples/policy-yaml`.
|
For a sample configuration file, refer to :doc:`samples/policy-yaml`.
|
||||||
|
|
||||||
.. show-policy::
|
.. show-policy::
|
||||||
:config-file: ../../etc/oslo-policy-generator/cloudkitty.conf
|
:config-file: ../../etc/oslo-policy-generator/cloudkitty.conf
|
||||||
|
|
|
@ -2,17 +2,18 @@
|
||||||
Storage backend (v2)
|
Storage backend (v2)
|
||||||
====================
|
====================
|
||||||
|
|
||||||
.. warning:: This backend is considered unstable and should be used for upstream
|
.. warning:: This backend is considered unstable and should be used for
|
||||||
development only.
|
upstream development only.
|
||||||
|
|
||||||
In order to implement a storage backend for cloudkitty, you'll have to implement
|
In order to implement a storage backend for cloudkitty, you'll have to
|
||||||
the following abstract class:
|
implement the following abstract class:
|
||||||
|
|
||||||
.. autoclass:: cloudkitty.storage.v2.BaseStorage
|
.. autoclass:: cloudkitty.storage.v2.BaseStorage
|
||||||
:members:
|
:members:
|
||||||
|
|
||||||
You'll then need to register an entrypoint corresponding to your storage backend
|
You'll then need to register an entrypoint corresponding to your storage
|
||||||
in the ``cloudkitty.storage.v2.backends`` section of the ``setup.cfg`` file.
|
backend in the ``cloudkitty.storage.v2.backends`` section of the ``setup.cfg``
|
||||||
|
file.
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
=======
|
=======
|
||||||
|
|
|
@ -6,10 +6,11 @@ The following is a sample Cloudkitty policy file that has been auto-generated
|
||||||
from default policy values in code. If you're using the default policies, then
|
from default policy values in code. If you're using the default policies, then
|
||||||
the maintenance of this file is not necessary, and it should not be copied into
|
the maintenance of this file is not necessary, and it should not be copied into
|
||||||
a deployment. Doing so will result in duplicate policy definitions. It is here
|
a deployment. Doing so will result in duplicate policy definitions. It is here
|
||||||
to help explain which policy operations protect specific Cloudkitty APIs, but it
|
to help explain which policy operations protect specific Cloudkitty APIs, but
|
||||||
is not suggested to copy and paste into a deployment unless you're planning on
|
it is not suggested to copy and paste into a deployment unless you're planning
|
||||||
providing a different policy for an operation that is not the default.
|
on providing a different policy for an operation that is not the default.
|
||||||
|
|
||||||
The sample policy file can also be viewed in `file form <_static/policy.yaml.sample>`_.
|
The sample policy file can also be viewed in
|
||||||
|
`file form <_static/policy.yaml.sample>`_.
|
||||||
|
|
||||||
.. literalinclude:: _static/policy.yaml.sample
|
.. literalinclude:: _static/policy.yaml.sample
|
||||||
|
|
|
@ -41,3 +41,5 @@ oslotest==1.10.0 # Apache-2.0
|
||||||
sphinxcontrib-pecanwsme==0.8 # Apache-2.0
|
sphinxcontrib-pecanwsme==0.8 # Apache-2.0
|
||||||
reno==1.8.0 # Apache2
|
reno==1.8.0 # Apache2
|
||||||
sphinxcontrib-httpdomain==1.6.0 # Apache-2.0
|
sphinxcontrib-httpdomain==1.6.0 # Apache-2.0
|
||||||
|
doc8==0.6.0 # Apache-2.0
|
||||||
|
Pygments==2.2.0 # BSD
|
||||||
|
|
|
@ -18,3 +18,5 @@ oslotest>=1.10.0 # Apache-2.0
|
||||||
sphinxcontrib-httpdomain>=1.6.0 # BSD
|
sphinxcontrib-httpdomain>=1.6.0 # BSD
|
||||||
sphinxcontrib-pecanwsme>=0.8 # Apache-2.0
|
sphinxcontrib-pecanwsme>=0.8 # Apache-2.0
|
||||||
reno>=1.8.0 # Apache-2.0
|
reno>=1.8.0 # Apache-2.0
|
||||||
|
doc8>=0.6.0 # Apache-2.0
|
||||||
|
Pygments>=2.2.0 # BSD license
|
||||||
|
|
4
tox.ini
4
tox.ini
|
@ -25,6 +25,7 @@ commands = oslo_debug_helper {posargs}
|
||||||
basepython = python3
|
basepython = python3
|
||||||
commands =
|
commands =
|
||||||
flake8 {posargs} cloudkitty
|
flake8 {posargs} cloudkitty
|
||||||
|
doc8 {posargs}
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
|
@ -60,6 +61,9 @@ filename = *.py,app.wsgi
|
||||||
exclude = .git,.venv,.tox,dist,doc,*egg,build,.ropeproject,releasenotes
|
exclude = .git,.venv,.tox,dist,doc,*egg,build,.ropeproject,releasenotes
|
||||||
ignore = H105
|
ignore = H105
|
||||||
|
|
||||||
|
[doc8]
|
||||||
|
ignore-path = .venv,.git,.tox,.tmp,*cloudkitty/locale*,*lib/python*,cloudkitty.egg*,doc/build,releasenotes/*
|
||||||
|
|
||||||
[hacking]
|
[hacking]
|
||||||
import_exceptions = cloudkitty.i18n
|
import_exceptions = cloudkitty.i18n
|
||||||
local-check-factory = cloudkitty.hacking.checks.factory
|
local-check-factory = cloudkitty.hacking.checks.factory
|
||||||
|
|
Loading…
Reference in New Issue