From fc852da4bca4f14888fc66173232352b35d79698 Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Tue, 16 Jun 2020 19:54:56 +0300 Subject: [PATCH] Fixes for modules generation script Change-Id: Iffbb8e9f9106860f3d896f65831d2b9283ad1e7b --- contrib/module_info_template.py.j2 | 4 ++-- contrib/module_template.py.j2 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/module_info_template.py.j2 b/contrib/module_info_template.py.j2 index da646ecb..2fb0c757 100644 --- a/contrib/module_info_template.py.j2 +++ b/contrib/module_info_template.py.j2 @@ -8,7 +8,7 @@ DOCUMENTATION = ''' --- module: {{ module_name }} short_description: {{ module_short_description }} -author: {{ author_name }} <{{ author_mail }}> +author: Openstack Ansible SIG https://wiki.openstack.org/wiki/Ansible_SIG (@openstack) description: - {{ module_long_description }} options: @@ -42,7 +42,7 @@ class {{ module_name.split("_")|map("capitalize")|list|join("") }}Module(OpenSta argument_spec = dict( {% for k, v in options.items() %} -{{ k | indent( width=8, indentfirst=True) }}=dict(type={{ v.type }} +{{ k | indent( width=8, indentfirst=True) }}=dict(type='{{ v.type }}' {%- if 'required' in v %}, required={{ v.required }}{% endif %} {%- if 'elements' in v %}, elements={{ v.elements }}{% endif %} {%- if 'default' in v %}, default={% if v.type == 'str' %}"{{ v.default }}"{% else %}{{ v.default }}{% endif %}{% endif %} diff --git a/contrib/module_template.py.j2 b/contrib/module_template.py.j2 index 44d76606..2666aeab 100644 --- a/contrib/module_template.py.j2 +++ b/contrib/module_template.py.j2 @@ -8,7 +8,7 @@ DOCUMENTATION = ''' --- module: {{ module_name }} short_description: {{ module_short_description }} -author: {{ author_name }} <{{ author_mail }}> +author: Openstack Ansible SIG https://wiki.openstack.org/wiki/Ansible_SIG (@openstack) description: - {{ module_long_description }} options: @@ -46,7 +46,7 @@ class {{ module_name.split("_")|map("capitalize")|list|join("") }}Module(OpenSta argument_spec = dict( {% for k, v in options.items() %} -{{ k | indent( width=8, indentfirst=True) }}=dict(type={{ v.type }} +{{ k | indent( width=8, indentfirst=True) }}=dict(type='{{ v.type }}' {%- if 'required' in v %}, required={{ v.required }}{% endif %} {%- if 'elements' in v %}, elements={{ v.elements }}{% endif %} {%- if 'default' in v %}, default={% if v.type == 'str' %}"{{ v.default }}"{% else %}{{ v.default }}{% endif %}{% endif %}