[Kimchi-devel] [PATCH] [WoK] Fix pep 1.7.0 E711 error in root.py

dhbarboza82@gmail.com posted 1 patch 4 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/kimchi-wok tags/patchew/20170220194300.23700-1-dhbarboza82@gmail.com
Test Unit Tests passed
src/wok/root.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

[Kimchi-devel] [PATCH] [WoK] Fix pep 1.7.0 E711 error in root.py

Posted by dhbarboza82@gmail.com 4 years, 2 months ago
From: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>

This patch fixes make check-local running with pep 1.7.0. The
problem happening was:

/bin/pep8 --version
1.7.0
/bin/pep8 --filename '*.py,*.py.in' (...)
./src/wok/root.py:204:52: E711 comparison to None should be 'if cond is not None:'
./src/wok/root.py:209:52: E711 comparison to None should be 'if cond is None:'

Signed-off-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
---
 src/wok/root.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/wok/root.py b/src/wok/root.py
index 279ca7f..b525b53 100644
--- a/src/wok/root.py
+++ b/src/wok/root.py
@@ -201,12 +201,12 @@ class WokRoot(Root):
             user_info = auth.login(username, password)
 
             # user logged sucessfuly: reset counters
-            if self.failed_logins.get(user_ip_sid) != None:
+            if self.failed_logins.get(user_ip_sid) is not None:
                 self.failed_logins.pop(user_ip_sid)
         except cherrypy.HTTPError, e:
 
             # store time and prevent too much tries
-            if self.failed_logins.get(user_ip_sid) == None:
+            if self.failed_logins.get(user_ip_sid) is None:
                 self.failed_logins[user_ip_sid] = {"time": time.time(),
                                                    "ip": remote_ip,
                                                    "session_id": session_id,
-- 
2.9.3

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Re: [Kimchi-devel] [PATCH] [WoK] Fix pep 1.7.0 E711 error in root.py

Posted by Aline Manera 4 years, 2 months ago
Applied. Thanks.

Regards,

Aline Manera

_______________________________________________
Kimchi-devel mailing list
Kimchi-devel@ovirt.org
http://lists.ovirt.org/mailman/listinfo/kimchi-devel