summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2015-10-09 18:05:07 +0300
committerJakub Hrozek <jhrozek@redhat.com>2015-10-11 21:23:41 +0200
commitc4d2fc3c12656faeb3fb7ca20c922ca62edf13a0 (patch)
treecb87b14079495be6ac22e5dba3d87b44b8849b3b
parenta47102e74050d8ab14a9ea835ab2640c9aa65856 (diff)
downloadsssd-c4d2fc3c12656faeb3fb7ca20c922ca62edf13a0.tar.gz
sssd-c4d2fc3c12656faeb3fb7ca20c922ca62edf13a0.tar.xz
sssd-c4d2fc3c12656faeb3fb7ca20c922ca62edf13a0.zip
intg: Do not use non-existent pre-increment
Do not try to use the pre-increment operator which doesn't exist in Python (and is in fact two "identity" operators - opposites of "negation" operators). Use addition and assignment instead. This fixes infinite loops on failed slapd starting and stopping. Reviewed-by: Michal Židek <mzidek@redhat.com>
-rw-r--r--src/tests/intg/ds_openldap.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/tests/intg/ds_openldap.py b/src/tests/intg/ds_openldap.py
index 2ece0cf18..ba7fde649 100644
--- a/src/tests/intg/ds_openldap.py
+++ b/src/tests/intg/ds_openldap.py
@@ -217,7 +217,8 @@ class DSOpenLDAP(DS):
break
except ldap.SERVER_DOWN:
pass
- if ++attempt > 30:
+ attempt = attempt + 1
+ if attempt > 30:
raise Exception("Failed to start slapd")
time.sleep(1)
@@ -270,7 +271,8 @@ class DSOpenLDAP(DS):
pid_file.close()
attempt = 0
while os.path.isfile(self.pid_path):
- if ++attempt > 30:
+ attempt = attempt + 1
+ if attempt > 30:
raise Exception("Failed to stop slapd")
time.sleep(1)
except IOError as e: