Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt changes for awaiting futures from pulpcore #38

Merged
merged 1 commit into from
Dec 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions pulp_container/app/tasks/sync_stages.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def run(self):
tag_dc.extra_data['man_relation'] = list_dc
for manifest_data in content_data.get('manifests'):
man_dc = self.create_manifest(list_dc, manifest_data)
future_manifests.append(man_dc.get_or_create_future())
future_manifests.append(man_dc)
man_dcs[man_dc.content.digest] = man_dc
await self.put(man_dc)
else:
Expand All @@ -122,8 +122,8 @@ async def run(self):
pb_parsed_tags.state = 'completed'
pb_parsed_tags.save()

for manifest_future in asyncio.as_completed(future_manifests):
man = await manifest_future
for manifest_future in future_manifests:
man = await manifest_future.resolution()
with man._artifacts.get().file.open() as content_file:
raw = content_file.read()
content_data = json.loads(raw)
Expand Down Expand Up @@ -301,7 +301,6 @@ def create_manifest(self, list_dc, manifest_data):
content=manifest,
d_artifacts=[da],
extra_data={'relation': list_dc, 'platform': platform},
does_batch=False,
)
return man_dc

Expand Down