From 95f31b9cfafb810fff2e8b0f15491613e35bc3ae Mon Sep 17 00:00:00 2001 From: j3s Date: Thu, 29 Oct 2020 21:25:45 -0500 Subject: [PATCH] Allow / in template image filename --- capsulflask/virt_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/capsulflask/virt_model.py b/capsulflask/virt_model.py index 2bf8d9a..8ff74cc 100644 --- a/capsulflask/virt_model.py +++ b/capsulflask/virt_model.py @@ -111,10 +111,10 @@ class ShellScriptVirtualization(VirtualizationInterface): def create(self, email: str, id: str, template_image_file_name: str, vcpus: int, memory_mb: int, ssh_public_keys: list): validate_capsul_id(id) - if not re.match(r"^[a-zA-Z0-9_.-]+$", template_image_file_name): - raise ValueError(f"template_image_file_name \"{template_image_file_name}\" must match \"^[a-zA-Z0-9_.-]+$\"") + if not re.match(r"^[a-zA-Z0-9/_.-]+$", template_image_file_name): + raise ValueError(f"template_image_file_name \"{template_image_file_name}\" must match \"^[a-zA-Z0-9/_.-]+$\"") - for ssh_public_key in ssh_public_keys: + for ssh_public_key in ssh_public_keys: if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$", ssh_public_key): raise ValueError(f"ssh_public_key \"{ssh_public_key}\" must match \"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$\"")