Fix infrequent PEP 8 issues.

This commit is contained in:
Matt Clay 2017-01-27 13:04:59 -08:00
commit 63b1e0c277
31 changed files with 41 additions and 50 deletions

View file

@ -103,8 +103,10 @@ class CLI(with_metaclass(ABCMeta, object)):
_CONST = re.compile(r"C\(([^)]+)\)")
PAGER = 'less'
LESS_OPTS = 'FRSX' # -F (quit-if-one-screen) -R (allow raw ansi control chars)
# -S (chop long lines) -X (disable termcap init and de-init)
# -F (quit-if-one-screen) -R (allow raw ansi control chars)
# -S (chop long lines) -X (disable termcap init and de-init)
LESS_OPTS = 'FRSX'
def __init__(self, args, callback=None):
"""

View file

@ -64,4 +64,4 @@ class GalaxyToken(object):
def save(self):
with open(self.file,'w') as f:
yaml.safe_dump(self.config,f,default_flow_style=False)

View file

@ -619,4 +619,4 @@ def map_complex_type(complex_type, type_map):
type_map))
elif type_map:
return vars(globals()['__builtins__'])[type_map](complex_type)
return new_type
return new_type

View file

@ -208,7 +208,7 @@ def main():
results['view'] = cf_man.view(ct_name)
# only update if the values have changed.
if results['view']['S3BucketName'] != s3_bucket_name or \
results['view'].get('S3KeyPrefix', '') != s3_key_prefix or \
results['view'].get('S3KeyPrefix', '') != s3_key_prefix or \
results['view']['IncludeGlobalServiceEvents'] != include_global_events:
if not module.check_mode:
results['update'] = cf_man.update(name=ct_name, s3_bucket_name=s3_bucket_name, s3_key_prefix=s3_key_prefix, include_global_service_events=include_global_events)

View file

@ -148,7 +148,7 @@ def main():
module = AnsibleModule(argument_spec=argument_spec)
# Validate Requirements
# Validate Requirements
if not HAS_BOTO3:
module.fail_json(msg='json and botocore/boto3 is required.')

View file

@ -148,7 +148,7 @@ def main():
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
# Validate Requirements
# Validate Requirements
if not HAS_BOTO3:
module.fail_json(msg='json and boto3 is required.')
@ -160,7 +160,7 @@ def main():
# call your function here
results = list_virtual_gateways(connection, module)
module.exit_json(result=results)

View file

@ -270,7 +270,7 @@ def main():
if not module.params['provider_physical_network']:
module.fail_json(msg = " for vlan and flat networks, variable provider_physical_network should be set.")
if module.params['provider_network_type'] in ['vlan', 'gre']:
if module.params['provider_network_type'] in ['vlan', 'gre']:
if not module.params['provider_segmentation_id']:
module.fail_json(msg = " for vlan & gre networks, variable provider_segmentation_id should be set.")

View file

@ -159,4 +159,4 @@ from ansible.module_utils.vmware import *
from ansible.module_utils.basic import *
if __name__ == '__main__':
main()
main()

View file

@ -559,10 +559,10 @@ class ZipArchive(object):
if self.opts:
cmd.extend(self.opts)
cmd.append(self.src)
# NOTE: Including (changed) files as arguments is problematic (limits on command line/arguments)
# if self.includes:
# NOTE: Command unzip has this strange behaviour where it expects quoted filenames to also be escaped
# cmd.extend(map(shell_escape, self.includes))
# NOTE: Including (changed) files as arguments is problematic (limits on command line/arguments)
# if self.includes:
# NOTE: Command unzip has this strange behaviour where it expects quoted filenames to also be escaped
# cmd.extend(map(shell_escape, self.includes))
if self.excludes:
cmd.extend([ '-x' ] + self.excludes)
cmd.extend([ '-d', self.dest ])

View file

@ -220,4 +220,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -226,7 +226,7 @@ import time
from ansible.module_utils.local import LocalAnsibleModule
from ansible.module_utils.ios import load_config, get_config, run_commands
from ansible.module_utils.netcfg import NetworkConfig, dumps
from ansible.module_utils.six import iteritems
from ansible.module_utils.six import iteritems
from ansible.module_utils.network import NET_TRANSPORT_ARGS, _transitional_argument_spec

View file

@ -508,4 +508,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -907,4 +907,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -554,7 +554,7 @@ def get_interfaces_dict(module):
}
interface_list = body.get('TABLE_interface')['ROW_interface']
for index in interface_list:
for index in interface_list:
intf = index ['interface']
intf_type = get_interface_type(intf)
@ -967,4 +967,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -743,4 +743,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -505,4 +505,4 @@ def main():
if __name__ == '__main__':
main()
main()

View file

@ -175,8 +175,9 @@ def install_packages(module, pkgng_path, packages, cached, pkgsite, dir_arg):
else:
pkgsite = "-r %s" % (pkgsite)
batch_var = 'env BATCH=yes' # This environment variable skips mid-install prompts,
# setting them to their default values.
# This environment variable skips mid-install prompts,
# setting them to their default values.
batch_var = 'env BATCH=yes'
if not module.check_mode and not cached:
if old_pkgng:

View file

@ -414,7 +414,7 @@ def main():
if '+' in size:
size_requested += this_lv['size']
if this_lv['size'] < size_requested:
if (size_free > 0) and (('+' not in size) or (size_free >= (size_requested - this_lv['size']))):
if (size_free > 0) and (('+' not in size) or (size_free >= (size_requested - this_lv['size']))):
tool = module.get_bin_path("lvextend", required=True)
else:
module.fail_json(msg="Logical Volume %s could not be extended. Not enough free space left (%s%s required / %s%s available)" % (this_lv['name'], (size_requested - this_lv['size']), unit, size_free, unit))

View file

@ -151,7 +151,7 @@ def iscsi_get_cached_nodes(module, portal=None):
# older versions of scsiadm don't have nice return codes
# for newer versions see iscsiadm(8); also usr/iscsiadm.c for details
# err can contain [N|n]o records...
# err can contain [N|n]o records...
elif rc == 21 or (rc == 255 and "o records found" in err):
nodes = []
else:

View file

@ -279,7 +279,8 @@ class ACMEDirectory(object):
self.directory = simple_get(self.module,self.directory_root)
def __getitem__(self, key): return self.directory[key]
def __getitem__(self, key):
return self.directory[key]
def get_nonce(self,resource=None):
url = self.directory_root

View file

@ -118,4 +118,4 @@ EXAMPLES = r'''
RETURN = r'''
'''
'''

View file

@ -103,4 +103,4 @@ EXAMPLES = r'''
'''
RETURN = '''
'''
'''

View file

@ -293,7 +293,7 @@ def load_list_of_tasks(ds, play, block=None, role=None, task_include=None, use_h
needs_templating = True
break
is_static = C.DEFAULT_TASK_INCLUDES_STATIC or \
(use_handlers and C.DEFAULT_HANDLER_INCLUDES_STATIC) or \
(use_handlers and C.DEFAULT_HANDLER_INCLUDES_STATIC) or \
(not needs_templating and ir.all_parents_static() and not ir.loop)
display.debug('Determined that if include_role static is %s' % str(is_static))
if is_static:

View file

@ -23,7 +23,7 @@ import datetime
__metaclass__ = type
try:
from pymongo import ASCENDING, DESCENDING
from pymongo import ASCENDING, DESCENDING
from pymongo.errors import ConnectionFailure
from pymongo import MongoClient
except ImportError:
@ -40,6 +40,7 @@ else:
from ansible.errors import AnsibleError
from ansible.plugins.lookup import LookupBase
class LookupModule(LookupBase):
def _fix_sort_parameter(self, sort_parameter):