summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/util/__init__.py
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-09-27 16:07:29 -0400
committerKali Kaneko <kali@leap.se>2013-09-30 13:58:15 -0400
commitf2c68ba96498f8b88e415aaf27ced735c790510e (patch)
tree6eccf873ae1ef31c8ec4b268e6eb9485f2516c80 /src/leap/bitmask/util/__init__.py
parent4728ea9e5cbb0f7ed47e7ca609c0531a31c847e0 (diff)
Improve error handling during soledad boostrapping in the client.
The aim is to have better logs for debugging the different problems behind issues like #3619 and #3867. As I'm finding a good quantity of SSL handshake timeouts, I'm also adding a litte retry subroutine to the load_and_sync. Also, initialization and sync calls are separeted to be able to correlate logs with server-side soledad.
Diffstat (limited to 'src/leap/bitmask/util/__init__.py')
-rw-r--r--src/leap/bitmask/util/__init__.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/leap/bitmask/util/__init__.py b/src/leap/bitmask/util/__init__.py
index f762a350..b58e6e3b 100644
--- a/src/leap/bitmask/util/__init__.py
+++ b/src/leap/bitmask/util/__init__.py
@@ -62,3 +62,17 @@ def update_modification_ts(path):
"""
os.utime(path, None)
return get_modification_ts(path)
+
+
+def is_file(path):
+ """
+ Returns True if the path exists and is a file.
+ """
+ return os.path.isfile(path)
+
+
+def is_empty_file(path):
+ """
+ Returns True if the file at path is empty.
+ """
+ return os.stat(path).st_size is 0