mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-05-07 13:53:23 +00:00
pylint: Ignore usage of 'unicode' before assignment
New versions of pylint ignore Python 2 functions and types, evaluating 'unicode' as "undefined". ansible-freeipa will always define 'unicode' when running under Python 3, and it is always defined under Python 2. This patch fixes these false positives.
This commit is contained in:
@@ -487,7 +487,10 @@ def module_params_get(module, name, allow_empty_list_item=False):
|
||||
# Ansible issue https://github.com/ansible/ansible/issues/77108
|
||||
if isinstance(value, list):
|
||||
for val in value:
|
||||
if isinstance(val, (str, unicode)) and not val:
|
||||
if (
|
||||
isinstance(val, (str, unicode)) # pylint: disable=E0606
|
||||
and not val
|
||||
):
|
||||
if not allow_empty_list_item:
|
||||
module.fail_json(
|
||||
msg="Parameter '%s' contains an empty string" %
|
||||
|
||||
Reference in New Issue
Block a user