summaryrefslogtreecommitdiffstats
path: root/wallace
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:46:48 +0200
commited7a476d6b8e18e1eadcb8d120e6636b0fb97de8 (patch)
tree37c905666e9eb65626ed5fece5a22f6a8c149e96 /wallace
parent3e419b753a2844655362c824cff167583d604bfa (diff)
downloadpykolab-ed7a476d6b8e18e1eadcb8d120e6636b0fb97de8.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
Diffstat (limited to 'wallace')
-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