Fix various sanity errors in plugins.

This commit is contained in:
Felix Fontein 2020-09-12 22:26:45 +02:00
parent a10af345a9
commit 07250b074a
22 changed files with 45 additions and 12 deletions

View file

@ -7,7 +7,7 @@ __metaclass__ = type
DOCUMENTATION = '''
callback: tree
callback_type: notification
type: notification
requirements:
- invoked in the command line
short_description: Save host events to files

View file

@ -6,7 +6,7 @@ __metaclass__ = type
DOCUMENTATION = """
author: Ansible Core Team
connection: paramiko
connection: paramiko_ssh
short_description: Run tasks via python ssh (paramiko)
description:
- Use the python ssh implementation (Paramiko) to connect to targets

View file

@ -9,6 +9,7 @@ DOCUMENTATION = '''
plugin_type: inventory
author:
- Matt Davis <@nitzmahone>
version_added: "2.5"
short_description: Loads and executes an inventory plugin specified in a YAML config
description:
- By whitelisting C(auto) inventory plugin, any YAML inventory config file with a

View file

@ -153,7 +153,7 @@ class InventoryModule(BaseFileInventoryPlugin):
NAME = 'toml'
def _parse_group(self, group, group_data):
if not isinstance(group_data, (MutableMapping, type(None))):
if group_data is not None and not isinstance(group_data, MutableMapping):
self.display.warning("Skipping '%s' as this is not a valid group definition" % group)
return

View file

@ -53,6 +53,7 @@ RETURN = """
_raw:
description:
- value(s) of the key(s) in the config
type: raw
"""
from ansible import constants as C

View file

@ -61,6 +61,8 @@ RETURN = """
_raw:
description:
- value(s) stored in file column
type: list
elements: str
"""
import codecs

View file

@ -45,6 +45,8 @@ RETURN = """
_raw:
description:
- content of file(s)
type: list
elements: str
"""
from ansible.errors import AnsibleError, AnsibleParserError

View file

@ -41,6 +41,8 @@ RETURN = """
_list:
description:
- list of files
type: list
elements: path
"""
import os

View file

@ -99,6 +99,8 @@ RETURN = """
_raw:
description:
- path to file found
type: list
elements: path
"""
import os

View file

@ -31,6 +31,7 @@ RETURN = """
description:
- list with each item.0 giving you the position and item.1 the value
type: list
elements: list
"""
from ansible.errors import AnsibleError

View file

@ -56,6 +56,8 @@ RETURN = """
_raw:
description:
- value(s) of the key(s) in the ini file
type: list
elements: str
"""
import os
import re

View file

@ -37,6 +37,8 @@ RETURN = """
_list:
description:
- lines of stdout from command
type: list
elements: str
"""
import subprocess

View file

@ -27,6 +27,8 @@ EXAMPLES = """
RETURN = """
_list:
description: basically the same as you fed in
type: list
elements: raw
"""
from ansible.module_utils.common._collections_compat import Sequence

View file

@ -95,6 +95,8 @@ RETURN = """
_raw:
description:
- a password
type: list
elements: str
"""
import os

View file

@ -40,6 +40,8 @@ RETURN = r"""
_string:
description:
- stdout from command
type: list
elements: str
"""
import subprocess

View file

@ -30,6 +30,7 @@ RETURN = """
_raw:
description:
- random item
type: raw
"""
import random

View file

@ -74,6 +74,7 @@ RETURN = """
description:
- A list containing generated sequence of items
type: list
elements: str
"""
from re import compile as re_compile, IGNORECASE

View file

@ -55,6 +55,8 @@ EXAMPLES = """
RETURN = """
_raw:
description: file(s) content after templating
type: list
elements: raw
"""
from copy import deepcopy

View file

@ -32,6 +32,8 @@ EXAMPLES = """
RETURN = """
_list:
description: synchronized list
type: list
elements: list
"""
from ansible.errors import AnsibleError
from ansible.module_utils.six.moves import zip_longest

View file

@ -26,6 +26,8 @@ RETURN = """
_raw:
description:
- content of file(s) as bytes
type: list
elements: raw
"""
from ansible.errors import AnsibleParserError

View file

@ -50,7 +50,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_FORCE
ini:
- section: url_lookup
- key: force
key: force
timeout:
description: How long to wait for the server to send data before giving up
type: float
@ -62,7 +62,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_TIMEOUT
ini:
- section: url_lookup
- key: timeout
key: timeout
http_agent:
description: User-Agent to use in the request
type: string
@ -73,7 +73,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_AGENT
ini:
- section: url_lookup
- key: agent
key: agent
force_basic_auth:
description: Force basic authentication
type: boolean
@ -85,7 +85,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_AGENT
ini:
- section: url_lookup
- key: agent
key: agent
follow_redirects:
description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information
type: string
@ -97,7 +97,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_FOLLOW_REDIRECTS
ini:
- section: url_lookup
- key: follow_redirects
key: follow_redirects
use_gssapi:
description: Use GSSAPI handler of requests
type: boolean
@ -109,7 +109,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_USE_GSSAPI
ini:
- section: url_lookup
- key: use_gssapi
key: use_gssapi
unix_socket:
description: String of file system path to unix socket file to use when establishing connection to the provided url
type: string
@ -120,7 +120,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_UNIX_SOCKET
ini:
- section: url_lookup
- key: unix_socket
key: unix_socket
ca_path:
description: String of file system path to CA cert bundle to use
type: string
@ -131,7 +131,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_CA_PATH
ini:
- section: url_lookup
- key: ca_path
key: ca_path
unredirected_headers:
description: A list of headers to not attach on a redirected request
type: list
@ -142,7 +142,7 @@ options:
- name: ANSIBLE_LOOKUP_URL_UNREDIR_HEADERS
ini:
- section: url_lookup
- key: unredirected_headers
key: unredirected_headers
"""
EXAMPLES = """
@ -166,6 +166,8 @@ EXAMPLES = """
RETURN = """
_list:
description: list of list of lines or content of url(s)
type: list
elements: str
"""
from ansible.errors import AnsibleError

View file

@ -63,6 +63,8 @@ RETURN = """
_value:
description:
- value of the variables requested.
type: list
elements: raw
"""
from ansible.errors import AnsibleError, AnsibleUndefinedVariable