[Kimchi-devel] [PATCH 1/2] Bug fix: Consider server is being started up on servermethod function

Aline Manera alinefm at linux.vnet.ibm.com
Thu Mar 19 20:27:24 UTC 2015


The feature tests run when the cherrpy server is being started up so we
need to consider that scenario on servermethod otherwise we will get
wrong values while running Kimchi.

Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 src/kimchi/utils.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index 86fecd9..d71338a 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -392,7 +392,8 @@ def get_unique_file_name(all_names, name):
 
 def servermethod(f):
     def wrapper(*args, **kwargs):
-        if str(cherrypy.engine.state) != "states.STARTED":
+        server_state = str(cherrypy.engine.state)
+        if server_state not in ["states.STARTED", "states.STARTING"]:
             return False
         return f(*args, **kwargs)
     return wrapper
-- 
2.1.0




More information about the Kimchi-devel mailing list