PEP 8 E111 & E114 cleanup. (#20838)

This commit is contained in:
Matt Clay 2017-01-30 15:01:47 -08:00 committed by GitHub
commit cb76200c7d
119 changed files with 339 additions and 378 deletions

View file

@ -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"}')

View file

@ -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']

View file

@ -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():

View file

@ -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)

View file

@ -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):

View file

@ -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:

View file

@ -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)