From 129adb40626a1b91269d71cc8f21d193f1e65c8c Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Sep 04 2019 08:35:01 +0000 Subject: config plugin: replace 'is 0' with '== 0' Since python3.8, identity checks with literal produce syntax warnings. Replace the check 'if .. is 0' with 'if .. == 0' Related: https://pagure.io/freeipa/issue/8057 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Christian Heimes --- diff --git a/ipaserver/plugins/config.py b/ipaserver/plugins/config.py index c755a88..77a9f2c 100644 --- a/ipaserver/plugins/config.py +++ b/ipaserver/plugins/config.py @@ -503,12 +503,12 @@ class config_mod(LDAPUpdate): # Set ipasearchrecordslimit to -1 if 0 is used if 'ipasearchrecordslimit' in entry_attrs: - if entry_attrs['ipasearchrecordslimit'] is 0: + if entry_attrs['ipasearchrecordslimit'] == 0: entry_attrs['ipasearchrecordslimit'] = -1 # Set ipasearchtimelimit to -1 if 0 is used if 'ipasearchtimelimit' in entry_attrs: - if entry_attrs['ipasearchtimelimit'] is 0: + if entry_attrs['ipasearchtimelimit'] == 0: entry_attrs['ipasearchtimelimit'] = -1 for (attr, obj) in (('ipauserobjectclasses', 'user'),