mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 20:31:27 -07:00
Assorted pylint fixes
This commit is contained in:
parent
8e0f95951d
commit
f9ab9b4d68
65 changed files with 343 additions and 473 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# (c) 2017, Ansible by Red Hat, inc
|
||||
# Copyright: (c) 2017, Ansible by Red Hat, inc
|
||||
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
||||
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
@ -188,12 +188,12 @@ def map_obj_to_commands(updates, module):
|
|||
address = ipv4.split('/')
|
||||
if len(address) == 2:
|
||||
ipv4 = '{0} {1}'.format(address[0], to_netmask(address[1]))
|
||||
commands.append('no ip address {}'.format(ipv4))
|
||||
commands.append('no ip address {0}'.format(ipv4))
|
||||
else:
|
||||
commands.append('no ip address')
|
||||
if obj_in_have['ipv6']:
|
||||
if ipv6:
|
||||
commands.append('no ipv6 address {}'.format(ipv6))
|
||||
commands.append('no ipv6 address {0}'.format(ipv6))
|
||||
else:
|
||||
commands.append('no ipv6 address')
|
||||
if 'dhcp' in obj_in_have['ipv6']:
|
||||
|
@ -205,11 +205,11 @@ def map_obj_to_commands(updates, module):
|
|||
address = ipv4.split('/')
|
||||
if len(address) == 2:
|
||||
ipv4 = '{0} {1}'.format(address[0], to_netmask(address[1]))
|
||||
commands.append('ip address {}'.format(ipv4))
|
||||
commands.append('ip address {0}'.format(ipv4))
|
||||
|
||||
if ipv6:
|
||||
if obj_in_have is None or obj_in_have.get('ipv6') is None or ipv6.lower() not in [addr.lower() for addr in obj_in_have['ipv6']]:
|
||||
commands.append('ipv6 address {}'.format(ipv6))
|
||||
commands.append('ipv6 address {0}'.format(ipv6))
|
||||
|
||||
if commands[-1] == interface:
|
||||
commands.pop(-1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue