From 014835b42dd9c634a8ea07989baa1c1e1b9f576f Mon Sep 17 00:00:00 2001 From: Dmitry Teselkin Date: Fri, 24 Oct 2014 18:21:04 +0400 Subject: [PATCH] Change sequence on actions in updateConfig There is an incorrect sequence of actions in updateConfig() function. The problem is that in case if gearman server is not available the log file will contain number of error messages: 'NoneType' object has no attribute 'db' This is because reconfigureGearmanClient() waits for the servers and blocks call to setConfig() function. At the same time there are number of asynchronous periodic check that have been started. They try to access self.config.db via _geDB() function, which, indeed, is None at that time. So I propose to call reconfigureCrons last before calling setConfig(). Change-Id: Ic55d9e6bc17b10a688bf13c6a076f608073c7dc9 --- nodepool/nodepool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodepool/nodepool.py b/nodepool/nodepool.py index d17da1a58..868fdf98e 100644 --- a/nodepool/nodepool.py +++ b/nodepool/nodepool.py @@ -1636,9 +1636,9 @@ class NodePool(threading.Thread): config = self.loadConfig() self.reconfigureDatabase(config) self.reconfigureManagers(config) - self.reconfigureCrons(config) self.reconfigureUpdateListeners(config) self.reconfigureGearmanClient(config) + self.reconfigureCrons(config) self.setConfig(config) self.reconfigureImageBuilder()