Add rstcheck to ansible-test and correct issues. (#23550)

* Add rstcheck to ansible-test.
* Fix rst code-block languages and syntax errors.
* Fix rst inline literals.
* Update python 2 code block to pass tests on py 3.
This commit is contained in:
Matt Clay 2017-04-13 10:28:52 -07:00 committed by GitHub
commit cb1f57d4e5
9 changed files with 86 additions and 10 deletions

View file

@ -171,7 +171,7 @@ You should never do this in a module:
.. code-block:: python
print "some status message"
print("some status message")
Because the output is supposed to be valid JSON.

View file

@ -130,6 +130,7 @@ to yield text but instead do the conversion explicitly ourselves. For example:
# Handle the exception gracefully -- usually by displaying a good
# user-centric error message that can be traced back to this piece
# of code.
pass
.. note:: Much of Ansible assumes that all encoded text is UTF-8. At some
point, if there is demand for other encodings we may change that, but for
@ -293,7 +294,8 @@ new exception-catching syntax which uses the ``as`` keyword:
Do **not** use the following syntax as it will fail on every version of Python-3:
.. code-block:: python
.. This code block won't highlight because python2 isn't recognized. This is necessary to pass tests under python 3.
.. code-block:: python2
try:
a = 2/0
@ -399,7 +401,6 @@ Python-2 and Python-3. You may still see this used in some modules:
.. code-block:: python
from ansible.module_utils.pycompat24 import get_exception
[...]
try:
a = 2/0

View file

@ -185,11 +185,11 @@ If the PR does not resolve the issue, or if you see any failures from the unit/i
|
| When I ran this Ubuntu 16.04 it failed with the following:
|
| ```
| \```
| BLARG
| StrackTrace
| RRRARRGGG
| ```
| \```
When you are done testing a feature branch, you can remove it with the following command:

View file

@ -107,13 +107,13 @@ Edit your /etc/krb5.conf (which should be installed as a result of installing pa
In the section that starts with
.. code-block:: bash
.. code-block:: ini
[realms]
add the full domain name and the fully qualified domain names of your primary and secondary Active Directory domain controllers. It should look something like this:
.. code-block:: bash
.. code-block:: ini
[realms]
@ -125,7 +125,7 @@ add the full domain name and the fully qualified domain names of your primary an
and in the [domain_realm] section add a line like the following for each domain you want to access:
.. code-block:: bash
.. code-block:: ini
[domain_realm]
.my.domain.com = MY.DOMAIN.COM

View file

@ -151,7 +151,7 @@ talk to the remote network device. This generally means that there is an authent
For example:
.. code-block::
.. code-block:: none
TASK [prepare_eos_tests : enable cli on remote device] **************************************************
fatal: [veos01]: FAILED! => {"changed": false, "failed": true, "msg": "unable to open shell"}
@ -160,7 +160,7 @@ For example:
or:
.. code-block:: yaml
.. code-block:: none
TASK [ios_system : configure name_servers] *************************************************************
task path: