Sanity fixes to parameter types (#52325)

This commit is contained in:
Dag Wieers
2019-02-15 16:58:58 +01:00
committed by GitHub
parent 47190088b4
commit 677c04c01d
25 changed files with 445 additions and 404 deletions

View File

@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
@@ -49,17 +50,17 @@ class InfluxDb():
@staticmethod
def influxdb_argument_spec():
return dict(
hostname=dict(default='localhost', type='str'),
port=dict(default=8086, type='int'),
username=dict(default='root', type='str', aliases=['login_username']),
password=dict(default='root', type='str', no_log=True, aliases=['login_password']),
ssl=dict(default=False, type='bool'),
validate_certs=dict(default=True, type='bool'),
hostname=dict(type='str', default='localhost'),
port=dict(type='int', default=8086),
username=dict(type='str', default='root', aliases=['login_username']),
password=dict(type='str', default='root', no_log=True, aliases=['login_password']),
ssl=dict(type='bool', default=False),
validate_certs=dict(type='bool', default=True),
timeout=dict(type='int'),
retries=dict(default=3, type='int'),
proxies=dict(default={}, type='dict'),
use_udp=dict(default=False, type='bool'),
udp_port=dict(type=int)
retries=dict(type='int', default=3),
proxies=dict(type='dict', default={}),
use_udp=dict(type='bool', default=False),
udp_port=dict(type='int'),
)
def connect_to_influxdb(self):

View File

@@ -1,23 +1,7 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Cisco and/or its affiliates.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright: (c) 2017, Cisco and/or its affiliates.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.urls import open_url
@@ -35,10 +19,10 @@ except NameError:
nso_argument_spec = dict(
url=dict(required=True),
username=dict(fallback=(env_fallback, ['ANSIBLE_NET_USERNAME']), required=True),
password=dict(fallback=(env_fallback, ['ANSIBLE_NET_PASSWORD']), required=True, no_log=True),
timeout=dict(default=300, type=int)
url=dict(type='str', required=True),
username=dict(type='str', required=True, fallback=(env_fallback, ['ANSIBLE_NET_USERNAME'])),
password=dict(type='str', required=True, no_log=True, fallback=(env_fallback, ['ANSIBLE_NET_PASSWORD'])),
timeout=dict(type='int', default=300),
)