Skip to content

Commit

Permalink
fix(provider_handler): Fix resource replace in cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
Noahnc committed Nov 29, 2023
1 parent da1fa8d commit 7122444
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infrapatch/core/provider_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_markdown_table_for_changed_resources(self) -> list[MarkdownTableWriter]:
def set_resources_patched_based_on_existing_resources(self, original_resources: dict[str, Sequence[VersionedResource]]) -> None:
for provider_name, provider in self.providers.items():
original_resources_provider = original_resources[provider_name]
for resource in self._resource_cache[provider_name]:
for i, resource in enumerate(self._resource_cache[provider_name]):
found_resources = resource.find(original_resources_provider)
if len(found_resources) == 0:
log.debug(f"Resource '{resource.name}' not found in original resources. Skipping update.")
Expand All @@ -156,4 +156,4 @@ def set_resources_patched_based_on_existing_resources(self, original_resources:
log.debug(f"Updating resource '{resource.name}' from provider {provider_name} with original resource.")
found_resource = found_resources[0]
found_resource.set_patched()
resource = found_resource
self._resource_cache[provider_name][i] = found_resource # type: ignore

0 comments on commit 7122444

Please sign in to comment.