fixes to ansible-doc (#47682)

fixes to ansible-doc
 - change json to always be type dependent
 - change changelog generation to loop over the options
 - warn about ignoring module path
This commit is contained in:
Brian Coca
2018-12-10 11:37:15 -05:00
committed by GitHub
parent 18bf48cec2
commit 20270680fc
3 changed files with 16 additions and 10 deletions

View File

@@ -24,6 +24,8 @@ try:
except ImportError:
argcomplete = None
from ansible import constants as C
BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
CHANGELOG_DIR = os.path.join(BASE_DIR, 'changelogs')
CONFIG_PATH = os.path.join(CHANGELOG_DIR, 'config.yaml')
@@ -173,7 +175,9 @@ def load_plugins(version, force_reload):
LOGGER.info('refreshing plugin cache')
plugins_data['version'] = version
plugins_data['plugins'] = json.loads(subprocess.check_output([os.path.join(BASE_DIR, 'bin', 'ansible-doc'), '--json']))
for plugin_type in C.DOCUMENTABLE_PLUGINS:
plugins_data['plugins'][plugin_type] = json.loads(subprocess.check_output([os.path.join(BASE_DIR, 'bin', 'ansible-doc'),
'--json', '-t', plugin_type]))
# remove empty namespaces from plugins
for section in plugins_data['plugins'].values():