summaryrefslogtreecommitdiffstats
path: root/ipapython/ipautil.py
diff options
context:
space:
mode:
authorJan Barta <55042barta@sstebrno.eu>2016-06-02 09:58:52 +0200
committerMartin Basti <mbasti@redhat.com>2016-09-22 16:52:57 +0200
commit36484e8672f5ee1fdc2bd57622e330ab8dbb7671 (patch)
tree1f06a3e4aebbc0e6e7fe28e15c9e677e396932a3 /ipapython/ipautil.py
parent929086e0992cc32a654b4dfa435f536ecb0c665b (diff)
downloadfreeipa-36484e8672f5ee1fdc2bd57622e330ab8dbb7671.tar.gz
freeipa-36484e8672f5ee1fdc2bd57622e330ab8dbb7671.tar.xz
freeipa-36484e8672f5ee1fdc2bd57622e330ab8dbb7671.zip
pylint: fix simplifiable-if-statement warnings
fix inefficient if statements, enable pylint check Reviewed-By: Tomas Krizek <tkrizek@redhat.com> Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
Diffstat (limited to 'ipapython/ipautil.py')
-rw-r--r--ipapython/ipautil.py10
1 files changed, 2 insertions, 8 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py
index 64901b524..62d029d41 100644
--- a/ipapython/ipautil.py
+++ b/ipapython/ipautil.py
@@ -519,20 +519,14 @@ def nolog_replace(string, nolog):
def file_exists(filename):
try:
mode = os.stat(filename)[stat.ST_MODE]
- if stat.S_ISREG(mode):
- return True
- else:
- return False
+ return bool(stat.S_ISREG(mode))
except Exception:
return False
def dir_exists(filename):
try:
mode = os.stat(filename)[stat.ST_MODE]
- if stat.S_ISDIR(mode):
- return True
- else:
- return False
+ return bool(stat.S_ISDIR(mode))
except Exception:
return False