1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

now check for description and listify if needed

fixes #14371
This commit is contained in:
Brian Coca 2016-02-08 12:33:54 -05:00
parent 46ce9a0016
commit 6414c967e4

View file

@ -23,14 +23,9 @@ import os
import glob import glob
import sys import sys
import yaml import yaml
import codecs
import json
import ast
import re import re
import optparse import optparse
import time
import datetime import datetime
import subprocess
import cgi import cgi
import warnings import warnings
from jinja2 import Environment, FileSystemLoader from jinja2 import Environment, FileSystemLoader
@ -302,6 +297,11 @@ def process_module(module, options, env, template, outputname, module_map, alias
# don't show version added information if it's too old to be called out # don't show version added information if it's too old to be called out
if 'version_added' in doc['options'][k] and too_old(doc['options'][k]['version_added']): if 'version_added' in doc['options'][k] and too_old(doc['options'][k]['version_added']):
del doc['options'][k]['version_added'] del doc['options'][k]['version_added']
if not 'description' in doc['options'][k]:
raise AnsibleError("Missing required description for option %s in %s " % (k, module))
if not isinstance(doc['options'][k]['description'],list):
doc['options'][k]['description'] = [doc['options'][k]['description']]
all_keys.append(k) all_keys.append(k)
all_keys = sorted(all_keys) all_keys = sorted(all_keys)
@ -451,7 +451,6 @@ def main():
env, template, outputname = jinja2_environment(options.template_dir, options.type) env, template, outputname = jinja2_environment(options.template_dir, options.type)
categories = list_modules(options.module_dir) categories = list_modules(options.module_dir)
last_category = None
category_names = list(categories.keys()) category_names = list(categories.keys())
category_names.sort() category_names.sort()