From c4d2fc3c12656faeb3fb7ca20c922ca62edf13a0 Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Fri, 9 Oct 2015 18:05:07 +0300 Subject: intg: Do not use non-existent pre-increment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/tests/intg/ds_openldap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/tests') diff --git a/src/tests/intg/ds_openldap.py b/src/tests/intg/ds_openldap.py index 2ece0cf1..ba7fde64 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: -- cgit