Fixes for modules generation script

Change-Id: Iffbb8e9f9106860f3d896f65831d2b9283ad1e7b
This commit is contained in:
Sagi Shnaidman
2020-06-16 19:54:56 +03:00
parent 5717f05102
commit fc852da4bc
2 changed files with 4 additions and 4 deletions

View File

@@ -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 %}

View File

@@ -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 %}