summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2017-05-30 15:37:25 -0700
committerAndy Grover <agrover@redhat.com>2017-05-30 15:37:25 -0700
commit744da6cbfb69d7cca3f38a51be0de98e7fa585d9 (patch)
tree8ba4880ab905967688bb22e4bbdf8d1ce87c7f86
parentdaa66bc6acd2430cdd05e9883dd1eab69b698252 (diff)
downloadconfigshell-fb-744da6cbfb69d7cca3f38a51be0de98e7fa585d9.tar.gz
Fix path regex for [ and ]
When dealing with ipv6, we now have paths consisting of square brackets. We need to add these characters to the path regex for them to match properly. Signed-off-by: Andy Grover <agrover@redhat.com>
-rw-r--r--configshell/shell.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/configshell/shell.py b/configshell/shell.py
index e029c76..3d0fce9 100644
--- a/configshell/shell.py
+++ b/configshell/shell.py
@@ -126,7 +126,7 @@ class ConfigShell(object):
parameter = kparam | pparam
parameters = OneOrMore(parameter)
bookmark = Regex('@([A-Za-z0-9:_.]|-)+')
- pathstd = Regex('([A-Za-z0-9:_.]|-)*' + '/' + '([A-Za-z0-9:_./]|-)*') \
+ pathstd = Regex('([A-Za-z0-9:_.\[\]]|-)*' + '/' + '([A-Za-z0-9:_.\[\]/]|-)*') \
| '..' | '.'
path = locatedExpr(bookmark | pathstd | '*')('path')
parser = Optional(path) + Optional(command) + Optional(parameters)