From e2c90bdac1d589aac69d3da3a55f7ecc2cc4dde7 Mon Sep 17 00:00:00 2001 From: Patrick Tombez <35060345+p-tombez@users.noreply.github.com> Date: Tue, 1 Feb 2022 16:06:20 +0100 Subject: [PATCH] [FIX] cloud_platform_azure: Fix container name pattern check (#338) * [FIX] cloud_platform_azure: Fix container name pattern check * Fix linting --- cloud_platform_azure/models/cloud_platform.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cloud_platform_azure/models/cloud_platform.py b/cloud_platform_azure/models/cloud_platform.py index ea3b19d..e3fca4a 100644 --- a/cloud_platform_azure/models/cloud_platform.py +++ b/cloud_platform_azure/models/cloud_platform.py @@ -92,24 +92,24 @@ class CloudPlatform(models.AbstractModel): " 'ir_attachment.location' parameter." ) # A bucket name is defined under the following format - # ^[a-z]+_[a-z]+_\d+$ + # ^[a-z]+\-[a-z]+\-\d+$ # Anything other than prod bucket must be suffixed with env name # # Use AZURE_STORAGE_NAME_UNSTRUCTURED to by-pass check # on bucket name structure if os.environ.get("AZURE_STORAGE_NAME_UNSTRUCTURED"): return - prod_bucket = bool(re.match(r"^[a-z]+_[a-z]+_\d+$", storage_name)) + prod_bucket = bool(re.match(r"^[a-z]+\-[a-z]+\-\d+$", storage_name)) if environment_name == "prod": assert prod_bucket, ( - "AZURE_STORAGE_NAME should match '^[a-z]+_[a-z]+_\\d+$', " + "AZURE_STORAGE_NAME should match '^[a-z]+\\-[a-z]+\\-\\d+$', " "we got: '%s'" % (storage_name,) ) else: # if we are using the prod bucket on another instance # such as an integration, we must be sure to be in read only! assert not prod_bucket, ( - "AZURE_STORAGE_NAME should not match '^[a-z]+_[a-z]+_\\d+$', " + "AZURE_STORAGE_NAME should not match '^[a-z]+\\-[a-z]+\\-\\d+$', " "we got: '%s'" % (storage_name,) )