6
0
mirror of https://github.com/ChristianLight/tutor.git synced 2025-01-06 07:30:40 +00:00

fix: --mount should accept service names with hyphens

(no changelog entry, as this fixes a feature that hasn't
 yet been released)
This commit is contained in:
Kyle McCormick 2022-04-21 11:43:44 -04:00 committed by Régis Behmo
parent 5a81b6a6cb
commit 126c6062e5
2 changed files with 8 additions and 1 deletions

View File

@ -26,5 +26,12 @@ class ComposeTests(unittest.TestCase):
],
param("lms, cms:/path/to/edx-platform:/openedx/edx-platform"),
)
self.assertEqual(
[
("lms", "/path/to/edx-platform", "/openedx/edx-platform"),
("lms-worker", "/path/to/edx-platform", "/openedx/edx-platform"),
],
param("lms,lms-worker:/path/to/edx-platform:/openedx/edx-platform"),
)
with self.assertRaises(ClickException):
param("lms,:/path/to/edx-platform:/openedx/edx-platform")

View File

@ -102,7 +102,7 @@ class MountParam(click.ParamType):
MountType = t.Tuple[str, str, str]
# Note that this syntax does not allow us to include colon ':' characters in paths
PARAM_REGEXP = (
r"(?P<services>[a-zA-Z0-9_, ]+):(?P<host_path>[^:]+):(?P<container_path>[^:]+)"
r"(?P<services>[a-zA-Z0-9-_, ]+):(?P<host_path>[^:]+):(?P<container_path>[^:]+)"
)
def convert(