mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
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:
parent
811eb66703
commit
cb1f57d4e5
9 changed files with 86 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue