Browse Source

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
changes/10/582110/3
Dao Cong Tien 3 years ago
committed by Luka Peschke
parent
commit
b3ae81dc92
  1. 8
      HACKING.rst
  2. 3
      README.rst
  3. 50
      devstack/README.rst
  4. 8
      doc/source/configuration/configuration.rst
  5. 4
      doc/source/configuration/policy.rst
  6. 13
      doc/source/developer/storage.rst
  7. 9
      doc/source/sample_policy.rst
  8. 2
      lower-constraints.txt
  9. 2
      test-requirements.txt
  10. 4
      tox.ini

8
HACKING.rst

@ -13,15 +13,17 @@ Cloudkitty Specific Commandments
- [C311] Use assertIsNone(...) instead of assertEqual(None, ...).
- [C312] Use assertTrue(...) rather than assertEqual(True, ...).
- [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
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
with a sequence of key-value pairs.
- [C319] Ensure to not use xrange().
- [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
----------------

3
README.rst

@ -85,7 +85,8 @@ want to install it on an older system, use a virtualenv.
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

50
devstack/README.rst

@ -8,34 +8,44 @@ with DevStack.
Configure DevStack to run CloudKitty
====================================
.. code-block:: bash
$ DEVSTACK_DIR=/path/to/devstack
1. Enable Ceilometer::
1. Enable Ceilometer:
.. code-block:: bash
$ cd ${DEVSTACK_DIR}
$ cat >> local.conf << EOF
[[local|localrc]]
# ceilometer
enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer.git master
EOF
2. Enable CloudKitty:
.. code-block:: bash
$ 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}
cat >> local.conf << EOF
# cloudkitty
enable_plugin cloudkitty https://git.openstack.org/openstack/cloudkitty master
enable_service ck-api, ck-proc
EOF
2. Enable CloudKitty::
3. Set CloudKitty collector to gnocchi:
$ cd ${DEVSTACK_DIR}
cat >> local.conf << EOF
# cloudkitty
enable_plugin cloudkitty https://git.openstack.org/openstack/cloudkitty master
enable_service ck-api, ck-proc
EOF
.. code-block:: bash
3. Set CloudKitty collector to gnocchi::
$ cd ${DEVSTACK_DIR}
cat >> local.conf << EOF
CLOUDKITTY_COLLECTOR=gnocchi
EOF
$ cd ${DEVSTACK_DIR}
cat >> local.conf << EOF
CLOUDKITTY_COLLECTOR=gnocchi
EOF
Run devstack as usual:
Run devstack as usual::
.. code-block:: bash
$ ./stack.sh

8
doc/source/configuration/configuration.rst

@ -153,8 +153,8 @@ the ``mysql`` client::
GRANT ALL PRIVILEGES ON cloudkitty.* TO 'CK_DBUSER'@'localhost' IDENTIFIED BY 'CK_DBPASSWORD';
EOF
If you need to authorize the mysql user associated to cloudkitty from another host you
have to change the line accordingly.
If you need to authorize the mysql user associated to cloudkitty from another
host you have to change the line accordingly.
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
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
Give the ``rating`` role to ``cloudkitty`` for each project that should be
handled by cloudkitty::

4
doc/source/configuration/policy.rst

@ -5,8 +5,8 @@ Policy configuration
Configuration
~~~~~~~~~~~~~
The following is an overview of all available policies in Cloudkitty. For a sample
configuration file, refer to :doc:`samples/policy-yaml`.
The following is an overview of all available policies in Cloudkitty.
For a sample configuration file, refer to :doc:`samples/policy-yaml`.
.. show-policy::
:config-file: ../../etc/oslo-policy-generator/cloudkitty.conf

13
doc/source/developer/storage.rst

@ -2,17 +2,18 @@
Storage backend (v2)
====================
.. warning:: This backend is considered unstable and should be used for upstream
development only.
.. warning:: This backend is considered unstable and should be used for
upstream development only.
In order to implement a storage backend for cloudkitty, you'll have to implement
the following abstract class:
In order to implement a storage backend for cloudkitty, you'll have to
implement the following abstract class:
.. autoclass:: cloudkitty.storage.v2.BaseStorage
:members:
You'll then need to register an entrypoint corresponding to your storage backend
in the ``cloudkitty.storage.v2.backends`` section of the ``setup.cfg`` file.
You'll then need to register an entrypoint corresponding to your storage
backend in the ``cloudkitty.storage.v2.backends`` section of the ``setup.cfg``
file.
Testing
=======

9
doc/source/sample_policy.rst

@ -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
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
to help explain which policy operations protect specific Cloudkitty APIs, but it
is not suggested to copy and paste into a deployment unless you're planning on
providing a different policy for an operation that is not the default.
to help explain which policy operations protect specific Cloudkitty APIs, but
it is not suggested to copy and paste into a deployment unless you're planning
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

2
lower-constraints.txt

@ -41,3 +41,5 @@ oslotest==1.10.0 # Apache-2.0
sphinxcontrib-pecanwsme==0.8 # Apache-2.0
reno==1.8.0 # Apache2
sphinxcontrib-httpdomain==1.6.0 # Apache-2.0
doc8==0.6.0 # Apache-2.0
Pygments==2.2.0 # BSD

2
test-requirements.txt

@ -18,3 +18,5 @@ oslotest>=1.10.0 # Apache-2.0
sphinxcontrib-httpdomain>=1.6.0 # BSD
sphinxcontrib-pecanwsme>=0.8 # 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

@ -25,6 +25,7 @@ commands = oslo_debug_helper {posargs}
basepython = python3
commands =
flake8 {posargs} cloudkitty
doc8 {posargs}
[testenv:cover]
basepython = python3
@ -60,6 +61,9 @@ filename = *.py,app.wsgi
exclude = .git,.venv,.tox,dist,doc,*egg,build,.ropeproject,releasenotes
ignore = H105
[doc8]
ignore-path = .venv,.git,.tox,.tmp,*cloudkitty/locale*,*lib/python*,cloudkitty.egg*,doc/build,releasenotes/*
[hacking]
import_exceptions = cloudkitty.i18n
local-check-factory = cloudkitty.hacking.checks.factory

Loading…
Cancel
Save