From ee95772c8e72a80091e5daa863fa1a76cdedda95 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 1 Mar 2023 08:47:41 -0600 Subject: graphql: T5040: fail gracefully if not on live system; needed for import For type introspection of op-mode scripts, scripts are loaded as modules. For generation of schema from type introspection, it is useful to load scripts during package installation, hence to fail gracefully if not on live system. --- python/vyos/configquery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/configquery.py b/python/vyos/configquery.py index 5b097b312..85fef8777 100644 --- a/python/vyos/configquery.py +++ b/python/vyos/configquery.py @@ -88,7 +88,7 @@ class ConfigTreeQuery(GenericConfigQuery): with open(config_file) as f: config_string = f.read() except OSError as err: - raise ConfigQueryError('No config file available') from err + config_string = '' config_source = ConfigSourceString(running_config_text=config_string, session_config_text=config_string) -- cgit v1.2.3