[Kimchi-devel] [PATCH] [Kimchi] Use Wok session timeout value to configure serial console

Aline Manera alinefm at linux.vnet.ibm.com
Tue May 31 04:57:52 UTC 2016


Signed-off-by: Aline Manera <alinefm at linux.vnet.ibm.com>
---
 kimchi.conf             |  3 ---
 serialconsole.py        | 10 ++++++----
 tests/test_config.py.in |  1 -
 3 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/kimchi.conf b/kimchi.conf
index c451703..239b0b4 100644
--- a/kimchi.conf
+++ b/kimchi.conf
@@ -10,8 +10,5 @@ uri = "/plugins/kimchi"
 # in the same network. Check README-federation for more details.
 federation = False
 
-# Serial console timeout (seconds)
-SERIAL_CONSOLE_TIMEOUT = 120
-
 # Automatically create ISO pool on server start up
 create_iso_pool = True
diff --git a/serialconsole.py b/serialconsole.py
index d290798..13ef331 100644
--- a/serialconsole.py
+++ b/serialconsole.py
@@ -27,10 +27,11 @@ import time
 
 from multiprocessing import Process
 
-from wok.plugins.kimchi import model
-from wok.plugins.kimchi.config import config
+from wok.config import config as wok_config
 from wok.utils import wok_log
 
+from wok.plugins.kimchi import model
+
 
 SOCKET_QUEUE_BACKLOG = 0
 CTRL_Q = '\x11'
@@ -207,8 +208,9 @@ class SocketServer(Process):
         client console.
         """
         client, client_addr = self._socket.accept()
-        client.settimeout(config.get('kimchi', {}).
-                          get('SERIAL_CONSOLE_TIMEOUT', 120))
+
+        session_timeout = wok_config.get('server', 'session_timeout')
+        client.settimeout(int(session_timeout) * 60)
         wok_log.info('[%s] Client connected to %s', self.name,
                      self._guest_name)
 
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index 48abd5b..a6728e8 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -82,7 +82,6 @@ class ConfigTests(unittest.TestCase):
             'kimchi': {
                 'federation': False,
                 'create_iso_pool': True,
-                'SERIAL_CONSOLE_TIMEOUT': 120
             },
             '/': {
                 'tools.trailing_slash.on': False,
-- 
2.5.5




More information about the Kimchi-devel mailing list