mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 06:10:22 -07:00
PEP 8 E111 & E114 cleanup. (#20838)
This commit is contained in:
parent
1609afbd12
commit
cb76200c7d
119 changed files with 339 additions and 378 deletions
|
@ -405,7 +405,7 @@ def main():
|
|||
body = json.dumps(body)
|
||||
lower_header_keys = [key.lower() for key in dict_headers]
|
||||
if 'content-type' not in lower_header_keys:
|
||||
dict_headers['Content-Type'] = 'application/json'
|
||||
dict_headers['Content-Type'] = 'application/json'
|
||||
|
||||
# Grab all the http headers. Need this hack since passing multi-values is
|
||||
# currently a bit ugly. (e.g. headers='{"Content-Type":"application/json"}')
|
||||
|
|
|
@ -514,10 +514,10 @@ class CloudflareAPI(object):
|
|||
def ensure_dns_record(self,**kwargs):
|
||||
params = {}
|
||||
for param in ['port','priority','proto','proxied','service','ttl','type','record','value','weight','zone']:
|
||||
if param in kwargs:
|
||||
params[param] = kwargs[param]
|
||||
else:
|
||||
params[param] = getattr(self,param)
|
||||
if param in kwargs:
|
||||
params[param] = kwargs[param]
|
||||
else:
|
||||
params[param] = getattr(self,param)
|
||||
|
||||
search_value = params['value']
|
||||
search_record = params['record']
|
||||
|
|
|
@ -112,10 +112,10 @@ CL_LICENSE_PATH='/usr/cumulus/bin/cl-license'
|
|||
|
||||
def install_license(module):
|
||||
# license is not installed, install it
|
||||
_url = module.params.get('src')
|
||||
(_rc, out, _err) = module.run_command("%s -i %s" % (CL_LICENSE_PATH, _url))
|
||||
if _rc > 0:
|
||||
module.fail_json(msg=_err)
|
||||
_url = module.params.get('src')
|
||||
(_rc, out, _err) = module.run_command("%s -i %s" % (CL_LICENSE_PATH, _url))
|
||||
if _rc > 0:
|
||||
module.fail_json(msg=_err)
|
||||
|
||||
|
||||
def main():
|
||||
|
|
|
@ -431,8 +431,8 @@ class Interfaces(FactsBase):
|
|||
match = re.search(r'Internet address is (\S+)', data)
|
||||
if match:
|
||||
if match.group(1) != "not":
|
||||
addr, masklen = match.group(1).split('/')
|
||||
return dict(address=addr, masklen=int(masklen))
|
||||
addr, masklen = match.group(1).split('/')
|
||||
return dict(address=addr, masklen=int(masklen))
|
||||
|
||||
def parse_mtu(self, data):
|
||||
match = re.search(r'MTU (\d+)', data)
|
||||
|
@ -463,7 +463,7 @@ class Interfaces(FactsBase):
|
|||
def parse_lineprotocol(self, data):
|
||||
match = re.search(r'line protocol is (\w+[ ]?\w*)\(?.*\)?$', data, re.M)
|
||||
if match:
|
||||
return match.group(1)
|
||||
return match.group(1)
|
||||
|
||||
def parse_operstatus(self, data):
|
||||
match = re.search(r'^(?:.+) is (.+),', data, re.M)
|
||||
|
|
|
@ -343,7 +343,7 @@ class ExoDnsRecord(ExoDns):
|
|||
self.result['diff']['before'] = record
|
||||
self.result['changed'] = True
|
||||
if not self.module.check_mode:
|
||||
self.api_query("/domains/%s/records/%s" % (self.domain, record['record']['id']), "DELETE")
|
||||
self.api_query("/domains/%s/records/%s" % (self.domain, record['record']['id']), "DELETE")
|
||||
return record
|
||||
|
||||
def get_result(self, resource):
|
||||
|
|
|
@ -342,7 +342,7 @@ def main():
|
|||
if monitors:
|
||||
monitors = []
|
||||
for monitor in module.params['monitors']:
|
||||
monitors.append(fq_name(partition, monitor))
|
||||
monitors.append(fq_name(partition, monitor))
|
||||
|
||||
# sanity check user supplied values
|
||||
if state == 'absent' and host is not None:
|
||||
|
|
|
@ -186,7 +186,7 @@ WAIT_INTERVAL=5
|
|||
|
||||
######################################################################
|
||||
class TimeoutException(Exception):
|
||||
pass
|
||||
pass
|
||||
|
||||
class HAProxy(object):
|
||||
"""
|
||||
|
@ -356,8 +356,8 @@ class HAProxy(object):
|
|||
|
||||
# Report change status
|
||||
if state_before != state_after:
|
||||
self.command_results['changed'] = True
|
||||
self.module.exit_json(**self.command_results)
|
||||
self.command_results['changed'] = True
|
||||
self.module.exit_json(**self.command_results)
|
||||
else:
|
||||
self.command_results['changed'] = False
|
||||
self.module.exit_json(**self.command_results)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue