Bulk autopep8 (modules)

As agreed in 2017-12-07 Core meeting bulk fix pep8 issues

Generated using:
autopep8 1.3.3 (pycodestyle: 2.3.1)
autopep8 -r  --max-line-length 160 --in-place --ignore E305,E402,E722,E741 lib/ansible/modules

Manually fix issues that autopep8 has introduced
This commit is contained in:
John Barker 2017-12-07 16:27:06 +00:00 committed by John R Barker
commit c57a7f05e1
314 changed files with 3462 additions and 3383 deletions

View file

@ -108,6 +108,7 @@ def invoke(name, *args, **kwargs):
if func:
return func(*args, **kwargs)
def sanitize_config(lines):
commands = list()
for line in lines:
@ -118,6 +119,7 @@ def sanitize_config(lines):
commands.append(line)
return commands
def present(module, commands):
setters = set()
for key, value in module.argument_spec.items():
@ -127,6 +129,7 @@ def present(module, commands):
setters.add(setter)
invoke(setter, module, commands)
def absent(module, commands):
config = get_config(module)
if 'rollback-location' in config:
@ -138,30 +141,36 @@ def absent(module, commands):
if 'local-max-checkpoints' in config:
commands.append('configure system rollback no remote-max-checkpoints')
def set_rollback_location(module, commands):
value = module.params['rollback_location']
commands.append('configure system rollback rollback-location "%s"' % value)
def set_local_max_checkpoints(module, commands):
value = module.params['local_max_checkpoints']
if not 1 <= value <= 50:
module.fail_json(msg='local_max_checkpoints must be between 1 and 50')
commands.append('configure system rollback local-max-checkpoints %s' % value)
def set_remote_max_checkpoints(module, commands):
value = module.params['remote_max_checkpoints']
if not 1 <= value <= 50:
module.fail_json(msg='remote_max_checkpoints must be between 1 and 50')
commands.append('configure system rollback remote-max-checkpoints %s' % value)
def set_rescue_location(module, commands):
value = module.params['rescue_location']
commands.append('configure system rollback rescue-location "%s"' % value)
def get_device_config(module):
contents = get_config(module)
return NetworkConfig(indent=4, contents=contents)
def main():
""" main entry point for module execution
"""