summaryrefslogtreecommitdiff
path: root/python/vyos/configquery.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-03-01 08:47:41 -0600
committerJohn Estabrook <jestabro@vyos.io>2023-03-01 08:47:41 -0600
commitee95772c8e72a80091e5daa863fa1a76cdedda95 (patch)
treefded95da137c96f5be114d4f1eb40be4e743758f /python/vyos/configquery.py
parent3204cdb1f92b8880fcc7481d17ae2a00e78c6d96 (diff)
downloadvyos-1x-ee95772c8e72a80091e5daa863fa1a76cdedda95.tar.gz
vyos-1x-ee95772c8e72a80091e5daa863fa1a76cdedda95.zip
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.
Diffstat (limited to 'python/vyos/configquery.py')
-rw-r--r--python/vyos/configquery.py2
1 files changed, 1 insertions, 1 deletions
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)