From f416abe559532e289bfdd64bdeb3aef2549e113a Mon Sep 17 00:00:00 2001 From: Stanislav Levin Date: Fri, 30 Jul 2021 14:56:15 +0300 Subject: [PATCH] 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 Reviewed-By: Rob Crittenden --- install/tools/ipa-compat-manage.in | 5 +++++ install/tools/ipa-nis-manage.in | 2 ++ 2 files changed, 7 insertions(+) diff --git a/install/tools/ipa-compat-manage.in b/install/tools/ipa-compat-manage.in index 2805845c1..1f76eb5f8 100644 --- a/install/tools/ipa-compat-manage.in +++ b/install/tools/ipa-compat-manage.in @@ -131,6 +131,8 @@ def main(): else: print("Enabling plugin") + # https://github.com/PyCQA/pylint/issues/872 + # pylint: disable=unsupported-assignment-operation if entry is None: ld = LDAPUpdate() if not ld.update(files): @@ -139,6 +141,7 @@ def main(): else: entry['nsslapd-pluginenabled'] = ['on'] api.Backend.ldap2.update_entry(entry) + # pylint: enable=unsupported-assignment-operation except errors.ExecutionError as lde: print("An error occurred while talking to the server.") print(lde) @@ -168,7 +171,9 @@ def main(): else: print("Disabling plugin") + # pylint: disable=unsupported-assignment-operation entry['nsslapd-pluginenabled'] = ['off'] + # pylint: enable=unsupported-assignment-operation api.Backend.ldap2.update_entry(entry) except errors.DatabaseError as dbe: print("An error occurred while talking to the server.") diff --git a/install/tools/ipa-nis-manage.in b/install/tools/ipa-nis-manage.in index 6b156ce6a..767217266 100644 --- a/install/tools/ipa-nis-manage.in +++ b/install/tools/ipa-nis-manage.in @@ -155,7 +155,9 @@ def main(): elif entry.get('nsslapd-pluginenabled', [''])[0].lower() == 'off': print("Enabling plugin") # Already configured, just enable the plugin + # pylint: disable=unsupported-assignment-operation entry['nsslapd-pluginenabled'] = ['on'] + # pylint: enable=unsupported-assignment-operation api.Backend.ldap2.update_entry(entry) else: print("Plugin already Enabled")