Skip to content

Commit ea8d308

Browse files
dralleypatchback[bot]
authored andcommitted
Account for self.config_blob potentially being Null
closes #2122 (cherry picked from commit 0057a97)
1 parent dbac5d6 commit ea8d308

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CHANGES/2122.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix an `AttributeError` issue that most commonly appears when running the `container-handle-image-data` management command.

pulp_container/app/models.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,11 @@ def init_architecture_and_os(self):
228228
if self.json_manifest.get("architecture", None) or self.json_manifest.get("os", None):
229229
self.architecture = self.json_manifest.get("architecture", None)
230230
self.os = self.json_manifest.get("os", None)
231-
return
232-
233-
config_artifact = self.config_blob._artifacts.get()
234-
config_data, _ = get_content_data(config_artifact)
235-
self.architecture = config_data.get("architecture", None)
236-
self.os = config_data.get("os", None)
231+
elif self.config_blob:
232+
config_artifact = self.config_blob._artifacts.get()
233+
config_data, _ = get_content_data(config_artifact)
234+
self.architecture = config_data.get("architecture", None)
235+
self.os = config_data.get("os", None)
237236

238237
def init_compressed_image_size(self):
239238
# manifestv2 schema1 has only blobSum definition for each layer

0 commit comments

Comments
 (0)