From 6eb469a2d1cf95bf40b61b746d5b4e9dfb988017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Pint=C3=B3=20Biescas?= Date: Fri, 15 Dec 2023 15:46:47 +0100 Subject: [PATCH] Use enum value for function location Passing an enum to an fstring literally uses the full enum name. You need to pass the value. --- Python/taskqueues-backup-images/functions/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Python/taskqueues-backup-images/functions/main.py b/Python/taskqueues-backup-images/functions/main.py index 15991096a4..bdce17fa44 100644 --- a/Python/taskqueues-backup-images/functions/main.py +++ b/Python/taskqueues-backup-images/functions/main.py @@ -97,7 +97,7 @@ def backupapod(req: tasks_fn.CallableRequest) -> str: def enqueuebackuptasks(_: https_fn.Request) -> https_fn.Response: """Adds backup tasks to a Cloud Tasks queue.""" tasks_client = tasks_v2.CloudTasksClient() - task_queue = tasks_client.queue_path(params.PROJECT_ID.value, SupportedRegion.US_CENTRAL1, + task_queue = tasks_client.queue_path(params.PROJECT_ID.value, SupportedRegion.US_CENTRAL1.value, "backupapod") target_uri = get_function_url("backupapod") @@ -126,7 +126,7 @@ def enqueuebackuptasks(_: https_fn.Request) -> https_fn.Response: # [START v2GetFunctionUri] -def get_function_url(name: str, location: str = SupportedRegion.US_CENTRAL1) -> str: +def get_function_url(name: str, location: str = SupportedRegion.US_CENTRAL1.value) -> str: """Get the URL of a given v2 cloud function. Params: