Try to parse RETURN as YAML
This commit is contained in:
parent
2218e763f8
commit
72690c89bd
1 changed files with 7 additions and 0 deletions
|
@ -7,6 +7,7 @@ import re
|
|||
import abc
|
||||
import ast
|
||||
import sys
|
||||
import yaml
|
||||
import argparse
|
||||
import traceback
|
||||
|
||||
|
@ -365,6 +366,12 @@ class ModuleValidator(Validator):
|
|||
self.errors.append('No EXAMPLES provided')
|
||||
if not bool(ret):
|
||||
self.warnings.append('No RETURN provided')
|
||||
else:
|
||||
try:
|
||||
yaml.safe_load(ret)
|
||||
except:
|
||||
self.errors.append('RETURN is not valid YAML')
|
||||
self.traces.append(traceback.format_exc())
|
||||
|
||||
if self._python_module() and not self._just_docs():
|
||||
self._check_for_sys_exit()
|
||||
|
|
Loading…
Reference in a new issue