diff --git a/CHANGES/7876.bugfix b/CHANGES/7876.bugfix new file mode 100644 index 0000000000..ffd6104e9e --- /dev/null +++ b/CHANGES/7876.bugfix @@ -0,0 +1,2 @@ +Fixed a bug experienced by the migration plugin where all content objects are assumed to have a +remote associated with them. diff --git a/pulpcore/plugin/stages/artifact_stages.py b/pulpcore/plugin/stages/artifact_stages.py index e6c0a83a6b..0968de714b 100644 --- a/pulpcore/plugin/stages/artifact_stages.py +++ b/pulpcore/plugin/stages/artifact_stages.py @@ -293,11 +293,11 @@ def _needed_remote_artifacts(self, batch): raise ValueError( msg.format(rp=content_artifact.relative_path, c=d_content.content) ) - for remote_artifact in content_artifact._remote_artifact_saver_ras: - if remote_artifact.remote_id == d_artifact.remote.pk: - break - else: - if d_artifact.remote: + if d_artifact.remote: + for remote_artifact in content_artifact._remote_artifact_saver_ras: + if remote_artifact.remote_id == d_artifact.remote.pk: + break + else: remote_artifact = self._create_remote_artifact(d_artifact, content_artifact) needed_ras.append(remote_artifact) return needed_ras