summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rwxr-xr-xpython/vyos/xml_ref/generate_op_cache.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/vyos/xml_ref/generate_op_cache.py b/python/vyos/xml_ref/generate_op_cache.py
index e985e8d6b..7f0bbf115 100755
--- a/python/vyos/xml_ref/generate_op_cache.py
+++ b/python/vyos/xml_ref/generate_op_cache.py
@@ -88,6 +88,14 @@ def translate_position(s: str, pos: list[str]) -> str:
def translate_command(s: str, pos: list[str]) -> str:
s = translate_exec(s)
s = translate_position(s, pos)
+
+ # If there are any untranslated occurences of '_place_holder_",
+ # it means the command is incorrect,
+ # e.g., it references "$6" when it only has five words.
+ if re.search(r'_place_holder_', s):
+ print(f"Command translation failed: {s}")
+ sys.exit(1)
+
return s