Project

Profile

Help

Issue #6640

closed

Migrating with custom name raises UnboundLocalError: local variable 'pulp2repo' referenced before assignment

Added by ttereshc over 4 years ago. Updated over 4 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 75
Quarter:

Description

It happens if I specify a name for a repo different from a pulp 2 one. E.g. I'd like to migrate rpm_unsigned.

 {
  "plugins": [
    {
      "type": "rpm",
      "repositories": [
        {
          "name": "random_name",
          "repository_versions": [
            {
              "pulp2_repository_id": "rpm_unsigned",
              "pulp2_distributor_repository_ids": [
                "rpm_unsigned"
              ]
            }
          ],
          "pulp2_importer_repository_id": "rpm_unsigned"
        }
      ]
    }
  ]
}
: pulp: rq.worker:ERROR: UnboundLocalError: local variable 'pulp2repo' referenced before assignment
: Traceback (most recent call last):
: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 886, in perform_job
: rv = job.perform()
: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 664, in perform
: self._result = self._execute()
: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 670, in _execute
: return self.func(*self.args, **self.kwargs)
: File "/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/tasks/migrate.py", line 122, in migrate_from_pulp2
: migrate_repositories(plan)
: File "/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/migration.py", line 99, in migrate_repositories
: pulp2repo.pulp3_repository = repo
: UnboundLocalError: local variable 'pulp2repo' referenced before assignment

Also available in: Atom PDF