minor changes on stopping threads 96/1096/1
authortierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 10 Feb 2017 13:52:55 +0000 (14:52 +0100)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Fri, 10 Feb 2017 13:52:55 +0000 (14:52 +0100)
Change-Id: I71631de557b5654e3915cee05c34cb6d21088401
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
openvimd.py
ovim.py

index be5d46e..3affa56 100755 (executable)
@@ -171,6 +171,9 @@ if __name__=="__main__":
 
     
     engine = None
+    http_thread = None
+    http_thread_admin = None
+
     try:
         #Load configuration file
         r, config_dic = load_configuration(config_file)
@@ -269,6 +272,10 @@ if __name__=="__main__":
     logger.info('Exiting openvimd')
     if engine:
         engine.stop_service()
+    if http_thread:
+        http_thread.join(1)
+    if http_thread_admin:
+        http_thread_admin.join(1)
 
     logger.debug( "bye!")
     exit()
diff --git a/ovim.py b/ovim.py
index e5cd40d..8c7ba39 100644 (file)
--- a/ovim.py
+++ b/ovim.py
@@ -239,9 +239,6 @@ class ovim():
             thread.insert_task("exit")
         for thread in threads.values():
             thread.join()
-            # http_thread.join()
-            # if http_thread_admin is not None:
-            # http_thread_admin.join()
 
 
     def get_ports(self, columns=None, filter={}, limit=None):