|
|
@ -301,6 +301,10 @@ def get_plugin_info(module_dir, limit_to=None, verbose=False):
|
|
|
|
# Start at the second directory because we don't want the "vendor"
|
|
|
|
# Start at the second directory because we don't want the "vendor"
|
|
|
|
mod_path_only = os.path.dirname(module_path[len(module_dir):])
|
|
|
|
mod_path_only = os.path.dirname(module_path[len(module_dir):])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Find the subcategory for each module
|
|
|
|
|
|
|
|
relative_dir = mod_path_only.split('/')[1]
|
|
|
|
|
|
|
|
sub_category = mod_path_only[len(relative_dir) + 2:]
|
|
|
|
|
|
|
|
|
|
|
|
primary_category = ''
|
|
|
|
primary_category = ''
|
|
|
|
module_categories = []
|
|
|
|
module_categories = []
|
|
|
|
# build up the categories that this module belongs to
|
|
|
|
# build up the categories that this module belongs to
|
|
|
@ -338,6 +342,7 @@ def get_plugin_info(module_dir, limit_to=None, verbose=False):
|
|
|
|
'returndocs': returndocs,
|
|
|
|
'returndocs': returndocs,
|
|
|
|
'categories': module_categories,
|
|
|
|
'categories': module_categories,
|
|
|
|
'primary_category': primary_category,
|
|
|
|
'primary_category': primary_category,
|
|
|
|
|
|
|
|
'sub_category': sub_category,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# keep module tests out of becoming module docs
|
|
|
|
# keep module tests out of becoming module docs
|
|
|
@ -587,7 +592,7 @@ def process_categories(plugin_info, categories, templates, output_dir, output_na
|
|
|
|
write_data(text, output_dir, category_filename)
|
|
|
|
write_data(text, output_dir, category_filename)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def process_support_levels(plugin_info, templates, output_dir, plugin_type):
|
|
|
|
def process_support_levels(plugin_info, categories, templates, output_dir, plugin_type):
|
|
|
|
supported_by = {'Ansible Core Team': {'slug': 'core_supported',
|
|
|
|
supported_by = {'Ansible Core Team': {'slug': 'core_supported',
|
|
|
|
'modules': [],
|
|
|
|
'modules': [],
|
|
|
|
'output': 'core_maintained.rst',
|
|
|
|
'output': 'core_maintained.rst',
|
|
|
@ -650,9 +655,24 @@ These modules are currently shipped with Ansible, but will most likely be shippe
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
raise AnsibleError('Unknown supported_by value: %s' % info['metadata']['supported_by'])
|
|
|
|
raise AnsibleError('Unknown supported_by value: %s' % info['metadata']['supported_by'])
|
|
|
|
|
|
|
|
|
|
|
|
# Render the module lists
|
|
|
|
# Render the module lists based on category and subcategory
|
|
|
|
for maintainers, data in supported_by.items():
|
|
|
|
for maintainers, data in supported_by.items():
|
|
|
|
|
|
|
|
subcategories = {}
|
|
|
|
|
|
|
|
subcategories[''] = {}
|
|
|
|
|
|
|
|
for module in data['modules']:
|
|
|
|
|
|
|
|
new_cat = plugin_info[module]['sub_category']
|
|
|
|
|
|
|
|
category = plugin_info[module]['primary_category']
|
|
|
|
|
|
|
|
if category not in subcategories:
|
|
|
|
|
|
|
|
subcategories[category] = {}
|
|
|
|
|
|
|
|
subcategories[category][''] = {}
|
|
|
|
|
|
|
|
subcategories[category]['']['_modules'] = []
|
|
|
|
|
|
|
|
if new_cat not in subcategories[category]:
|
|
|
|
|
|
|
|
subcategories[category][new_cat] = {}
|
|
|
|
|
|
|
|
subcategories[category][new_cat]['_modules'] = []
|
|
|
|
|
|
|
|
subcategories[category][new_cat]['_modules'].append(module)
|
|
|
|
|
|
|
|
|
|
|
|
template_data = {'maintainers': maintainers,
|
|
|
|
template_data = {'maintainers': maintainers,
|
|
|
|
|
|
|
|
'subcategories': subcategories,
|
|
|
|
'modules': data['modules'],
|
|
|
|
'modules': data['modules'],
|
|
|
|
'slug': data['slug'],
|
|
|
|
'slug': data['slug'],
|
|
|
|
'module_info': plugin_info,
|
|
|
|
'module_info': plugin_info,
|
|
|
@ -747,7 +767,7 @@ def main():
|
|
|
|
process_categories(plugin_info, categories, templates, output_dir, category_list_name_template, plugin_type)
|
|
|
|
process_categories(plugin_info, categories, templates, output_dir, category_list_name_template, plugin_type)
|
|
|
|
|
|
|
|
|
|
|
|
# Render all the categories for modules
|
|
|
|
# Render all the categories for modules
|
|
|
|
process_support_levels(plugin_info, templates, output_dir, plugin_type)
|
|
|
|
process_support_levels(plugin_info, categories, templates, output_dir, plugin_type)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|