7e1b55
From 5b826ab3582566b15a618f57cb2e002a9c16ef64 Mon Sep 17 00:00:00 2001
7e1b55
From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= <fcami@redhat.com>
7e1b55
Date: Tue, 20 Jul 2021 20:29:00 +0200
7e1b55
Subject: [PATCH] tasks.py: fix flake8-reported issues
7e1b55
MIME-Version: 1.0
7e1b55
Content-Type: text/plain; charset=UTF-8
7e1b55
Content-Transfer-Encoding: 8bit
7e1b55
7e1b55
Fixes: https://pagure.io/freeipa/issue/8931
7e1b55
Signed-off-by: François Cami <fcami@redhat.com>
7e1b55
Reviewed-By: Michal Polovka <mpolovka@redhat.com>
7e1b55
---
7e1b55
 ipatests/pytest_ipa/integration/tasks.py | 14 ++++++++------
7e1b55
 1 file changed, 8 insertions(+), 6 deletions(-)
7e1b55
7e1b55
diff --git a/ipatests/pytest_ipa/integration/tasks.py b/ipatests/pytest_ipa/integration/tasks.py
7e1b55
index c2e548617..075c05cde 100755
7e1b55
--- a/ipatests/pytest_ipa/integration/tasks.py
7e1b55
+++ b/ipatests/pytest_ipa/integration/tasks.py
7e1b55
@@ -597,7 +597,9 @@ def install_adtrust(host):
7e1b55
     dig_command = ['dig', 'SRV', '+short', '@localhost',
7e1b55
                    '_ldap._tcp.%s' % host.domain.name]
7e1b55
     dig_output = '0 100 389 %s.' % host.hostname
7e1b55
-    dig_test = lambda x: re.search(re.escape(dig_output), x)
7e1b55
+
7e1b55
+    def dig_test(x):
7e1b55
+        return re.search(re.escape(dig_output), x)
7e1b55
 
7e1b55
     run_repeatedly(host, dig_command, test=dig_test)
7e1b55
 
7e1b55
@@ -2122,8 +2124,8 @@ def create_active_user(host, login, password, first='test', last='user',
7e1b55
         result = host.run_command(
7e1b55
             "KRB5_TRACE=/dev/stdout kinit %s" % login,
7e1b55
             stdin_text='{0}\n{1}\n{1}\n'.format(
7e1b55
-                temp_password, password, raiseonerr=False
7e1b55
-            )
7e1b55
+                temp_password, password
7e1b55
+            ), raiseonerr=False
7e1b55
         )
7e1b55
         # Retrieve kdc.$REALM after the password change, just in case SSSD
7e1b55
         # domain status flipped to online during the password change.
7e1b55
@@ -2264,10 +2266,10 @@ class KerberosKeyCopier:
7e1b55
             [paths.KLIST, "-eK", "-k", keytab], log_stdout=False)
7e1b55
 
7e1b55
         keys_to_sync = []
7e1b55
-        for l in result.stdout_text.splitlines():
7e1b55
-            if (princ in l and any(e in l for e in self.valid_etypes)):
7e1b55
+        for line in result.stdout_text.splitlines():
7e1b55
+            if (princ in line and any(e in line for e in self.valid_etypes)):
7e1b55
 
7e1b55
-                els = l.split()
7e1b55
+                els = line.split()
7e1b55
                 els[-2] = els[-2].strip('()')
7e1b55
                 els[-1] = els[-1].strip('()')
7e1b55
                 keys_to_sync.append(KeyEntry._make(els))
7e1b55
-- 
7e1b55
2.31.1
7e1b55