mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-08-02 12:54:52 +00:00
Fix pylint's warning invalid-name.
This commit is contained in:
@@ -57,7 +57,7 @@ else:
|
|||||||
# FreeIPA releases.
|
# FreeIPA releases.
|
||||||
import re
|
import re
|
||||||
|
|
||||||
class version:
|
class version: # pylint: disable=invalid-name
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def parse(version_str):
|
def parse(version_str):
|
||||||
"""
|
"""
|
||||||
@@ -460,7 +460,7 @@ else:
|
|||||||
cert = load_certificate(cert.encode('utf-8'))
|
cert = load_certificate(cert.encode('utf-8'))
|
||||||
return cert
|
return cert
|
||||||
|
|
||||||
def DN_x500_text(text):
|
def DN_x500_text(text): # pylint: disable=invalid-name
|
||||||
if hasattr(DN, "x500_text"):
|
if hasattr(DN, "x500_text"):
|
||||||
return DN(text).x500_text()
|
return DN(text).x500_text()
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -264,10 +264,7 @@ def config_show(module):
|
|||||||
|
|
||||||
|
|
||||||
def gen_args(params):
|
def gen_args(params):
|
||||||
_args = {}
|
_args = {k: v for k, v in params.items() if v is not None}
|
||||||
for k, v in params.items():
|
|
||||||
if v is not None:
|
|
||||||
_args[k] = v
|
|
||||||
|
|
||||||
return _args
|
return _args
|
||||||
|
|
||||||
@@ -434,7 +431,7 @@ def main():
|
|||||||
rawresult = api_command_no_name(ansible_module, "config_show", {})
|
rawresult = api_command_no_name(ansible_module, "config_show", {})
|
||||||
result = rawresult['result']
|
result = rawresult['result']
|
||||||
del result['dn']
|
del result['dn']
|
||||||
for key, v in result.items():
|
for key, value in result.items():
|
||||||
k = reverse_field_map.get(key, key)
|
k = reverse_field_map.get(key, key)
|
||||||
if ansible_module.argument_spec.get(k):
|
if ansible_module.argument_spec.get(k):
|
||||||
if k == 'ipaselinuxusermaporder':
|
if k == 'ipaselinuxusermaporder':
|
||||||
@@ -449,20 +446,20 @@ def main():
|
|||||||
elif k == 'groupsearch':
|
elif k == 'groupsearch':
|
||||||
exit_args['groupsearch'] = \
|
exit_args['groupsearch'] = \
|
||||||
result.get(key)[0].split(',')
|
result.get(key)[0].split(',')
|
||||||
elif isinstance(v, str) and \
|
elif isinstance(value, str) and \
|
||||||
ansible_module.argument_spec[k]['type'] == "list":
|
ansible_module.argument_spec[k]['type'] == "list":
|
||||||
exit_args[k] = [v]
|
exit_args[k] = [value]
|
||||||
elif isinstance(v, list) and \
|
elif isinstance(value, list) and \
|
||||||
ansible_module.argument_spec[k]['type'] == "str":
|
ansible_module.argument_spec[k]['type'] == "str":
|
||||||
exit_args[k] = ",".join(v)
|
exit_args[k] = ",".join(value)
|
||||||
elif isinstance(v, list) and \
|
elif isinstance(value, list) and \
|
||||||
ansible_module.argument_spec[k]['type'] == "int":
|
ansible_module.argument_spec[k]['type'] == "int":
|
||||||
exit_args[k] = ",".join(v)
|
exit_args[k] = ",".join(value)
|
||||||
elif isinstance(v, list) and \
|
elif isinstance(value, list) and \
|
||||||
ansible_module.argument_spec[k]['type'] == "bool":
|
ansible_module.argument_spec[k]['type'] == "bool":
|
||||||
exit_args[k] = (v[0] == "TRUE")
|
exit_args[k] = (value[0] == "TRUE")
|
||||||
else:
|
else:
|
||||||
exit_args[k] = v
|
exit_args[k] = value
|
||||||
except ipalib_errors.EmptyModlist:
|
except ipalib_errors.EmptyModlist:
|
||||||
changed = False
|
changed = False
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -1377,7 +1377,7 @@ def define_commands_for_present_state(module, zone_name, entry, res_find):
|
|||||||
_args['idnsname'] = name
|
_args['idnsname'] = name
|
||||||
_commands.append([zone_name, 'dnsrecord_add', _args])
|
_commands.append([zone_name, 'dnsrecord_add', _args])
|
||||||
# clean used fields from args
|
# clean used fields from args
|
||||||
for f in part_fields:
|
for f in part_fields: # pylint: disable=invalid-name
|
||||||
if f in args:
|
if f in args:
|
||||||
del args[f]
|
del args[f]
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -712,7 +712,7 @@ def check_certmapdata(data):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
i = data.find("<I>", 4)
|
i = data.find("<I>", 4)
|
||||||
s = data.find("<S>", i)
|
s = data.find("<S>", i) # pylint: disable=invalid-name
|
||||||
issuer = data[i+3:s]
|
issuer = data[i+3:s]
|
||||||
subject = data[s+3:]
|
subject = data[s+3:]
|
||||||
|
|
||||||
|
|||||||
15
setup.cfg
15
setup.cfg
@@ -31,3 +31,18 @@ per-file-ignores =
|
|||||||
[pydocstyle]
|
[pydocstyle]
|
||||||
inherit = false
|
inherit = false
|
||||||
ignore = D1,D212,D203
|
ignore = D1,D212,D203
|
||||||
|
[pylint.BASIC]
|
||||||
|
good-names = ex, i, j, k, Run, _, e, x, dn, cn, ip, os, unicode
|
||||||
|
|
||||||
|
[pylint.IMPORTS]
|
||||||
|
ignored-modules =
|
||||||
|
ansible.module_utils.ansible_freeipa_module,
|
||||||
|
ipalib, ipalib.config, ipalib.constants, ipalib.krb_utils, ipalib.errors,
|
||||||
|
ipapython.ipautil, ipapython.dn, ipapython.version, ipapython.dnsutil,
|
||||||
|
ipaplatform.paths
|
||||||
|
|
||||||
|
[pylint.REFACTORING]
|
||||||
|
max-nested-blocks = 9
|
||||||
|
|
||||||
|
[pylint.FORMAT]
|
||||||
|
max-line-length = 80
|
||||||
|
|||||||
Reference in New Issue
Block a user