Actions
Issue #6886
closedmigrating a sub-set of previously migrated repos fails with 'ERROR: UnboundLocalError: local variable 'item' referenced before assignment
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Katello
Sprint:
Sprint 74
Quarter:
Description
I believe to reproduce you would:
- create a pulp2 repository with errata and migrate it
- create a new pulp2 repository with errata (i synced the same content in this case), and ONLY migrate that one
You'll get this error:
pulp: rq.worker:ERROR: UnboundLocalError: local variable 'item' referenced before assignment
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/rq/worker.py", line 886, in perform_job
rv = job.perform()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 664, in perform
self._result = self._execute()
File "/usr/lib/python3.6/site-packages/rq/job.py", line 670, in _execute
return self.func(*self.args, **self.kwargs)
File "/usr/local/lib/python3.6/site-packages/pulp_2to3_migration/app/tasks/migrate.py", line 124, in migrate_from_pulp2
pre_migrate_all_content(plan)
File "/usr/local/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py", line 66, in pre_migrate_all_content
pre_migrate_content(content_model, mutable_type, lazy_type, premigrate_hook)
File "/usr/local/lib/python3.6/site-packages/pulp_2to3_migration/app/pre_migration.py", line 162, in pre_migrate_content
'Add content item to the list to migrate: {item}'.format(item=item))
UnboundLocalError: local variable 'item' referenced before assignment
I don't think this would be a common use case in katello, usually if we stop including a repo in a migration its been deleted from pulp, but looked like a simple fix (indent two lines)
Actions
Fix variable reference before assignment.
closes #6886 https://pulp.plan.io/issues/6886