Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Don't log any warnings if at least one LCE has been migrated.
Browse files Browse the repository at this point in the history
  • Loading branch information
goosemania committed Sep 2, 2020
1 parent 273003f commit 0710f1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES/7193.bugfix
@@ -0,0 +1 @@
Stopped logging warnings if at least one LCE per content migrated.
10 changes: 6 additions & 4 deletions pulp_2to3_migration/app/plugin/content.py
Expand Up @@ -381,14 +381,11 @@ def get_remote_by_importer_id(importer_id):
# To create multiple remote artifacts, create multiple instances of
# declarative content which will differ by url/remote in their
# declarative artifacts
at_least_one_lce_migrated = False
for lce in pulp2lazycatalog:
remote = get_remote_by_importer_id(lce.pulp2_importer_id)
deferred_download = not pulp2content.downloaded
if not remote and deferred_download:
_logger.warn(_(
'On_demand content cannot be migrated without a remote '
'pulp2 unit_id: {}'.format(pulp2content.pulp2_id))
)
continue

relative_path = (
Expand All @@ -401,9 +398,14 @@ def get_remote_by_importer_id(importer_id):
remote=remote,
deferred_download=deferred_download)
lce.is_migrated = True
at_least_one_lce_migrated = True
dc = DeclarativeContent(content=pulp3content, d_artifacts=[da])
dc.extra_data = future_relations
await self.put(dc)

if not at_least_one_lce_migrated:
_logger.warn(_('On_demand content cannot be migrated without a remote '
'pulp2 unit_id: {}'.format(pulp2content.pulp2_id)))
future_relations.update({'lces': list(pulp2lazycatalog)})
else:
relative_path = (
Expand Down

0 comments on commit 0710f1e

Please sign in to comment.