Fix pycodestyle E117 issues.

This commit is contained in:
Matt Clay 2019-02-13 18:39:26 -08:00
commit 3e778d3f8f
40 changed files with 150 additions and 150 deletions

View file

@ -319,14 +319,14 @@ def main():
if module.params['save']:
result['changed'] = True
if not module.check_mode:
cmd = {'command': 'copy running-config startup-config',
'prompt': r'\(y/n\)\s?$', 'answer': 'y'}
run_commands(module, [cmd])
result['saved'] = True
cmd = {'command': 'copy running-config startup-config',
'prompt': r'\(y/n\)\s?$', 'answer': 'y'}
run_commands(module, [cmd])
result['saved'] = True
else:
module.warn('Skipping command `copy running-config startup-config`'
'due to check_mode. Configuration not copied to '
'non-volatile storage')
module.warn('Skipping command `copy running-config startup-config`'
'due to check_mode. Configuration not copied to '
'non-volatile storage')
module.exit_json(**result)

View file

@ -144,7 +144,7 @@ def parse_key_id(line, dest):
def parse_auth(dest):
if dest == 'authenticate':
return dest
return dest
def map_config_to_obj(module):

View file

@ -332,40 +332,40 @@ def map_obj_to_commands(updates, module):
add_command_to_vrf(want['name'], cmd, commands)
if needs_update(want, have, 'route_import_ipv4'):
cmd = 'address-family ipv4'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_import_ipv4']:
cmd = 'route-target import %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
cmd = 'address-family ipv4'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_import_ipv4']:
cmd = 'route-target import %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
add_command_to_vrf(want['name'], cmd, commands)
if needs_update(want, have, 'route_export_ipv4'):
cmd = 'address-family ipv4'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_export_ipv4']:
cmd = 'route-target export %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
cmd = 'address-family ipv4'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_export_ipv4']:
cmd = 'route-target export %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
add_command_to_vrf(want['name'], cmd, commands)
if needs_update(want, have, 'route_import_ipv6'):
cmd = 'address-family ipv6'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_import_ipv6']:
cmd = 'route-target import %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
cmd = 'address-family ipv6'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_import_ipv6']:
cmd = 'route-target import %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
add_command_to_vrf(want['name'], cmd, commands)
if needs_update(want, have, 'route_export_ipv6'):
cmd = 'address-family ipv6'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_export_ipv6']:
cmd = 'route-target export %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
cmd = 'address-family ipv6'
add_command_to_vrf(want['name'], cmd, commands)
for route in want['route_export_ipv6']:
cmd = 'route-target export %s' % route
add_command_to_vrf(want['name'], cmd, commands)
cmd = 'exit-address-family'
add_command_to_vrf(want['name'], cmd, commands)
if want['interfaces'] is not None:
# handle the deletes

View file

@ -209,7 +209,7 @@ def get_admin_id(meraki, data, name=None, email=None):
admin_id = a['id']
elif meraki.params['email']:
if meraki.params['email'] == a['email']:
return a['id']
return a['id']
if admin_id is None:
meraki.fail_json(msg='No admin_id found')
return admin_id

View file

@ -144,11 +144,11 @@ def assemble_payload(meraki):
def get_rules(meraki, net_id, number):
path = meraki.construct_path('get_all', net_id=net_id)
path = path + number + '/l3FirewallRules'
response = meraki.request(path, method='GET')
if meraki.status == 200:
return response
path = meraki.construct_path('get_all', net_id=net_id)
path = path + number + '/l3FirewallRules'
response = meraki.request(path, method='GET')
if meraki.status == 200:
return response
def get_ssid_number(name, data):

View file

@ -211,10 +211,10 @@ def assemble_payload(meraki):
def get_rules(meraki, net_id):
path = meraki.construct_path('get_all', net_id=net_id)
response = meraki.request(path, method='GET')
if meraki.status == 200:
return response
path = meraki.construct_path('get_all', net_id=net_id)
response = meraki.request(path, method='GET')
if meraki.status == 200:
return response
def main():

View file

@ -181,7 +181,7 @@ def set_snmp(meraki, org_id):
meraki.params['v3_auth_pass'] is None or
meraki.params['v3_priv_mode'] is None or
meraki.params['v3_priv_pass'] is None):
meraki.fail_json(msg='v3_auth_mode, v3_auth_pass, v3_priv_mode, and v3_auth_pass are required')
meraki.fail_json(msg='v3_auth_mode, v3_auth_pass, v3_priv_mode, and v3_auth_pass are required')
payload = {'v3Enabled': meraki.params['v3_enabled'],
'v3AuthMode': meraki.params['v3_auth_mode'].upper(),
'v3AuthPass': meraki.params['v3_auth_pass'],

View file

@ -168,7 +168,7 @@ def main():
cli += ' %s community-string %s ' % (command, comm_str)
if command != 'snmp-community-delete' and community_type:
cli += ' community-type ' + community_type
cli += ' community-type ' + community_type
run_cli(module, cli, state_map)

View file

@ -272,13 +272,13 @@ def main():
commands, parents = state_absent(module, existing, proposed)
if commands:
candidate = CustomNetworkConfig(indent=3)
candidate.add(commands, parents=parents)
candidate = candidate.items_text()
if not module.check_mode:
load_config(module, candidate)
results['changed'] = True
results['commands'] = candidate
candidate = CustomNetworkConfig(indent=3)
candidate.add(commands, parents=parents)
candidate = candidate.items_text()
if not module.check_mode:
load_config(module, candidate)
results['changed'] = True
results['commands'] = candidate
else:
results['commands'] = []
module.exit_json(**results)

View file

@ -383,15 +383,15 @@ def config_igmp_interface(delta, existing, existing_oif_prefix_source):
commands.append(CMDS.get('oif_prefix').format(pf))
if existing_oif_prefix_source:
for each in existing_oif_prefix_source:
# remove stale prefix/sources
pf = each['prefix']
src = ''
if 'source' in each.keys():
src = each['source']
if src:
commands.append('no ' + CMDS.get('oif_prefix_source').format(pf, src))
else:
commands.append('no ' + CMDS.get('oif_prefix').format(pf))
# remove stale prefix/sources
pf = each['prefix']
src = ''
if 'source' in each.keys():
src = each['source']
if src:
commands.append('no ' + CMDS.get('oif_prefix_source').format(pf, src))
else:
commands.append('no ' + CMDS.get('oif_prefix').format(pf))
elif key == 'oif_routemap':
if value == 'default':
if existing.get(key):

View file

@ -196,7 +196,7 @@ def run(module, result):
result['updates'] = total_commands
if module.params['save']:
total_commands.append('configuration write')
total_commands.append('configuration write')
if total_commands:
result['changed'] = True
if not module.check_mode:

View file

@ -170,7 +170,7 @@ def map_config_to_obj(module):
obj['key'] = module.params['key']
obj['value'] = col_value_to_dict[module.params['key']]
else:
obj['value'] = str(col_value.strip())
obj['value'] = str(col_value.strip())
return obj