diff --git a/CHANGES/2122.bugfix b/CHANGES/2122.bugfix new file mode 100644 index 000000000..ab8ce4489 --- /dev/null +++ b/CHANGES/2122.bugfix @@ -0,0 +1 @@ +Fix an `AttributeError` issue that most commonly appears when running the `container-handle-image-data` management command. \ No newline at end of file diff --git a/pulp_container/app/models.py b/pulp_container/app/models.py index 50c32690a..1889410cc 100644 --- a/pulp_container/app/models.py +++ b/pulp_container/app/models.py @@ -226,12 +226,11 @@ def init_architecture_and_os(self): if self.json_manifest.get("architecture", None) or self.json_manifest.get("os", None): self.architecture = self.json_manifest.get("architecture", None) self.os = self.json_manifest.get("os", None) - return - - config_artifact = self.config_blob._artifacts.get() - config_data, _ = get_content_data(config_artifact) - self.architecture = config_data.get("architecture", None) - self.os = config_data.get("os", None) + elif self.config_blob: + config_artifact = self.config_blob._artifacts.get() + config_data, _ = get_content_data(config_artifact) + self.architecture = config_data.get("architecture", None) + self.os = config_data.get("os", None) def init_compressed_image_size(self): # manifestv2 schema1 has only blobSum definition for each layer diff --git a/requirements.txt b/requirements.txt index 96ee76ddb..e245734e7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ jsonschema>=4.4,<4.24 pulpcore>=3.49.0,<3.70 pyjwt[crypto]>=2.4,<2.10 +pycares<4.9 \ No newline at end of file