pylint: Skip unsupported-assignment-operation

Pylint thinks that the values are None because doesn't support
flow analysis.

Fixes: https://pagure.io/freeipa/issue/9117
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Levin 2021-07-30 14:56:15 +03:00 committed by Rob Crittenden
parent feab723c59
commit f416abe559
2 changed files with 7 additions and 0 deletions

View File

@ -131,6 +131,8 @@ def main():
else: else:
print("Enabling plugin") print("Enabling plugin")
# https://github.com/PyCQA/pylint/issues/872
# pylint: disable=unsupported-assignment-operation
if entry is None: if entry is None:
ld = LDAPUpdate() ld = LDAPUpdate()
if not ld.update(files): if not ld.update(files):
@ -139,6 +141,7 @@ def main():
else: else:
entry['nsslapd-pluginenabled'] = ['on'] entry['nsslapd-pluginenabled'] = ['on']
api.Backend.ldap2.update_entry(entry) api.Backend.ldap2.update_entry(entry)
# pylint: enable=unsupported-assignment-operation
except errors.ExecutionError as lde: except errors.ExecutionError as lde:
print("An error occurred while talking to the server.") print("An error occurred while talking to the server.")
print(lde) print(lde)
@ -168,7 +171,9 @@ def main():
else: else:
print("Disabling plugin") print("Disabling plugin")
# pylint: disable=unsupported-assignment-operation
entry['nsslapd-pluginenabled'] = ['off'] entry['nsslapd-pluginenabled'] = ['off']
# pylint: enable=unsupported-assignment-operation
api.Backend.ldap2.update_entry(entry) api.Backend.ldap2.update_entry(entry)
except errors.DatabaseError as dbe: except errors.DatabaseError as dbe:
print("An error occurred while talking to the server.") print("An error occurred while talking to the server.")

View File

@ -155,7 +155,9 @@ def main():
elif entry.get('nsslapd-pluginenabled', [''])[0].lower() == 'off': elif entry.get('nsslapd-pluginenabled', [''])[0].lower() == 'off':
print("Enabling plugin") print("Enabling plugin")
# Already configured, just enable the plugin # Already configured, just enable the plugin
# pylint: disable=unsupported-assignment-operation
entry['nsslapd-pluginenabled'] = ['on'] entry['nsslapd-pluginenabled'] = ['on']
# pylint: enable=unsupported-assignment-operation
api.Backend.ldap2.update_entry(entry) api.Backend.ldap2.update_entry(entry)
else: else:
print("Plugin already Enabled") print("Plugin already Enabled")