PEP 8 W291 whitespace cleanup.

This commit is contained in:
Matt Clay 2017-01-27 15:20:31 -08:00
commit d913f69ba1
166 changed files with 493 additions and 565 deletions

View file

@ -93,7 +93,7 @@ RETURN = '''
EXAMPLES = '''
# Create a new server
- a10_server:
- a10_server:
host: a10.mydomain.com
username: myadmin
password: mypassword

View file

@ -81,7 +81,7 @@ RETURN = '''
EXAMPLES = '''
# Create a new server
- a10_server:
- a10_server:
host: a10.mydomain.com
username: myadmin
password: mypassword

View file

@ -88,7 +88,7 @@ RETURN = '''
EXAMPLES = '''
# Create a new service-group
- a10_service_group:
- a10_service_group:
host: a10.mydomain.com
username: myadmin
password: mypassword

View file

@ -86,7 +86,7 @@ RETURN = '''
EXAMPLES = '''
# Create a new virtual server
- a10_virtual_server:
- a10_virtual_server:
host: a10.mydomain.com
username: myadmin
password: mypassword

View file

@ -173,39 +173,39 @@ author: "Jan-Piet Mens (@jpmens)"
EXAMPLES='''
- name: download foo.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
mode: 0440
- name: download file and force basic auth
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
force_basic_auth: yes
- name: download file with custom HTTP headers
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
headers: 'key:value,key:value'
- name: download file with check (sha256)
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
checksum: sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
- name: download file with check (md5)
get_url:
url: http://example.com/path/file.conf
get_url:
url: http://example.com/path/file.conf
dest: /etc/foo.conf
checksum: md5:66dffb5228a211e61d6d7ef4a86f5758
- name: download file from a file path
get_url:
url: "file:///tmp/afile.txt"
dest: /tmp/afilecopy.txt
get_url:
url: "file:///tmp/afile.txt"
dest: /tmp/afilecopy.txt
'''
from ansible.module_utils.six.moves.urllib.parse import urlsplit
@ -427,7 +427,7 @@ def main():
if os.path.exists(dest):
backup_file = module.backup_local(dest)
shutil.copyfile(tmpsrc, dest)
except Exception:
except Exception:
err = get_exception()
os.remove(tmpsrc)
module.fail_json(msg="failed to copy %s to %s: %s" % (tmpsrc, dest, str(err)))

View file

@ -42,7 +42,7 @@ notes:
- This module returns an 'in memory' base64 encoded version of the file, take into account that this will require at least twice the RAM as the original file size.
- "See also: M(fetch)"
requirements: []
author:
author:
- "Ansible Core Team"
- "Michael DeHaan"
'''

View file

@ -37,7 +37,7 @@ extends_documentation_fragment: cloudengine
options:
commands:
description:
- The commands to send to the remote HUAWEI CloudEngine device
- The commands to send to the remote HUAWEI CloudEngine device
over the configured provider. The resulting output from the
command is returned. If the I(wait_for) argument is provided,
the module is not returned until the condition is satisfied

View file

@ -163,13 +163,13 @@ class Default(FactsBase):
def populate(self):
data = self.runner.get_command('show version | display-xml')
xml_data = ET.fromstring(data)
xml_data = ET.fromstring(data)
self.facts['name'] = self.parse_name(xml_data)
self.facts['version'] = self.parse_version(xml_data)
data = self.runner.get_command('show system | display-xml')
xml_data = ET.fromstring(data)
xml_data = ET.fromstring(data)
self.facts['servicetag'] = self.parse_serialnum(xml_data)
self.facts['model'] = self.parse_model(xml_data)
@ -178,14 +178,14 @@ class Default(FactsBase):
self.facts['hostname'] = self.parse_hostname(data)
def parse_name(self, data):
sw_name = data.find('./data/system-sw-state/sw-version/sw-name')
sw_name = data.find('./data/system-sw-state/sw-version/sw-name')
if sw_name is not None:
return sw_name.text
else:
return ""
def parse_version(self, data):
sw_ver = data.find('./data/system-sw-state/sw-version/sw-version')
sw_ver = data.find('./data/system-sw-state/sw-version/sw-version')
if sw_ver is not None:
return sw_ver.text
else:
@ -197,14 +197,14 @@ class Default(FactsBase):
return match.group(1)
def parse_model(self, data):
prod_name = data.find('./data/system/node/mfg-info/product-name')
prod_name = data.find('./data/system/node/mfg-info/product-name')
if prod_name is not None:
return prod_name.text
else:
return ""
def parse_serialnum(self, data):
svc_tag = data.find('./data/system/node/unit/mfg-info/service-tag')
svc_tag = data.find('./data/system/node/unit/mfg-info/service-tag')
if svc_tag is not None:
return svc_tag.text
else:
@ -219,7 +219,7 @@ class Hardware(FactsBase):
def populate(self):
data = self.runner.get_command('show version | display-xml')
xml_data = ET.fromstring(data)
xml_data = ET.fromstring(data)
self.facts['cpu_arch'] = self.parse_cpu_arch(xml_data)
@ -231,7 +231,7 @@ class Hardware(FactsBase):
self.facts['memfree_mb'] = int(match[2]) / 1024
def parse_cpu_arch(self, data):
cpu_arch = data.find('./data/system-sw-state/sw-version/cpu-arch')
cpu_arch = data.find('./data/system-sw-state/sw-version/cpu-arch')
if cpu_arch is not None:
return cpu_arch.text
else:
@ -262,7 +262,7 @@ class Interfaces(FactsBase):
data = self.runner.get_command('show interface | display-xml')
xml_data = ET.fromstring(data)
xml_data = ET.fromstring(data)
self.facts['interfaces'] = self.populate_interfaces(xml_data)
self.facts['neighbors'] = self.populate_neighbors(xml_data)
@ -274,11 +274,11 @@ class Interfaces(FactsBase):
intf = dict()
name = self.parse_item(interface, 'name')
intf['description'] = self.parse_item(interface, 'description')
intf['description'] = self.parse_item(interface, 'description')
intf['duplex'] = self.parse_item(interface, 'duplex')
intf['primary_ipv4'] = self.parse_primary_ipv4(interface)
intf['primary_ipv4'] = self.parse_primary_ipv4(interface)
intf['secondary_ipv4'] = self.parse_secondary_ipv4(interface)
intf['ipv6'] = self.parse_ipv6_address(interface)
intf['ipv6'] = self.parse_ipv6_address(interface)
intf['mtu'] = self.parse_item(interface, 'mtu')
intf['type'] = self.parse_item(interface, 'type')
@ -287,7 +287,7 @@ class Interfaces(FactsBase):
for interface in interfaces.findall('./data/interfaces-state/interface'):
name = self.parse_item(interface, 'name')
intf = int_facts[name]
intf['bandwidth'] = self.parse_item(interface, 'speed')
intf['bandwidth'] = self.parse_item(interface, 'speed')
intf['adminstatus'] = self.parse_item(interface, 'admin-status')
intf['operstatus'] = self.parse_item(interface, 'oper-status')
intf['macaddress'] = self.parse_item(interface, 'phys-address')
@ -295,20 +295,20 @@ class Interfaces(FactsBase):
for interface in interfaces.findall('./data/ports/ports-state/port'):
name = self.parse_item(interface, 'name')
fanout = self.parse_item(interface, 'fanout-state')
mediatype = self.parse_item(interface, 'media-type')
mediatype = self.parse_item(interface, 'media-type')
typ, sname = name.split('-eth')
if fanout == "BREAKOUT_1x1":
name = "ethernet" + sname
intf = int_facts[name]
intf['mediatype'] = mediatype
intf['mediatype'] = mediatype
else:
#TODO: Loop for the exact subport
for subport in xrange(1, 5):
name = "ethernet" + sname + ":" + str(subport)
intf = int_facts[name]
intf['mediatype'] = mediatype
intf['mediatype'] = mediatype
return int_facts
@ -368,10 +368,10 @@ class Interfaces(FactsBase):
fact = dict()
fact['host'] = rem_sys_name.text
rem_sys_port = interface.find('./lldp-rem-neighbor-info/info/rem-lldp-port-id')
fact['port'] = rem_sys_port.text
fact['port'] = rem_sys_port.text
lldp_facts[name].append(fact)
return lldp_facts
return lldp_facts
FACT_SUBSETS = dict(
default=Default,

View file

@ -236,7 +236,7 @@ class Interfaces(FactsBase):
fact['address'] = matc.group(2)
fact['masklen'] = matc.group(3)
facts[intf].append(fact)
return facts
return facts
def populate_interfaces(self, interfaces, desc, properties):
facts = dict()

View file

@ -77,8 +77,8 @@ notes:
- This module requires Dell OS9 version 9.10.0.1P13 or above.
- This module requires to increase the ssh connection rate limit.
Use the following command I(ip ssh connection-rate-limit 60)
to configure the same. This can be done via M(dellos9_config) module
Use the following command I(ip ssh connection-rate-limit 60)
to configure the same. This can be done via M(dellos9_config) module
as well.
"""

View file

@ -148,8 +148,8 @@ notes:
- This module requires Dell OS9 version 9.10.0.1P13 or above.
- This module requires to increase the ssh connection rate limit.
Use the following command I(ip ssh connection-rate-limit 60)
to configure the same. This can be done via M(dellos9_config) module
Use the following command I(ip ssh connection-rate-limit 60)
to configure the same. This can be done via M(dellos9_config) module
as well.
"""

View file

@ -51,8 +51,8 @@ notes:
- This module requires Dell OS9 version 9.10.0.1P13 or above.
- This module requires to increase the ssh connection rate limit.
Use the following command I(ip ssh connection-rate-limit 60)
to configure the same. This can be done via M(dellos9_config) module
Use the following command I(ip ssh connection-rate-limit 60)
to configure the same. This can be done via M(dellos9_config) module
as well.
"""

View file

@ -58,7 +58,7 @@ options:
default: null
record_value:
description:
description:
- "Record value. HTTPRED: <redirection URL>, MX: <priority> <target name>, NS: <name server>, PTR: <target name>, SRV: <priority> <weight> <port> <target name>, TXT: <text value>"
- "If record_value is not specified; no changes will be made and the record will be returned in 'result' (in other words, this module can be used to fetch a record's current id, type, and ttl)"
required: false
@ -87,7 +87,7 @@ options:
version_added: 1.5.1
notes:
- The DNS Made Easy service requires that machines interacting with the API have the proper time and timezone set. Be sure you are within a few seconds of actual time by using NTP.
- The DNS Made Easy service requires that machines interacting with the API have the proper time and timezone set. Be sure you are within a few seconds of actual time by using NTP.
- This module returns record(s) in the "result" element when 'state' is set to 'present'. This value can be be registered and used in your playbooks.
requirements: [ hashlib, hmac ]

View file

@ -295,7 +295,7 @@ class HAProxy(object):
"""
Wait for a service to reach the specified status. Try RETRIES times
with INTERVAL seconds of sleep in between. If the service has not reached
the expected status in that time, the module will fail. If the service was
the expected status in that time, the module will fail. If the service was
not found, the module will fail.
"""
for i in range(1, self.wait_retries):

View file

@ -49,7 +49,7 @@ options:
format of the configuration file. Devices support three
configuration file formats. By default, the configuration
from the device is returned as text. The other option xml.
If the xml option is chosen, the configuration file is
If the xml option is chosen, the configuration file is
returned as both xml and json.
required: false
default: text

View file

@ -31,7 +31,7 @@ description:
options: {}
author: "Andy Hill (@andyhky)"
notes:
- Requires lldpd running and lldp enabled on switches
- Requires lldpd running and lldp enabled on switches
'''
EXAMPLES = '''
@ -83,7 +83,7 @@ def main():
data = {'lldp': lldp_output['lldp']}
module.exit_json(ansible_facts=data)
except TypeError:
module.fail_json(msg="lldpctl command failed. is lldpd running?")
module.fail_json(msg="lldpctl command failed. is lldpd running?")
# import module snippets
from ansible.module_utils.basic import *

View file

@ -112,7 +112,7 @@ EXAMPLES = '''
- name: "Tacacs Server Host Configuration"
nxos_aaa_server_host:
state: present
server_type: tacacs
server_type: tacacs
tacacs_port: 89
host_timeout: 10
address: 5.6.7.8
@ -126,7 +126,7 @@ proposed:
description: k/v pairs of parameters passed into module
returned: always
type: dict
sample: {"address": "1.2.3.4", "auth_port": "2084",
sample: {"address": "1.2.3.4", "auth_port": "2084",
"host_timeout": "10", "server_type": "radius"}
existing:
description:
@ -137,7 +137,7 @@ end_state:
description: k/v pairs of configuration after module execution
returned: always
type: dict
sample: {"address": "1.2.3.4", "auth_port": "2084",
sample: {"address": "1.2.3.4", "auth_port": "2084",
"host_timeout": "10", "server_type": "radius"}
updates:
description: command sent to the device

View file

@ -117,10 +117,10 @@ updates:
description: command sent to the device
returned: always
type: list
sample: ["ip igmp snooping link-local-groups-suppression",
"ip igmp snooping group-timeout 50",
"no ip igmp snooping report-suppression",
"no ip igmp snooping v3-report-suppression",
sample: ["ip igmp snooping link-local-groups-suppression",
"ip igmp snooping group-timeout 50",
"no ip igmp snooping report-suppression",
"no ip igmp snooping v3-report-suppression",
"no ip igmp snooping"]
changed:
description: check to see if a change was made on the device

View file

@ -69,7 +69,7 @@ EXAMPLES = '''
password: "{{ pwd }}"
transport: nxapi
rescue:
- name: Wait for device to perform checks
- name: Wait for device to perform checks
wait_for:
port: 22
state: stopped

View file

@ -153,31 +153,31 @@ proposed:
description: k/v pairs of parameters passed into module
returned: always
type: dict
sample: {"interface": "eth1/33", "neighbor_policy": "test",
sample: {"interface": "eth1/33", "neighbor_policy": "test",
"neighbor_type": "routemap", "sparse": true}
existing:
description:
- k/v pairs of existing configuration
type: dict
sample: {"border": false, "dr_prio": "1", "hello_interval": "30000",
"isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN",
"jp_policy_out": "1", "jp_type_in": "routemap",
"jp_type_out": null, "neighbor_policy": "test1",
sample: {"border": false, "dr_prio": "1", "hello_interval": "30000",
"isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN",
"jp_policy_out": "1", "jp_type_in": "routemap",
"jp_type_out": null, "neighbor_policy": "test1",
"neighbor_type": "prefix", "sparse": true}
end_state:
description: k/v pairs of configuration after module execution
returned: always
type: dict
sample: {"border": false, "dr_prio": "1", "hello_interval": "30000",
"isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN",
"jp_policy_out": "1", "jp_type_in": "routemap",
"jp_type_out": null, "neighbor_policy": "test",
sample: {"border": false, "dr_prio": "1", "hello_interval": "30000",
"isauth": false, "jp_bidir": false, "jp_policy_in": "JPIN",
"jp_policy_out": "1", "jp_type_in": "routemap",
"jp_type_out": null, "neighbor_policy": "test",
"neighbor_type": "routemap", "sparse": true}
updates:
description: command sent to the device
returned: always
type: list
sample: ["interface eth1/33", "ip pim neighbor-policy test",
sample: ["interface eth1/33", "ip pim neighbor-policy test",
"ip pim neighbor-policy test"]
changed:
description: check to see if a change was made on the device

View file

@ -101,7 +101,7 @@ proposed:
description: k/v pairs of parameters passed into module
returned: always
type: dict
sample: {"community": "TESTING", "snmp_host": "3.3.3.3",
sample: {"community": "TESTING", "snmp_host": "3.3.3.3",
"snmp_type": "trap", "version": "v2c", "vrf_filter": "one_more_vrf"}
existing:
description: k/v pairs of existing snmp host

View file

@ -87,19 +87,19 @@ proposed:
description: k/v pairs of parameters passed into module
returned: always
type: dict
sample: {"authentication": "md5", "group": "network-operator",
sample: {"authentication": "md5", "group": "network-operator",
"pwd": "test_password", "user": "ntc"}
existing:
description:
- k/v pairs of existing configuration
type: dict
sample: {"authentication": "no", "encrypt": "none",
sample: {"authentication": "no", "encrypt": "none",
"group": ["network-operator"], "user": "ntc"}
end_state:
description: k/v pairs configuration vtp after module execution
returned: always
type: dict
sample: {"authentication": "md5", "encrypt": "none",
sample: {"authentication": "md5", "encrypt": "none",
"group": ["network-operator"], "user": "ntc"}
updates:
description: command sent to the device

View file

@ -97,7 +97,7 @@ updates:
description: command sent to the device
returned: always
type: list
sample: ["interface ethernet1/33",
sample: ["interface ethernet1/33",
"no udld aggressive ; no udld disable"]
changed:
description: check to see if a change was made on the device

View file

@ -81,7 +81,7 @@ EXAMPLES = '''
port: eth2
state: present
# Creates port eth6
# Creates port eth6
- openvswitch_port:
bridge: bridge-loop
port: eth6