mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-03-26 21:33:05 +00:00
Fix pylint's warning invalid-name.
This commit is contained in:
@@ -57,7 +57,7 @@ else:
|
||||
# FreeIPA releases.
|
||||
import re
|
||||
|
||||
class version:
|
||||
class version: # pylint: disable=invalid-name
|
||||
@staticmethod
|
||||
def parse(version_str):
|
||||
"""
|
||||
@@ -460,7 +460,7 @@ else:
|
||||
cert = load_certificate(cert.encode('utf-8'))
|
||||
return cert
|
||||
|
||||
def DN_x500_text(text):
|
||||
def DN_x500_text(text): # pylint: disable=invalid-name
|
||||
if hasattr(DN, "x500_text"):
|
||||
return DN(text).x500_text()
|
||||
else:
|
||||
|
||||
@@ -264,10 +264,7 @@ def config_show(module):
|
||||
|
||||
|
||||
def gen_args(params):
|
||||
_args = {}
|
||||
for k, v in params.items():
|
||||
if v is not None:
|
||||
_args[k] = v
|
||||
_args = {k: v for k, v in params.items() if v is not None}
|
||||
|
||||
return _args
|
||||
|
||||
@@ -434,7 +431,7 @@ def main():
|
||||
rawresult = api_command_no_name(ansible_module, "config_show", {})
|
||||
result = rawresult['result']
|
||||
del result['dn']
|
||||
for key, v in result.items():
|
||||
for key, value in result.items():
|
||||
k = reverse_field_map.get(key, key)
|
||||
if ansible_module.argument_spec.get(k):
|
||||
if k == 'ipaselinuxusermaporder':
|
||||
@@ -449,20 +446,20 @@ def main():
|
||||
elif k == 'groupsearch':
|
||||
exit_args['groupsearch'] = \
|
||||
result.get(key)[0].split(',')
|
||||
elif isinstance(v, str) and \
|
||||
elif isinstance(value, str) and \
|
||||
ansible_module.argument_spec[k]['type'] == "list":
|
||||
exit_args[k] = [v]
|
||||
elif isinstance(v, list) and \
|
||||
exit_args[k] = [value]
|
||||
elif isinstance(value, list) and \
|
||||
ansible_module.argument_spec[k]['type'] == "str":
|
||||
exit_args[k] = ",".join(v)
|
||||
elif isinstance(v, list) and \
|
||||
exit_args[k] = ",".join(value)
|
||||
elif isinstance(value, list) and \
|
||||
ansible_module.argument_spec[k]['type'] == "int":
|
||||
exit_args[k] = ",".join(v)
|
||||
elif isinstance(v, list) and \
|
||||
exit_args[k] = ",".join(value)
|
||||
elif isinstance(value, list) and \
|
||||
ansible_module.argument_spec[k]['type'] == "bool":
|
||||
exit_args[k] = (v[0] == "TRUE")
|
||||
exit_args[k] = (value[0] == "TRUE")
|
||||
else:
|
||||
exit_args[k] = v
|
||||
exit_args[k] = value
|
||||
except ipalib_errors.EmptyModlist:
|
||||
changed = False
|
||||
except Exception as e:
|
||||
|
||||
@@ -1377,7 +1377,7 @@ def define_commands_for_present_state(module, zone_name, entry, res_find):
|
||||
_args['idnsname'] = name
|
||||
_commands.append([zone_name, 'dnsrecord_add', _args])
|
||||
# clean used fields from args
|
||||
for f in part_fields:
|
||||
for f in part_fields: # pylint: disable=invalid-name
|
||||
if f in args:
|
||||
del args[f]
|
||||
else:
|
||||
|
||||
@@ -712,7 +712,7 @@ def check_certmapdata(data):
|
||||
return False
|
||||
|
||||
i = data.find("<I>", 4)
|
||||
s = data.find("<S>", i)
|
||||
s = data.find("<S>", i) # pylint: disable=invalid-name
|
||||
issuer = data[i+3:s]
|
||||
subject = data[s+3:]
|
||||
|
||||
|
||||
15
setup.cfg
15
setup.cfg
@@ -31,3 +31,18 @@ per-file-ignores =
|
||||
[pydocstyle]
|
||||
inherit = false
|
||||
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