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
parent 811eb66703
commit cb1f57d4e5
9 changed files with 86 additions and 10 deletions

View file

@ -7,6 +7,7 @@ import os
import pipes
import shutil
import subprocess
import re
import sys
import time
@ -495,4 +496,18 @@ def docker_qualify_image(name):
return 'ansible/ansible:%s' % name
def parse_to_dict(pattern, value):
"""
:type pattern: str
:type value: str
:return: dict[str, str]
"""
match = re.search(pattern, value)
if match is None:
raise Exception('Pattern "%s" did not match value: %s' % (pattern, value))
return match.groupdict()
display = Display() # pylint: disable=locally-disabled, invalid-name