e66971
From 744da6cbfb69d7cca3f38a51be0de98e7fa585d9 Mon Sep 17 00:00:00 2001
e66971
From: Andy Grover <agrover@redhat.com>
e66971
Date: Tue, 30 May 2017 15:37:25 -0700
e66971
Subject: [PATCH] Fix path regex for [ and ]
e66971
e66971
When dealing with ipv6, we now have paths consisting of square
e66971
brackets. We need to add these characters to the path regex for
e66971
them to match properly.
e66971
e66971
Signed-off-by: Andy Grover <agrover@redhat.com>
e66971
---
e66971
 configshell/shell.py | 2 +-
e66971
 1 file changed, 1 insertion(+), 1 deletion(-)
e66971
e66971
diff --git a/configshell/shell.py b/configshell/shell.py
e66971
index e029c76..3d0fce9 100644
e66971
--- a/configshell/shell.py
e66971
+++ b/configshell/shell.py
e66971
@@ -126,7 +126,7 @@ class ConfigShell(object):
e66971
         parameter = kparam | pparam
e66971
         parameters = OneOrMore(parameter)
e66971
         bookmark = Regex('@([A-Za-z0-9:_.]|-)+')
e66971
-        pathstd = Regex('([A-Za-z0-9:_.]|-)*' + '/' + '([A-Za-z0-9:_./]|-)*') \
e66971
+        pathstd = Regex('([A-Za-z0-9:_.\[\]]|-)*' + '/' + '([A-Za-z0-9:_.\[\]/]|-)*') \
e66971
                 | '..' | '.'
e66971
         path = locatedExpr(bookmark | pathstd | '*')('path')
e66971
         parser = Optional(path) + Optional(command) + Optional(parameters)