From 0f37a2a91eb0d0ecf38c9b17ea4dcdad2feb80c2 Mon Sep 17 00:00:00 2001 From: George Pollard Date: Thu, 10 Nov 2022 23:50:38 +0000 Subject: [PATCH] Simplify changes --- src/deployment/deploy.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/deployment/deploy.py b/src/deployment/deploy.py index 5eafc7feb63..a295d30d687 100644 --- a/src/deployment/deploy.py +++ b/src/deployment/deploy.py @@ -17,7 +17,7 @@ import uuid import zipfile from datetime import datetime, timedelta -from typing import Any, Dict, List, Optional, Tuple, TypeVar, Union, cast +from typing import Any, Dict, List, Optional, Tuple, Union, cast from uuid import UUID from azure.common.credentials import get_cli_profile @@ -103,17 +103,6 @@ ] logger = logging.getLogger("deploy") -T = TypeVar("T") - - -def union_lists(list1: List[T], list2: List[T]) -> List[T]: - # this doesn’t use the set() type since we need - # to support values that are not hashable - result = [] - result.extend(list1) - result.extend([x for x in list2 if x not in result]) - return result - def gen_guid() -> str: return str(uuid.uuid4()) @@ -525,8 +514,8 @@ def update_existing_app_registration( # find any identifier URIs that need updating identifier_uris: List[str] = app["identifierUris"] - updated_identifier_uris = union_lists( - identifier_uris, self.get_identifier_urls() + updated_identifier_uris = list( + set(identifier_uris) | set(self.get_identifier_urls()) ) if len(updated_identifier_uris) > len(identifier_uris): update_properties["identifierUris"] = updated_identifier_uris