Skip to content

Commit

Permalink
Fix(cv_deploy): Fix async comprehensions in get_tags (#4332)
Browse files Browse the repository at this point in the history
  • Loading branch information
carl-baillargeon authored Aug 7, 2024
1 parent 2adf14f commit be1896b
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions python-avd/pyavd/_cv/client/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ async def get_tags(
Returns:
List of Tag objects.
"""
tags = []

request = TagStreamRequest(
partial_eq_filter=Tag(
# Notice the "" for workspace, since we are fetching mainline.
Expand All @@ -93,7 +91,7 @@ async def get_tags(
client = TagServiceStub(self._channel)
try:
responses = client.get_all(request, metadata=self._metadata, timeout=timeout)
tags.extend(response.value async for response in responses)
tags = [response.value async for response in responses]
except Exception as e:
raise get_cv_client_exception(e, f"Workspace ID '' (main), Element Type '{element_type}', Creator Type '{creator_type}'") or e

Expand Down Expand Up @@ -196,8 +194,6 @@ async def get_tag_assignments(
Returns:
Workspace object matching the workspace_id
"""
tag_assignments = []

request = TagAssignmentStreamRequest(
partial_eq_filter=TagAssignment(
# Notice the "" for workspace, since we are fetching mainline.
Expand All @@ -209,7 +205,7 @@ async def get_tag_assignments(
client = TagAssignmentServiceStub(self._channel)
try:
responses = client.get_all(request, metadata=self._metadata, timeout=timeout)
tag_assignments.extend(response.value async for response in responses)
tag_assignments = [response.value async for response in responses]
except Exception as e:
raise get_cv_client_exception(e, f"Workspace ID '' (main), Element Type '{element_type}', Creator Type '{creator_type}'") or e

Expand Down

0 comments on commit be1896b

Please sign in to comment.