mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 13:52:54 +00: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user