summaryrefslogtreecommitdiff
path: root/src/services
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-09-30 17:13:36 -0500
committerJohn Estabrook <jestabro@vyos.io>2020-10-02 13:54:59 -0500
commite58a5831c1c0ca2d9e4954007f4adbd660c20f1c (patch)
treef77f988f9a0bc20fbd07c8e82cf5917fd7037560 /src/services
parent85e0b4b8a72f7f911f5ab8faaf16757e122b59e8 (diff)
downloadvyos-1x-e58a5831c1c0ca2d9e4954007f4adbd660c20f1c.tar.gz
vyos-1x-e58a5831c1c0ca2d9e4954007f4adbd660c20f1c.zip
configd: T2582: catch config initialization errors
Diffstat (limited to 'src/services')
-rwxr-xr-xsrc/services/vyos-configd10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/services/vyos-configd b/src/services/vyos-configd
index fcd119df9..d838bd064 100755
--- a/src/services/vyos-configd
+++ b/src/services/vyos-configd
@@ -27,7 +27,7 @@ import importlib.util
import zmq
from vyos.defaults import directories
-from vyos.configsource import ConfigSourceString
+from vyos.configsource import ConfigSourceString, ConfigSourceError
from vyos.config import Config
from vyos import ConfigError
@@ -151,8 +151,12 @@ def initialization(socket):
except FileNotFoundError:
session_tty = None
- configsource = ConfigSourceString(running_config_text=active_string,
- session_config_text=session_string)
+ try:
+ configsource = ConfigSourceString(running_config_text=active_string,
+ session_config_text=session_string)
+ except ConfigSourceError as e:
+ logger.debug(e)
+ return None
config = Config(config_source=configsource)