summaryrefslogtreecommitdiff
path: root/python/vyos/xml_ref/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/vyos/xml_ref/__init__.py')
-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: