From 4ca7cde3e98bafb8864c94a56c3a6e39a6fb6e8e Mon Sep 17 00:00:00 2001 From: Fabricio Aguiar Date: Wed, 18 Sep 2019 17:08:46 -0300 Subject: [PATCH] Replace ProgressBar with ProgressReport closes #5468 https://pulp.plan.io/issues/5468 Required PR: https://github.com/pulp/pulpcore/pull/293 Required PR: https://github.com/pulp/pulpcore-plugin/pull/127 Required PR: https://github.com/pulp/pulp_file/pull/277 --- CHANGES/5468.misc | 1 + pulp_ansible/app/tasks/collections.py | 6 +++--- pulp_ansible/app/tasks/synchronizing.py | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 CHANGES/5468.misc diff --git a/CHANGES/5468.misc b/CHANGES/5468.misc new file mode 100644 index 000000000..02efea1ba --- /dev/null +++ b/CHANGES/5468.misc @@ -0,0 +1 @@ +Replace `ProgressBar` with `ProgressReport`. diff --git a/pulp_ansible/app/tasks/collections.py b/pulp_ansible/app/tasks/collections.py index d1df904d5..813118803 100644 --- a/pulp_ansible/app/tasks/collections.py +++ b/pulp_ansible/app/tasks/collections.py @@ -16,7 +16,7 @@ Artifact, ContentArtifact, CreatedResource, - ProgressBar, + ProgressReport, Remote, Repository, RepositoryVersion, @@ -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"] @@ -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()) diff --git a/pulp_ansible/app/tasks/synchronizing.py b/pulp_ansible/app/tasks/synchronizing.py index e6a9b0f23..ac0db0985 100644 --- a/pulp_ansible/app/tasks/synchronizing.py +++ b/pulp_ansible/app/tasks/synchronizing.py @@ -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, @@ -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 % ( @@ -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())