From 109e57ffc9fbbe50ebb21f7c9259f5e571989fd5 Mon Sep 17 00:00:00 2001 From: j3s Date: Sat, 16 May 2020 15:56:41 -0500 Subject: [PATCH] Correct template match regex --- capsulflask/virt_model.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capsulflask/virt_model.py b/capsulflask/virt_model.py index 9d1ca1a..06099b9 100644 --- a/capsulflask/virt_model.py +++ b/capsulflask/virt_model.py @@ -110,8 +110,8 @@ 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: if not re.match(r"^(ssh|ecdsa)-[0-9A-Za-z+/_=@. -]+$", ssh_public_key):