diff --git a/lib/ansible/cli/doc.py b/lib/ansible/cli/doc.py index 4d9dfbe57d2..4260f1eefcd 100755 --- a/lib/ansible/cli/doc.py +++ b/lib/ansible/cli/doc.py @@ -1176,6 +1176,7 @@ class DocCLI(CLI, RoleMixin): def add_fields(text, fields, limit, opt_indent, return_values=False, base_indent='', man=False): for o in sorted(fields): + # Create a copy so we don't modify the original (in case YAML anchors have been used) opt = dict(fields[o]) diff --git a/lib/ansible/parsing/plugin_docs.py b/lib/ansible/parsing/plugin_docs.py index 8dc357b3792..a1f16106ccf 100644 --- a/lib/ansible/parsing/plugin_docs.py +++ b/lib/ansible/parsing/plugin_docs.py @@ -18,6 +18,7 @@ string_to_vars = { 'DOCUMENTATION': 'doc', 'EXAMPLES': 'plainexamples', 'RETURN': 'returndocs', + 'SEEALSO': 'seealso', 'ANSIBLE_METADATA': 'metadata', # NOTE: now unused, but kept for backwards compat } @@ -126,7 +127,6 @@ def read_docstring_from_python_file(filename, verbose=True, ignore_errors=True): """ data = _init_doc_dict() - try: with open(filename, 'rb') as b_module_data: M = ast.parse(b_module_data.read())