mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 11:54:47 +00:00
fixup! pylint: Ignore usage of 'unicode' before assignment
This commit is contained in:
@@ -488,7 +488,7 @@ def module_params_get(module, name, allow_empty_list_item=False):
|
|||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
for val in value:
|
for val in value:
|
||||||
if (
|
if (
|
||||||
isinstance(val, (str, unicode)) # pylint: disable=E0606
|
isinstance(val, (str, unicode)) # pylint: disable=W0012,E0606
|
||||||
and not val
|
and not val
|
||||||
):
|
):
|
||||||
if not allow_empty_list_item:
|
if not allow_empty_list_item:
|
||||||
|
|||||||
@@ -664,7 +664,9 @@ def main():
|
|||||||
check_parameters(ansible_module, state, action)
|
check_parameters(ansible_module, state, action)
|
||||||
|
|
||||||
elif (
|
elif (
|
||||||
isinstance(group_name, (str, unicode)) # pylint: disable=E0606
|
isinstance(
|
||||||
|
group_name, (str, unicode) # pylint: disable=W0012,E0606
|
||||||
|
)
|
||||||
):
|
):
|
||||||
name = group_name
|
name = group_name
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -988,7 +988,9 @@ def main():
|
|||||||
sshpubkey = [str(normalize_sshpubkey(key)) for
|
sshpubkey = [str(normalize_sshpubkey(key)) for
|
||||||
key in sshpubkey]
|
key in sshpubkey]
|
||||||
|
|
||||||
elif isinstance(host, (str, unicode)): # pylint: disable=E0606
|
elif (
|
||||||
|
isinstance(host, (str, unicode)) # pylint: disable=W0012,E0606
|
||||||
|
):
|
||||||
name = host
|
name = host
|
||||||
else:
|
else:
|
||||||
ansible_module.fail_json(msg="Host '%s' is not valid" %
|
ansible_module.fail_json(msg="Host '%s' is not valid" %
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ def result_get_value_lowercase(res_find, key, default=None):
|
|||||||
if existing is not None:
|
if existing is not None:
|
||||||
if isinstance(existing, (list, tuple)):
|
if isinstance(existing, (list, tuple)):
|
||||||
existing = [to_text(item).lower() for item in existing]
|
existing = [to_text(item).lower() for item in existing]
|
||||||
if isinstance(existing, (str, unicode)): # pylint: disable=E0606
|
if isinstance(existing, (str, unicode)): # pylint: disable=W0012,E0606
|
||||||
existing = existing.lower()
|
existing = existing.lower()
|
||||||
else:
|
else:
|
||||||
existing = default
|
existing = default
|
||||||
|
|||||||
@@ -693,7 +693,11 @@ def main():
|
|||||||
|
|
||||||
delete_continue = service.get("delete_continue")
|
delete_continue = service.get("delete_continue")
|
||||||
|
|
||||||
elif isinstance(service, (str, unicode)): # pylint: disable=E0606
|
elif (
|
||||||
|
isinstance(
|
||||||
|
service, (str, unicode) # pylint: disable=W0012,E0606
|
||||||
|
)
|
||||||
|
):
|
||||||
name = service
|
name = service
|
||||||
else:
|
else:
|
||||||
ansible_module.fail_json(msg="Service '%s' is not valid" %
|
ansible_module.fail_json(msg="Service '%s' is not valid" %
|
||||||
|
|||||||
@@ -1382,7 +1382,11 @@ def main():
|
|||||||
|
|
||||||
email = extend_emails(email, default_email_domain)
|
email = extend_emails(email, default_email_domain)
|
||||||
|
|
||||||
elif isinstance(user, (str, unicode)): # pylint: disable=E0606
|
elif (
|
||||||
|
isinstance(
|
||||||
|
user, (str, unicode) # pylint: disable=W0012,E0606
|
||||||
|
)
|
||||||
|
):
|
||||||
name = user
|
name = user
|
||||||
else:
|
else:
|
||||||
ansible_module.fail_json(msg="User '%s' is not valid" %
|
ansible_module.fail_json(msg="User '%s' is not valid" %
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ def main():
|
|||||||
conn.connect(ccache=installer._ccache)
|
conn.connect(ccache=installer._ccache)
|
||||||
remote_api.Command['hostgroup_add_member'](
|
remote_api.Command['hostgroup_add_member'](
|
||||||
u'ipaservers',
|
u'ipaservers',
|
||||||
host=[unicode(api.env.host)], # pylint: disable=E0606
|
host=[unicode(api.env.host)], # pylint: disable=W0012,E0606
|
||||||
)
|
)
|
||||||
finally:
|
finally:
|
||||||
if conn.isconnected():
|
if conn.isconnected():
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ def main():
|
|||||||
# Check authorization
|
# Check authorization
|
||||||
result = remote_api.Command['hostgroup_find'](
|
result = remote_api.Command['hostgroup_find'](
|
||||||
cn=u'ipaservers',
|
cn=u'ipaservers',
|
||||||
host=[unicode(api.env.host)] # pylint: disable=E0606
|
host=[unicode(api.env.host)] # pylint: disable=W0012,E0606
|
||||||
)['result']
|
)['result']
|
||||||
add_to_ipaservers = not result
|
add_to_ipaservers = not result
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user