- Add a new parameter in config.py to make it easier for users to
configure the serial console timeout.
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
kimchi.conf | 3 +++
serialconsole.py | 5 +++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/kimchi.conf b/kimchi.conf
index 1bfd6f9..9e0f20d 100644
--- a/kimchi.conf
+++ b/kimchi.conf
@@ -10,6 +10,9 @@ 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 5295f68..349689f 100644
--- a/serialconsole.py
+++ b/serialconsole.py
@@ -28,11 +28,11 @@ import time
from multiprocessing import Process
from wok.plugins.kimchi import model
+from wok.plugins.kimchi.config import config
from wok.utils import wok_log
SOCKET_QUEUE_BACKLOG = 0
-DEFAULT_TIMEOUT = 120 # seconds
CTRL_Q = '\x11'
BASE_DIRECTORY = '/run'
@@ -170,7 +170,8 @@ class SocketServer(Process):
client console.
"""
client, client_addr = self._socket.accept()
- client.settimeout(DEFAULT_TIMEOUT)
+ client.settimeout(config.get('kimchi', {}).
+ get('SERIAL_CONSOLE_TIMEOUT', 120))
wok_log.info('[%s] Client connected to %s', self.name,
self._guest_name)
--
1.9.1