Fix ansible-doc and docsite generation for removed modules

* Fix ansible-doc wrt removed modules
  * Fix listing of modules ia ansible-doc to not complain about removed modules
    Removed modules are marked as such in the metadata but nowhere else.
    Need to retrieve the metadata when a module doesn't have a doc so that
    we can tell if it falls under this case.
  * omit removed modules from json dump
  * Print an error that the module has been removed if attempting to run
    ansible-doc on that specific module

* Get plugin_formatter to stop outputting removed modules
This commit is contained in:
Toshio Kuratomi 2018-08-22 19:55:39 -07:00
parent b2932a41b0
commit 0873d46617
4 changed files with 59 additions and 53 deletions

View file

@ -120,16 +120,3 @@ def get_docstring(filename, fragment_loader, verbose=False, ignore_errors=False)
add_fragments(data['doc'], filename, fragment_loader=fragment_loader)
return data['doc'], data['plainexamples'], data['returndocs'], data['metadata']
def get_docstub(filename, fragment_loader, verbose=False, ignore_errors=False):
"""
When only short_description is needed, load a stub of the full DOCUMENTATION string to speed up operation.
"""
data = read_docstub(filename, verbose=verbose, ignore_errors=ignore_errors)
if data.get('doc', False):
add_fragments(data['doc'], filename, fragment_loader=fragment_loader)
return data['doc'], data['plainexamples'], data['returndocs'], data['metadata']