Project

Profile

Help

Issue #6886

closed

migrating a sub-set of previously migrated repos fails with 'ERROR: UnboundLocalError: local variable 'item' referenced before assignment

Added by jsherril@redhat.com over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Sprint/Milestone:
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:

  1. create a pulp2 repository with errata and migrate it
  2. 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 #1

Updated by ipanova@redhat.com over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to ipanova@redhat.com
  • Sprint set to Sprint 74

Added by ipanova@redhat.com over 4 years ago

Revision 39c61820 | View on GitHub

Fix variable reference before assignment.

closes #6886 https://pulp.plan.io/issues/6886

Added by ipanova@redhat.com over 4 years ago

Revision 39c61820 | View on GitHub

Fix variable reference before assignment.

closes #6886 https://pulp.plan.io/issues/6886

Added by ipanova@redhat.com over 4 years ago

Revision 39c61820 | View on GitHub

Fix variable reference before assignment.

closes #6886 https://pulp.plan.io/issues/6886

Actions #2

Updated by ipanova@redhat.com over 4 years ago

  • Status changed from ASSIGNED to POST
  • Triaged changed from No to Yes
Actions #3

Updated by ipanova@redhat.com over 4 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by ttereshc over 4 years ago

  • Sprint/Milestone set to 0.2.0
Actions #7

Updated by ttereshc over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF