summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-13 10:46:48 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-13 10:47:00 +0200
commit61eeb5c09b49205cea3913b3f5ad65ac01b0e927 (patch)
treec9b3d7d41b135bfb68ebe8501c85bf4636340a74
parent284dab73ba7b3be17d3c073e807ef42c8a3462e5 (diff)
downloadpykolab-61eeb5c09b49205cea3913b3f5ad65ac01b0e927.tar.gz
Prevent from AttributeError when stopping wallace
Summary: Sometimes self.pool may not exists when killing wallace process Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: vanmeeuwen Differential Revision: https://git.kolab.org/D137
-rw-r--r--wallace/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py
index ddb4256..7ca3d59 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -103,6 +103,7 @@ class WallaceDaemon(object):
def __init__(self):
self.current_connections = 0
self.max_connections = 24
+ self.pool = None
daemon_group = conf.add_cli_parser_option_group(_("Daemon Options"))
@@ -335,8 +336,9 @@ class WallaceDaemon(object):
if os.access(conf.pidfile, os.R_OK):
os.remove(conf.pidfile)
- self.pool.close()
- self.pool.join()
+ if self.pool is not None:
+ self.pool.close()
+ self.pool.join()
raise SystemExit