summaryrefslogtreecommitdiff
path: root/python/vyos/xml_ref
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2023-08-09 09:03:28 -0500
committerJohn Estabrook <jestabro@vyos.io>2023-08-09 09:03:28 -0500
commite4b932ed0a140c9ced9a4eb501d520560b125406 (patch)
treee9834ad4b9ea9a04f0f89bd98b0b463e14dada65 /python/vyos/xml_ref
parent9acce7a3c7c87139de291d39c69a90801ac25691 (diff)
downloadvyos-1x-e4b932ed0a140c9ced9a4eb501d520560b125406.tar.gz
vyos-1x-e4b932ed0a140c9ced9a4eb501d520560b125406.zip
xml: T5452: catch lib errors in generate_cache
Diffstat (limited to 'python/vyos/xml_ref')
-rw-r--r--python/vyos/xml_ref/__init__.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/vyos/xml_ref/__init__.py b/python/vyos/xml_ref/__init__.py
index 02bbaffd8..bf434865d 100644
--- a/python/vyos/xml_ref/__init__.py
+++ b/python/vyos/xml_ref/__init__.py
@@ -27,11 +27,15 @@ def load_reference(cache=[]):
try:
from vyos.xml_ref.cache import reference
- xml.define(reference)
- cache.append(xml)
except Exception:
raise ImportError('no xml reference cache !!')
+ if not reference:
+ raise ValueError('empty xml reference cache !!')
+
+ xml.define(reference)
+ cache.append(xml)
+
return xml
def is_tag(path: list) -> bool: