From 6414c967e4399f38ceb344d5d944cfb8df696acb Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Mon, 8 Feb 2016 12:33:54 -0500 Subject: [PATCH] now check for description and listify if needed fixes #14371 --- hacking/module_formatter.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hacking/module_formatter.py b/hacking/module_formatter.py index 43b76ae71b..011bfd53c4 100755 --- a/hacking/module_formatter.py +++ b/hacking/module_formatter.py @@ -23,14 +23,9 @@ import os import glob import sys import yaml -import codecs -import json -import ast import re import optparse -import time import datetime -import subprocess import cgi import warnings 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 if 'version_added' in doc['options'][k] and too_old(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 = sorted(all_keys) @@ -451,7 +451,6 @@ def main(): env, template, outputname = jinja2_environment(options.template_dir, options.type) categories = list_modules(options.module_dir) - last_category = None category_names = list(categories.keys()) category_names.sort()