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

Commit

Permalink
Guard pulp3_remote from importer clearing
Browse files Browse the repository at this point in the history
closes #8968
https://pulp.plan.io/issues/8968

We have hit the above issue while 2to3 migrating SLES importers.
Apparently this is sometimes called for SLES importers that already have
their pulp3_remote set to None, resulting in:

'NoneType' object has no attribute 'delete'

We did not perform any deeper analysis of why this is the case, but
simply added this guard to fix the problem.
  • Loading branch information
quba42 authored and goosemania committed Dec 6, 2021
1 parent f5d9b8a commit b8892d7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES/8968.bugfix
@@ -0,0 +1 @@
Fixed ``'NoneType' object has no attribute 'delete'`` error during migration re-runs.
3 changes: 2 additions & 1 deletion pulp_2to3_migration/app/pre_migration.py
Expand Up @@ -612,7 +612,8 @@ def pre_migrate_importer(repo_id, importer_types):
if last_updated != importer.pulp2_last_updated:
# remove Remote in case of feed change
if importer.pulp2_config.get('feed') != importer_data.config.get('feed'):
importer.pulp3_remote.delete()
if importer.pulp3_remote:
importer.pulp3_remote.delete()
importer.pulp3_remote = None
# do not flip is_migrated to False for LCE for at least once migrated importer

Expand Down

0 comments on commit b8892d7

Please sign in to comment.