Skip to content

Commit

Permalink
refac(rich): Change text in progress bar.
Browse files Browse the repository at this point in the history
  • Loading branch information
Noahnc committed Nov 29, 2023
1 parent 1e76075 commit e832630
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion infrapatch/core/provider_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import logging as log
from pathlib import Path
from typing import Sequence, Union
from rich import progress
from git import Repo
from pytablewriter import MarkdownTableWriter
from rich.console import Console
Expand Down Expand Up @@ -50,7 +51,7 @@ def upgrade_resources(self) -> bool:
return False
upgradable_resources = self.get_upgradable_resources()
for provider_name, resources in upgradable_resources.items():
for resource in resources:
for resource in progress.track(resources, description=f"Upgrading resources for Provider {self.providers[provider_name].get_provider_display_name()}..."):
try:
resource = self.providers[provider_name].patch_resource(resource)
except Exception as e:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_resources(self) -> Sequence[VersionedResource]:
return []

resources = []
for terraform_file in progress.track(terraform_files, description=f"Parsing .tf files for {self.get_provider_name()}..."):
for terraform_file in progress.track(terraform_files, description=f"Parsing .tf files for {self.get_provider_display_name()}..."):
if self.get_provider_name() == "terraform_modules":
resources.extend(self.hcl_handler.get_terraform_resources_from_file(terraform_file, get_modules=True, get_providers=False))

Expand All @@ -47,7 +47,7 @@ def get_resources(self) -> Sequence[VersionedResource]:
else:
raise Exception(f"Provider name '{self.get_provider_name()}' is not implemented.")

for resource in progress.track(resources, description="Getting newest resource versions..."):
for resource in progress.track(resources, description=f"Getting newest resource versions for Provider {self.get_provider_display_name()}..."):
resource.newest_version = self.registry_handler.get_newest_version(resource)
return resources

Expand Down

0 comments on commit e832630

Please sign in to comment.