From d07e6f86c0ede225e0d314f5cd7e1cdf90566b11 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 13 Feb 2024 15:58:08 -0500 Subject: [PATCH] Provide more useful error messages on mistakes within [] --- confluent_server/confluent/noderange.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/confluent_server/confluent/noderange.py b/confluent_server/confluent/noderange.py index cf99dd72..4a5cb808 100644 --- a/confluent_server/confluent/noderange.py +++ b/confluent_server/confluent/noderange.py @@ -402,12 +402,16 @@ class NodeRange(object): def _expandstring(self, element, filternodes=None): prefix = '' if element[0][0] in ('/', '~'): + if self.purenumeric: + raise Exception('Regular expression not supported within "[]"') element = ''.join(element) nameexpression = element[1:] if self.cfm is None: raise Exception('Verification configmanager required') return set(self.cfm.filter_nodenames(nameexpression, filternodes)) elif '=' in element[0] or '!~' in element[0]: + if self.purenumeric: + raise Exception('The "=" character is invalid within "[]"') element = ''.join(element) if self.cfm is None: raise Exception('Verification configmanager required')