Skip to content

Commit

Permalink
Replace ProgressBar with ProgressReport
Browse files Browse the repository at this point in the history
  • Loading branch information
fao89 committed Sep 19, 2019
1 parent 39ccb71 commit 4ca7cde
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES/5468.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replace `ProgressBar` with `ProgressReport`.
6 changes: 3 additions & 3 deletions pulp_ansible/app/tasks/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Artifact,
ContentArtifact,
CreatedResource,
ProgressBar,
ProgressReport,
Remote,
Repository,
RepositoryVersion,
Expand Down Expand Up @@ -275,7 +275,7 @@ async def run(self):
"""
Build and emit `DeclarativeContent` from the ansible metadata.
"""
with ProgressBar(message="Parsing Collection Metadata", code="parsing.metadata") as pb:
with ProgressReport(message="Parsing Collection Metadata", code="parsing.metadata") as pb:
async for metadata in self._fetch_collections():

url = metadata["download_url"]
Expand Down Expand Up @@ -328,7 +328,7 @@ def _get_url(page):
return get_page_url(remote.url, page)

progress_data = dict(message="Parsing Galaxy Collections API", code="parsing.collections")
with ProgressBar(**progress_data) as progress_bar:
with ProgressReport(**progress_data) as progress_bar:
url = _get_url(page_count)
downloader = remote.get_downloader(url=url)
initial_data = parse_metadata(await downloader.run())
Expand Down
6 changes: 3 additions & 3 deletions pulp_ansible/app/tasks/synchronizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from asyncio import FIRST_COMPLETED
from gettext import gettext as _

from pulpcore.plugin.models import Artifact, ProgressBar, Remote, Repository
from pulpcore.plugin.models import Artifact, ProgressReport, Remote, Repository
from pulpcore.plugin.stages import (
DeclarativeArtifact,
DeclarativeContent,
Expand Down Expand Up @@ -78,7 +78,7 @@ async def run(self):
"""
Build and emit `DeclarativeContent` from the ansible metadata.
"""
with ProgressBar(message="Parsing Role Metadata", code="parsing.metadata") as pb:
with ProgressReport(message="Parsing Role Metadata", code="parsing.metadata") as pb:
async for metadata in self._fetch_roles():
for version in metadata["summary_fields"]["versions"]:
url = GITHUB_URL % (
Expand Down Expand Up @@ -131,7 +131,7 @@ async def _fetch_galaxy_pages(self):
remote = self.remote

progress_data = dict(message="Parsing Pages from Galaxy Roles API", code="parsing.roles")
with ProgressBar(**progress_data) as progress_bar:
with ProgressReport(**progress_data) as progress_bar:
downloader = remote.get_downloader(url=get_page_url(remote.url))
metadata = parse_metadata(await downloader.run())

Expand Down

0 comments on commit 4ca7cde

Please sign in to comment.